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 0a06144e87c3481937292b558560558471f28e50..2c265d039c20d055007d05bda3d39b5de02d277c 100644 |
--- a/cc/trees/layer_tree_host_pixeltest_readback.cc |
+++ b/cc/trees/layer_tree_host_pixeltest_readback.cc |
@@ -1144,6 +1144,37 @@ TEST_F(LayerTreeHostReadbackPixelTest, ReadbackNonRootLayerOutsideViewport) { |
base::FilePath(FILE_PATH_LITERAL("green_with_blue_corner.png"))); |
} |
+class LayerTreeHostReadbackNonFirstNonRootRenderPassTest |
danakj
2015/02/07 00:12:57
Sorry, last thing. It should be ....NonRootRenderP
|
+ : public LayerTreeHostReadbackPixelTest, |
+ public testing::WithParamInterface<bool> {}; |
+ |
+TEST_P(LayerTreeHostReadbackNonFirstNonRootRenderPassTest, |
+ ReadbackNonRootOrFirstLayer) { |
+ // This test has 3 render passes with the copy request on the render pass in |
+ // the middle. Doing a copy request can be destructive of state, so for render |
+ // passes after the first drawn the code path is different. This verifies the |
+ // non-first and non-root path. See http://crbug.com/99393 for more info. |
+ scoped_refptr<SolidColorLayer> background = |
+ CreateSolidColorLayer(gfx::Rect(200, 200), SK_ColorGREEN); |
+ |
+ scoped_refptr<SolidColorLayer> blue = |
+ CreateSolidColorLayer(gfx::Rect(150, 150, 50, 50), SK_ColorBLUE); |
+ blue->RequestCopyOfOutput(CopyOutputRequest::CreateBitmapRequest( |
+ base::Bind(&IgnoreReadbackResult))); |
+ background->AddChild(blue); |
+ |
+ RunReadbackTestWithReadbackTarget( |
+ GetParam() ? PIXEL_TEST_GL : PIXEL_TEST_SOFTWARE, |
+ READBACK_DEFAULT, |
+ background, |
+ background.get(), |
+ base::FilePath(FILE_PATH_LITERAL("green_with_blue_corner.png"))); |
+} |
+ |
+INSTANTIATE_TEST_CASE_P(LayerTreeHostReadbackNonFirstNonRootRenderPassTests, |
+ LayerTreeHostReadbackNonFirstNonRootRenderPassTest, |
+ testing::Bool()); |
+ |
} // namespace |
} // namespace cc |