Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: android_webview/browser/in_process_view_renderer.cc

Issue 23171014: Fix UpdateTilePriorities viewport in Android WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to 221292 Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/debug/overdraw_metrics.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/browser/in_process_view_renderer.h" 5 #include "android_webview/browser/in_process_view_renderer.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "android_webview/browser/aw_gl_surface.h" 9 #include "android_webview/browser/aw_gl_surface.h"
10 #include "android_webview/browser/scoped_app_gl_state_restore.h" 10 #include "android_webview/browser/scoped_app_gl_state_restore.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 transform.Translate(scroll_at_start_of_frame_.x(), 380 transform.Translate(scroll_at_start_of_frame_.x(),
381 scroll_at_start_of_frame_.y()); 381 scroll_at_start_of_frame_.y());
382 gfx::Rect clip_rect(draw_info->clip_left, 382 gfx::Rect clip_rect(draw_info->clip_left,
383 draw_info->clip_top, 383 draw_info->clip_top,
384 draw_info->clip_right - draw_info->clip_left, 384 draw_info->clip_right - draw_info->clip_left,
385 draw_info->clip_bottom - draw_info->clip_top); 385 draw_info->clip_bottom - draw_info->clip_top);
386 386
387 // Assume we always draw the full visible rect if we are drawing into a layer. 387 // Assume we always draw the full visible rect if we are drawing into a layer.
388 bool drew_full_visible_rect = true; 388 bool drew_full_visible_rect = true;
389 389
390 gfx::Rect viewport_rect;
390 if (!draw_info->is_layer) { 391 if (!draw_info->is_layer) {
391 clip_rect.Intersect(cached_global_visible_rect_); 392 viewport_rect = cached_global_visible_rect_;
392 drew_full_visible_rect = clip_rect.Contains(cached_global_visible_rect_); 393 clip_rect.Intersect(viewport_rect);
394 drew_full_visible_rect = clip_rect.Contains(viewport_rect);
395 } else {
396 viewport_rect = clip_rect;
393 } 397 }
394 398
395 block_invalidates_ = true; 399 block_invalidates_ = true;
396 // TODO(joth): Check return value. 400 // TODO(joth): Check return value.
397 compositor_->DemandDrawHw(gfx::Size(draw_info->width, draw_info->height), 401 compositor_->DemandDrawHw(gfx::Size(draw_info->width, draw_info->height),
398 transform, 402 transform,
403 viewport_rect,
399 clip_rect, 404 clip_rect,
400 state_restore.stencil_enabled()); 405 state_restore.stencil_enabled());
401 block_invalidates_ = false; 406 block_invalidates_ = false;
402 gl_surface_->ResetBackingFrameBufferObject(); 407 gl_surface_->ResetBackingFrameBufferObject();
403 408
404 EnsureContinuousInvalidation(draw_info, !drew_full_visible_rect); 409 EnsureContinuousInvalidation(draw_info, !drew_full_visible_rect);
405 } 410 }
406 411
407 void InProcessViewRenderer::SetGlobalVisibleRect( 412 void InProcessViewRenderer::SetGlobalVisibleRect(
408 const gfx::Rect& visible_rect) { 413 const gfx::Rect& visible_rect) {
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 base::StringAppendF(&str, 858 base::StringAppendF(&str,
854 "surface width height: [%d %d] ", 859 "surface width height: [%d %d] ",
855 draw_info->width, 860 draw_info->width,
856 draw_info->height); 861 draw_info->height);
857 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer); 862 base::StringAppendF(&str, "is_layer: %d ", draw_info->is_layer);
858 } 863 }
859 return str; 864 return str;
860 } 865 }
861 866
862 } // namespace android_webview 867 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | cc/debug/overdraw_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698