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

Unified Diff: android_webview/browser/browser_view_renderer.cc

Issue 394113002: Tiling priorities in Android Webview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added a unit test for PictureLayerImpl Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/browser/browser_view_renderer.cc
diff --git a/android_webview/browser/browser_view_renderer.cc b/android_webview/browser/browser_view_renderer.cc
index b958dae01ffed772b4cec39af5c85b189334e3ef..ef21d0e4122abc69a18397ee2c65bf3d1ad09968 100644
--- a/android_webview/browser/browser_view_renderer.cc
+++ b/android_webview/browser/browser_view_renderer.cc
@@ -5,6 +5,7 @@
#include "android_webview/browser/browser_view_renderer.h"
#include "android_webview/browser/browser_view_renderer_client.h"
+#include "android_webview/browser/parent_compositor_draw_constraints.h"
boliu 2014/07/29 19:02:41 This include should be in browser_view_renderer.h,
hush (inactive) 2014/07/29 21:14:20 I did compile this successfully, due to luck: bvr.
#include "android_webview/browser/shared_renderer_state.h"
#include "android_webview/common/aw_switches.h"
#include "android_webview/public/browser/draw_gl.h"
@@ -259,14 +260,29 @@ bool BrowserViewRenderer::OnDrawHardware(jobject java_canvas) {
draw_gl_input->width = width_;
draw_gl_input->height = height_;
- gfx::Transform transform;
gfx::Size surface_size(width_, height_);
gfx::Rect viewport(surface_size);
- // TODO(boliu): Should really be |last_on_draw_global_visible_rect_|.
- // See crbug.com/372073.
gfx::Rect clip = viewport;
- scoped_ptr<cc::CompositorFrame> frame = compositor_->DemandDrawHw(
- surface_size, transform, viewport, clip);
+ gfx::Rect viewport_rect_for_tile_priority;
boliu 2014/07/29 19:02:41 nit: move this down below to where it's first used
hush (inactive) 2014/07/29 21:14:21 Done.
+ parent_draw_constraints_ = shared_renderer_state_->ParentDrawConstraints();
boliu 2014/07/29 19:02:41 nit: move this to the first line of this block.
hush (inactive) 2014/07/29 21:14:20 Done.
+ gfx::Transform transform_for_tile_priority =
+ parent_draw_constraints_.transform;
+
+ // If the WebView is on a layer, the parent transform is just an identity
+ // matrix and WebView does not know what transform is applied onto the layer.
+ // In this case, just use the surface rect for tiling.
+ if (parent_draw_constraints_.is_layer)
+ viewport_rect_for_tile_priority = parent_draw_constraints_.surface_rect;
+ else
+ viewport_rect_for_tile_priority = last_on_draw_global_visible_rect_;
+
+ scoped_ptr<cc::CompositorFrame> frame =
+ compositor_->DemandDrawHw(surface_size,
+ gfx::Transform(),
+ viewport,
+ clip,
+ viewport_rect_for_tile_priority,
+ transform_for_tile_priority);
if (!frame.get())
return false;

Powered by Google App Engine
This is Rietveld 408576698