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

Unified Diff: cc/trees/layer_tree_host_pixeltest_readback.cc

Issue 19734014: cc: Add some unit tests for readbacks outside of the viewport. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_pixeltest_readback.cc
diff --git a/cc/trees/layer_tree_host_pixeltest_readback.cc b/cc/trees/layer_tree_host_pixeltest_readback.cc
index bd6e217969be82bda18d6dbf48dc1ccec6714142..9b5faddc1bd0476575d9fc824fa203c9be52df8f 100644
--- a/cc/trees/layer_tree_host_pixeltest_readback.cc
+++ b/cc/trees/layer_tree_host_pixeltest_readback.cc
@@ -816,6 +816,28 @@ TEST_F(LayerTreeHostReadbackViaCompositeAndReadbackPixelTest,
"green_small_with_blue_corner.png")));
}
+TEST_F(LayerTreeHostReadbackPixelTest, ReadbackNonRootLayerOutsideViewport) {
+ scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer(
+ gfx::Rect(200, 200), SK_ColorWHITE);
+
+ scoped_refptr<SolidColorLayer> green = CreateSolidColorLayer(
+ gfx::Rect(200, 200), SK_ColorGREEN);
+ // Only the top left quarter of the layer is inside the viewport, so the
+ // blue layer is entirely outside.
+ green->SetPosition(gfx::Point(100, 100));
+ background->AddChild(green);
+
+ scoped_refptr<SolidColorLayer> blue = CreateSolidColorLayer(
+ gfx::Rect(150, 150, 50, 50), SK_ColorBLUE);
+ green->AddChild(blue);
+
+ RunPixelTestWithReadbackTarget(GL_WITH_DEFAULT,
+ background,
+ green.get(),
+ base::FilePath(FILE_PATH_LITERAL(
+ "green_with_blue_corner.png")));
+}
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698