Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 #include "cc/layers/solid_color_layer.h" | 6 #include "cc/layers/solid_color_layer.h" |
| 7 #include "cc/layers/texture_layer.h" | 7 #include "cc/layers/texture_layer.h" |
| 8 #include "cc/output/copy_output_request.h" | 8 #include "cc/output/copy_output_request.h" |
| 9 #include "cc/output/copy_output_result.h" | 9 #include "cc/output/copy_output_result.h" |
| 10 #include "cc/test/fake_picture_layer.h" | 10 #include "cc/test/fake_picture_layer.h" |
| (...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1137 green->AddChild(blue); | 1137 green->AddChild(blue); |
| 1138 | 1138 |
| 1139 RunReadbackTestWithReadbackTarget( | 1139 RunReadbackTestWithReadbackTarget( |
| 1140 PIXEL_TEST_GL, | 1140 PIXEL_TEST_GL, |
| 1141 READBACK_DEFAULT, | 1141 READBACK_DEFAULT, |
| 1142 background, | 1142 background, |
| 1143 green.get(), | 1143 green.get(), |
| 1144 base::FilePath(FILE_PATH_LITERAL("green_with_blue_corner.png"))); | 1144 base::FilePath(FILE_PATH_LITERAL("green_with_blue_corner.png"))); |
| 1145 } | 1145 } |
| 1146 | 1146 |
| 1147 class LayerTreeHostReadbackNonFirstNonRootRenderPassTest | |
|
danakj
2015/02/07 00:12:57
Sorry, last thing. It should be ....NonRootRenderP
| |
| 1148 : public LayerTreeHostReadbackPixelTest, | |
| 1149 public testing::WithParamInterface<bool> {}; | |
| 1150 | |
| 1151 TEST_P(LayerTreeHostReadbackNonFirstNonRootRenderPassTest, | |
| 1152 ReadbackNonRootOrFirstLayer) { | |
| 1153 // This test has 3 render passes with the copy request on the render pass in | |
| 1154 // the middle. Doing a copy request can be destructive of state, so for render | |
| 1155 // passes after the first drawn the code path is different. This verifies the | |
| 1156 // non-first and non-root path. See http://crbug.com/99393 for more info. | |
| 1157 scoped_refptr<SolidColorLayer> background = | |
| 1158 CreateSolidColorLayer(gfx::Rect(200, 200), SK_ColorGREEN); | |
| 1159 | |
| 1160 scoped_refptr<SolidColorLayer> blue = | |
| 1161 CreateSolidColorLayer(gfx::Rect(150, 150, 50, 50), SK_ColorBLUE); | |
| 1162 blue->RequestCopyOfOutput(CopyOutputRequest::CreateBitmapRequest( | |
| 1163 base::Bind(&IgnoreReadbackResult))); | |
| 1164 background->AddChild(blue); | |
| 1165 | |
| 1166 RunReadbackTestWithReadbackTarget( | |
| 1167 GetParam() ? PIXEL_TEST_GL : PIXEL_TEST_SOFTWARE, | |
| 1168 READBACK_DEFAULT, | |
| 1169 background, | |
| 1170 background.get(), | |
| 1171 base::FilePath(FILE_PATH_LITERAL("green_with_blue_corner.png"))); | |
| 1172 } | |
| 1173 | |
| 1174 INSTANTIATE_TEST_CASE_P(LayerTreeHostReadbackNonFirstNonRootRenderPassTests, | |
| 1175 LayerTreeHostReadbackNonFirstNonRootRenderPassTest, | |
| 1176 testing::Bool()); | |
| 1177 | |
| 1147 } // namespace | 1178 } // namespace |
| 1148 } // namespace cc | 1179 } // namespace cc |
| 1149 | 1180 |
| 1150 #endif // OS_ANDROID | 1181 #endif // OS_ANDROID |
| OLD | NEW |