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

Unified Diff: cc/trees/layer_tree_host_pixeltest_readback.cc

Issue 899183003: Fix double lock of texture resource in software renderer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add "Pixel" suffix Created 5 years, 10 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/output/software_renderer_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 0a06144e87c3481937292b558560558471f28e50..6d3c6ec318412c474befc5ebd523cc01a42eb350 100644
--- a/cc/trees/layer_tree_host_pixeltest_readback.cc
+++ b/cc/trees/layer_tree_host_pixeltest_readback.cc
@@ -1144,6 +1144,38 @@ TEST_F(LayerTreeHostReadbackPixelTest, ReadbackNonRootLayerOutsideViewport) {
base::FilePath(FILE_PATH_LITERAL("green_with_blue_corner.png")));
}
+class LayerTreeHostReadbackNonFirstNonRootRenderPassPixelTest
+ : public LayerTreeHostReadbackPixelTest,
+ public testing::WithParamInterface<bool> {};
+
+TEST_P(LayerTreeHostReadbackNonFirstNonRootRenderPassPixelTest,
+ 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(
+ LayerTreeHostReadbackNonFirstNonRootRenderPassPixelTests,
+ LayerTreeHostReadbackNonFirstNonRootRenderPassPixelTest,
+ testing::Bool());
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/output/software_renderer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698