| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/output/compositor_frame.h" | 5 #include "cc/output/compositor_frame.h" |
| 6 #include "cc/quads/render_pass.h" | 6 #include "cc/quads/render_pass.h" |
| 7 #include "cc/quads/solid_color_draw_quad.h" | 7 #include "cc/quads/solid_color_draw_quad.h" |
| 8 #include "cc/quads/surface_draw_quad.h" | 8 #include "cc/quads/surface_draw_quad.h" |
| 9 #include "cc/surfaces/surface.h" | 9 #include "cc/surfaces/surface.h" |
| 10 #include "cc/surfaces/surface_aggregator.h" | 10 #include "cc/surfaces/surface_aggregator.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 SurfaceAggregator aggregator(&manager_); | 74 SurfaceAggregator aggregator(&manager_); |
| 75 scoped_ptr<CompositorFrame> aggregated_frame = | 75 scoped_ptr<CompositorFrame> aggregated_frame = |
| 76 aggregator.Aggregate(root_surface.surface_id()); | 76 aggregator.Aggregate(root_surface.surface_id()); |
| 77 | 77 |
| 78 bool discard_alpha = false; | 78 bool discard_alpha = false; |
| 79 ExactPixelComparator pixel_comparator(discard_alpha); | 79 ExactPixelComparator pixel_comparator(discard_alpha); |
| 80 RenderPassList* pass_list = | 80 RenderPassList* pass_list = |
| 81 &aggregated_frame->delegated_frame_data->render_pass_list; | 81 &aggregated_frame->delegated_frame_data->render_pass_list; |
| 82 EXPECT_TRUE(RunPixelTest(pass_list, | 82 EXPECT_TRUE(RunPixelTest(pass_list, |
| 83 PixelTest::NoOffscreenContext, | |
| 84 base::FilePath(FILE_PATH_LITERAL("green.png")), | 83 base::FilePath(FILE_PATH_LITERAL("green.png")), |
| 85 pixel_comparator)); | 84 pixel_comparator)); |
| 86 } | 85 } |
| 87 | 86 |
| 88 // Draws a frame with simple surface embedding. | 87 // Draws a frame with simple surface embedding. |
| 89 TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) { | 88 TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) { |
| 90 gfx::Size child_size(200, 100); | 89 gfx::Size child_size(200, 100); |
| 91 Surface child_surface(&manager_, NULL, child_size); | 90 Surface child_surface(&manager_, NULL, child_size); |
| 92 Surface root_surface(&manager_, NULL, device_viewport_size_); | 91 Surface root_surface(&manager_, NULL, device_viewport_size_); |
| 93 | 92 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 153 |
| 155 SurfaceAggregator aggregator(&manager_); | 154 SurfaceAggregator aggregator(&manager_); |
| 156 scoped_ptr<CompositorFrame> aggregated_frame = | 155 scoped_ptr<CompositorFrame> aggregated_frame = |
| 157 aggregator.Aggregate(root_surface.surface_id()); | 156 aggregator.Aggregate(root_surface.surface_id()); |
| 158 | 157 |
| 159 bool discard_alpha = false; | 158 bool discard_alpha = false; |
| 160 ExactPixelComparator pixel_comparator(discard_alpha); | 159 ExactPixelComparator pixel_comparator(discard_alpha); |
| 161 RenderPassList* pass_list = | 160 RenderPassList* pass_list = |
| 162 &aggregated_frame->delegated_frame_data->render_pass_list; | 161 &aggregated_frame->delegated_frame_data->render_pass_list; |
| 163 EXPECT_TRUE(RunPixelTest(pass_list, | 162 EXPECT_TRUE(RunPixelTest(pass_list, |
| 164 PixelTest::NoOffscreenContext, | |
| 165 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")), | 163 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")), |
| 166 pixel_comparator)); | 164 pixel_comparator)); |
| 167 } | 165 } |
| 168 | 166 |
| 169 // Tests a surface quad that has a non-identity transform into its pass. | 167 // Tests a surface quad that has a non-identity transform into its pass. |
| 170 TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { | 168 TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { |
| 171 gfx::Size child_size(100, 200); | 169 gfx::Size child_size(100, 200); |
| 172 gfx::Size quad_size(100, 100); | 170 gfx::Size quad_size(100, 100); |
| 173 // Structure: | 171 // Structure: |
| 174 // root (200x200) -> left_child (100x200 @ 0x0, | 172 // root (200x200) -> left_child (100x200 @ 0x0, |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 SurfaceAggregator aggregator(&manager_); | 293 SurfaceAggregator aggregator(&manager_); |
| 296 scoped_ptr<CompositorFrame> aggregated_frame = | 294 scoped_ptr<CompositorFrame> aggregated_frame = |
| 297 aggregator.Aggregate(root_surface.surface_id()); | 295 aggregator.Aggregate(root_surface.surface_id()); |
| 298 | 296 |
| 299 bool discard_alpha = false; | 297 bool discard_alpha = false; |
| 300 ExactPixelComparator pixel_comparator(discard_alpha); | 298 ExactPixelComparator pixel_comparator(discard_alpha); |
| 301 RenderPassList* pass_list = | 299 RenderPassList* pass_list = |
| 302 &aggregated_frame->delegated_frame_data->render_pass_list; | 300 &aggregated_frame->delegated_frame_data->render_pass_list; |
| 303 EXPECT_TRUE(RunPixelTest( | 301 EXPECT_TRUE(RunPixelTest( |
| 304 pass_list, | 302 pass_list, |
| 305 PixelTest::NoOffscreenContext, | |
| 306 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), | 303 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), |
| 307 pixel_comparator)); | 304 pixel_comparator)); |
| 308 } | 305 } |
| 309 | 306 |
| 310 } // namespace | 307 } // namespace |
| 311 } // namespace cc | 308 } // namespace cc |
| 312 | 309 |
| 313 #endif // !defined(OS_ANDROID) | 310 #endif // !defined(OS_ANDROID) |
| OLD | NEW |