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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 delegated_frame_data->render_pass_list.push_back(pass.Pass()); | 83 delegated_frame_data->render_pass_list.push_back(pass.Pass()); |
84 | 84 |
85 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); | 85 scoped_ptr<CompositorFrame> root_frame(new CompositorFrame); |
86 root_frame->delegated_frame_data = delegated_frame_data.Pass(); | 86 root_frame->delegated_frame_data = delegated_frame_data.Pass(); |
87 | 87 |
88 SurfaceId root_surface_id = allocator_.GenerateId(); | 88 SurfaceId root_surface_id = allocator_.GenerateId(); |
89 factory_.Create(root_surface_id, device_viewport_size_); | 89 factory_.Create(root_surface_id, device_viewport_size_); |
90 factory_.SubmitFrame(root_surface_id, root_frame.Pass()); | 90 factory_.SubmitFrame(root_surface_id, root_frame.Pass()); |
91 | 91 |
92 SurfaceAggregator aggregator(&manager_, resource_provider_.get()); | 92 SurfaceAggregator aggregator(&manager_, resource_provider_.get()); |
| 93 std::set<SurfaceId> surface_set; |
93 scoped_ptr<CompositorFrame> aggregated_frame = | 94 scoped_ptr<CompositorFrame> aggregated_frame = |
94 aggregator.Aggregate(root_surface_id); | 95 aggregator.Aggregate(root_surface_id, &surface_set); |
95 factory_.Destroy(root_surface_id); | 96 factory_.Destroy(root_surface_id); |
96 | 97 |
97 bool discard_alpha = false; | 98 bool discard_alpha = false; |
98 ExactPixelComparator pixel_comparator(discard_alpha); | 99 ExactPixelComparator pixel_comparator(discard_alpha); |
99 RenderPassList* pass_list = | 100 RenderPassList* pass_list = |
100 &aggregated_frame->delegated_frame_data->render_pass_list; | 101 &aggregated_frame->delegated_frame_data->render_pass_list; |
101 EXPECT_TRUE(RunPixelTest(pass_list, | 102 EXPECT_TRUE(RunPixelTest(pass_list, |
102 base::FilePath(FILE_PATH_LITERAL("green.png")), | 103 base::FilePath(FILE_PATH_LITERAL("green.png")), |
103 pixel_comparator)); | 104 pixel_comparator)); |
104 } | 105 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); | 166 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); |
166 delegated_frame_data->render_pass_list.push_back(pass.Pass()); | 167 delegated_frame_data->render_pass_list.push_back(pass.Pass()); |
167 | 168 |
168 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 169 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
169 child_frame->delegated_frame_data = delegated_frame_data.Pass(); | 170 child_frame->delegated_frame_data = delegated_frame_data.Pass(); |
170 | 171 |
171 factory_.SubmitFrame(child_surface_id, child_frame.Pass()); | 172 factory_.SubmitFrame(child_surface_id, child_frame.Pass()); |
172 } | 173 } |
173 | 174 |
174 SurfaceAggregator aggregator(&manager_, resource_provider_.get()); | 175 SurfaceAggregator aggregator(&manager_, resource_provider_.get()); |
| 176 std::set<SurfaceId> surface_set; |
175 scoped_ptr<CompositorFrame> aggregated_frame = | 177 scoped_ptr<CompositorFrame> aggregated_frame = |
176 aggregator.Aggregate(root_surface_id); | 178 aggregator.Aggregate(root_surface_id, &surface_set); |
177 | 179 |
178 bool discard_alpha = false; | 180 bool discard_alpha = false; |
179 ExactPixelComparator pixel_comparator(discard_alpha); | 181 ExactPixelComparator pixel_comparator(discard_alpha); |
180 RenderPassList* pass_list = | 182 RenderPassList* pass_list = |
181 &aggregated_frame->delegated_frame_data->render_pass_list; | 183 &aggregated_frame->delegated_frame_data->render_pass_list; |
182 EXPECT_TRUE(RunPixelTest(pass_list, | 184 EXPECT_TRUE(RunPixelTest(pass_list, |
183 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")), | 185 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")), |
184 pixel_comparator)); | 186 pixel_comparator)); |
185 factory_.Destroy(root_surface_id); | 187 factory_.Destroy(root_surface_id); |
186 factory_.Destroy(child_surface_id); | 188 factory_.Destroy(child_surface_id); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); | 307 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); |
306 delegated_frame_data->render_pass_list.push_back(pass.Pass()); | 308 delegated_frame_data->render_pass_list.push_back(pass.Pass()); |
307 | 309 |
308 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); | 310 scoped_ptr<CompositorFrame> child_frame(new CompositorFrame); |
309 child_frame->delegated_frame_data = delegated_frame_data.Pass(); | 311 child_frame->delegated_frame_data = delegated_frame_data.Pass(); |
310 | 312 |
311 factory_.SubmitFrame(right_child_id, child_frame.Pass()); | 313 factory_.SubmitFrame(right_child_id, child_frame.Pass()); |
312 } | 314 } |
313 | 315 |
314 SurfaceAggregator aggregator(&manager_, resource_provider_.get()); | 316 SurfaceAggregator aggregator(&manager_, resource_provider_.get()); |
| 317 std::set<SurfaceId> surface_set; |
315 scoped_ptr<CompositorFrame> aggregated_frame = | 318 scoped_ptr<CompositorFrame> aggregated_frame = |
316 aggregator.Aggregate(root_surface_id); | 319 aggregator.Aggregate(root_surface_id, &surface_set); |
317 | 320 |
318 bool discard_alpha = false; | 321 bool discard_alpha = false; |
319 ExactPixelComparator pixel_comparator(discard_alpha); | 322 ExactPixelComparator pixel_comparator(discard_alpha); |
320 RenderPassList* pass_list = | 323 RenderPassList* pass_list = |
321 &aggregated_frame->delegated_frame_data->render_pass_list; | 324 &aggregated_frame->delegated_frame_data->render_pass_list; |
322 EXPECT_TRUE(RunPixelTest( | 325 EXPECT_TRUE(RunPixelTest( |
323 pass_list, | 326 pass_list, |
324 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), | 327 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), |
325 pixel_comparator)); | 328 pixel_comparator)); |
326 | 329 |
327 factory_.Destroy(root_surface_id); | 330 factory_.Destroy(root_surface_id); |
328 factory_.Destroy(left_child_id); | 331 factory_.Destroy(left_child_id); |
329 factory_.Destroy(right_child_id); | 332 factory_.Destroy(right_child_id); |
330 } | 333 } |
331 | 334 |
332 } // namespace | 335 } // namespace |
333 } // namespace cc | 336 } // namespace cc |
334 | 337 |
335 #endif // !defined(OS_ANDROID) | 338 #endif // !defined(OS_ANDROID) |
OLD | NEW |