summaryrefslogtreecommitdiffstats
path: root/cc/test/pixel_test_output_surface.cc
diff options
context:
space:
mode:
authoraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-05 00:43:28 +0000
committeraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-05 00:43:28 +0000
commit54af0352fb8c3b48b0f379ea1c48006aa1c34615 (patch)
tree8c00bd00f8cde9adbfd90db018205cf2e669d666 /cc/test/pixel_test_output_surface.cc
parent576748e8df1fdb8a21958671fe860946f12c82f5 (diff)
downloadchromium_src-54af0352fb8c3b48b0f379ea1c48006aa1c34615.zip
chromium_src-54af0352fb8c3b48b0f379ea1c48006aa1c34615.tar.gz
chromium_src-54af0352fb8c3b48b0f379ea1c48006aa1c34615.tar.bz2
Fix UpdateTilePriorities viewport in Android WebView.
This patch fixes the tile management viewport to be the on-screen-visible rect for the last hardware draw. There are two problems I needed to solve: 1) Suppress UpdateTilePriorities from happening when the last draw was a software draw, which is specified by the new "viewport_valid_for_tile_management" bool. 2) In some cases, the clip rect is smaller than the WebView's visible viewport -- for example when the Android Browser progress bar is forcing redraws, the clip is only a small area at the top of the screen. I switched to using the visible viewport for UpdateDrawProperties + glViewport, and introduce a separate "DeviceClip" to override glScissor. (It's necessary to make the change at this level, rather than directly plumbing the visible viewport to UpdateTilePriorities, because UpdateTilePriorities also makes use of outputs from the draw properties calculation.) I also cleaned up all uses of device_viewport_size() to call DrawViewportSize() instead, with the sole exception of UnscaledScrollableViewportSize() which should continue to use the main-thread device_viewport_size_ in all cases (because that's the viewport for scrolling, not drawing). New tests: PictureLayerImplTest.SuppressUpdateTilePriorities, ExternalStencilPixelTest.DeviceClip NOTRY=true BUG=232844 Review URL: https://chromiumcodereview.appspot.com/23171014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221321 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test/pixel_test_output_surface.cc')
-rw-r--r--cc/test/pixel_test_output_surface.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/cc/test/pixel_test_output_surface.cc b/cc/test/pixel_test_output_surface.cc
index 9a4d66a..ffc3d26c 100644
--- a/cc/test/pixel_test_output_surface.cc
+++ b/cc/test/pixel_test_output_surface.cc
@@ -15,7 +15,11 @@ void PixelTestOutputSurface::Reshape(gfx::Size size, float scale_factor) {
OutputSurface::Reshape(expanded_size, scale_factor);
gfx::Rect offset_viewport = gfx::Rect(size) + viewport_offset_;
- SetExternalDrawConstraints(gfx::Transform(), offset_viewport);
+ gfx::Rect offset_clip = device_clip_.IsEmpty()
+ ? offset_viewport
+ : device_clip_ + viewport_offset_;
+ SetExternalDrawConstraints(
+ gfx::Transform(), offset_viewport, offset_clip, true);
}
} // namespace cc