Chromium Code Reviews| 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/compositor_frame_sink_support.h" | |
| 9 #include "cc/surfaces/local_surface_id_allocator.h" | 10 #include "cc/surfaces/local_surface_id_allocator.h" |
| 10 #include "cc/surfaces/surface.h" | 11 #include "cc/surfaces/surface.h" |
| 11 #include "cc/surfaces/surface_aggregator.h" | 12 #include "cc/surfaces/surface_aggregator.h" |
| 12 #include "cc/surfaces/surface_factory.h" | |
| 13 #include "cc/surfaces/surface_factory_client.h" | |
| 14 #include "cc/surfaces/surface_manager.h" | 13 #include "cc/surfaces/surface_manager.h" |
| 15 #include "cc/test/pixel_comparator.h" | 14 #include "cc/test/pixel_comparator.h" |
| 16 #include "cc/test/pixel_test.h" | 15 #include "cc/test/pixel_test.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 17 |
| 19 #if !defined(OS_ANDROID) | 18 #if !defined(OS_ANDROID) |
| 20 | 19 |
| 21 namespace cc { | 20 namespace cc { |
| 22 namespace { | 21 namespace { |
| 23 | 22 |
| 24 static constexpr FrameSinkId kArbitraryRootFrameSinkId(1, 1); | 23 static constexpr FrameSinkId kArbitraryRootFrameSinkId(1, 1); |
| 25 static constexpr FrameSinkId kArbitraryChildFrameSinkId(2, 2); | 24 static constexpr FrameSinkId kArbitraryChildFrameSinkId(2, 2); |
| 26 static constexpr FrameSinkId kArbitraryLeftFrameSinkId(3, 3); | 25 static constexpr FrameSinkId kArbitraryLeftFrameSinkId(3, 3); |
| 27 static constexpr FrameSinkId kArbitraryRightFrameSinkId(4, 4); | 26 static constexpr FrameSinkId kArbitraryRightFrameSinkId(4, 4); |
|
Fady Samuel
2017/04/03 22:33:25
get rid of all these statics.
Alex Z.
2017/04/04 14:10:33
Done.
| |
| 28 | 27 |
| 29 class EmptySurfaceFactoryClient : public SurfaceFactoryClient { | |
| 30 public: | |
| 31 void ReturnResources(const ReturnedResourceArray& resources) override {} | |
| 32 void SetBeginFrameSource(BeginFrameSource* begin_frame_source) override {} | |
| 33 }; | |
| 34 | |
| 35 class SurfacesPixelTest : public RendererPixelTest<GLRenderer> { | 28 class SurfacesPixelTest : public RendererPixelTest<GLRenderer> { |
| 36 public: | 29 public: |
| 37 SurfacesPixelTest() | 30 SurfacesPixelTest() |
| 38 : factory_(kArbitraryRootFrameSinkId, &manager_, &client_) {} | 31 : support_(nullptr, |
| 39 ~SurfacesPixelTest() override { factory_.EvictSurface(); } | 32 &manager_, |
| 33 kArbitraryRootFrameSinkId, | |
| 34 true /* is_root */, | |
| 35 true /* handles_frame_sink_id_invalidation */, | |
| 36 true /* needs_sync_points */) {} | |
| 37 ~SurfacesPixelTest() override { support_.EvictFrame(); } | |
| 40 | 38 |
| 41 protected: | 39 protected: |
| 40 static constexpr bool handles_frame_sink_id_invalidation_ = true; | |
| 41 static constexpr bool needs_sync_points_ = true; | |
|
Fady Samuel
2017/04/03 22:33:25
Put these in the anonymous namespace about. Don't
Alex Z.
2017/04/04 14:10:33
Done.
| |
| 42 SurfaceManager manager_; | 42 SurfaceManager manager_; |
| 43 LocalSurfaceIdAllocator allocator_; | 43 LocalSurfaceIdAllocator allocator_; |
| 44 EmptySurfaceFactoryClient client_; | 44 CompositorFrameSinkSupport support_; |
| 45 SurfaceFactory factory_; | |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 SharedQuadState* CreateAndAppendTestSharedQuadState( | 47 SharedQuadState* CreateAndAppendTestSharedQuadState( |
| 49 RenderPass* render_pass, | 48 RenderPass* render_pass, |
| 50 const gfx::Transform& transform, | 49 const gfx::Transform& transform, |
| 51 const gfx::Size& size) { | 50 const gfx::Size& size) { |
| 52 const gfx::Size layer_bounds = size; | 51 const gfx::Size layer_bounds = size; |
| 53 const gfx::Rect visible_layer_rect = gfx::Rect(size); | 52 const gfx::Rect visible_layer_rect = gfx::Rect(size); |
| 54 const gfx::Rect clip_rect = gfx::Rect(size); | 53 const gfx::Rect clip_rect = gfx::Rect(size); |
| 55 bool is_clipped = false; | 54 bool is_clipped = false; |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 78 rect, | 77 rect, |
| 79 rect, | 78 rect, |
| 80 SK_ColorGREEN, | 79 SK_ColorGREEN, |
| 81 force_anti_aliasing_off); | 80 force_anti_aliasing_off); |
| 82 | 81 |
| 83 | 82 |
| 84 CompositorFrame root_frame; | 83 CompositorFrame root_frame; |
| 85 root_frame.render_pass_list.push_back(std::move(pass)); | 84 root_frame.render_pass_list.push_back(std::move(pass)); |
| 86 | 85 |
| 87 LocalSurfaceId root_local_surface_id = allocator_.GenerateId(); | 86 LocalSurfaceId root_local_surface_id = allocator_.GenerateId(); |
| 88 SurfaceId root_surface_id(factory_.frame_sink_id(), root_local_surface_id); | 87 SurfaceId root_surface_id(support_.frame_sink_id(), root_local_surface_id); |
| 89 factory_.SubmitCompositorFrame(root_local_surface_id, std::move(root_frame), | 88 support_.SubmitCompositorFrame(root_local_surface_id, std::move(root_frame)); |
| 90 SurfaceFactory::DrawCallback()); | |
| 91 | 89 |
| 92 SurfaceAggregator aggregator(&manager_, resource_provider_.get(), true); | 90 SurfaceAggregator aggregator(&manager_, resource_provider_.get(), true); |
| 93 CompositorFrame aggregated_frame = aggregator.Aggregate(root_surface_id); | 91 CompositorFrame aggregated_frame = aggregator.Aggregate(root_surface_id); |
| 94 | 92 |
| 95 bool discard_alpha = false; | 93 bool discard_alpha = false; |
| 96 ExactPixelComparator pixel_comparator(discard_alpha); | 94 ExactPixelComparator pixel_comparator(discard_alpha); |
| 97 RenderPassList* pass_list = &aggregated_frame.render_pass_list; | 95 RenderPassList* pass_list = &aggregated_frame.render_pass_list; |
| 98 EXPECT_TRUE(RunPixelTest(pass_list, | 96 EXPECT_TRUE(RunPixelTest(pass_list, |
| 99 base::FilePath(FILE_PATH_LITERAL("green.png")), | 97 base::FilePath(FILE_PATH_LITERAL("green.png")), |
| 100 pixel_comparator)); | 98 pixel_comparator)); |
| 101 } | 99 } |
| 102 | 100 |
| 103 // Draws a frame with simple surface embedding. | 101 // Draws a frame with simple surface embedding. |
| 104 TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) { | 102 TEST_F(SurfacesPixelTest, DrawSimpleAggregatedFrame) { |
| 105 gfx::Size child_size(200, 100); | 103 gfx::Size child_size(200, 100); |
| 106 SurfaceFactory child_factory(kArbitraryChildFrameSinkId, &manager_, &client_); | 104 constexpr bool is_root = false; |
| 105 CompositorFrameSinkSupport child_support( | |
| 106 nullptr, &manager_, kArbitraryChildFrameSinkId, is_root, | |
| 107 handles_frame_sink_id_invalidation_, needs_sync_points_); | |
| 108 | |
| 107 LocalSurfaceId child_local_surface_id = allocator_.GenerateId(); | 109 LocalSurfaceId child_local_surface_id = allocator_.GenerateId(); |
| 108 SurfaceId child_surface_id(child_factory.frame_sink_id(), | 110 SurfaceId child_surface_id(child_support.frame_sink_id(), |
| 109 child_local_surface_id); | 111 child_local_surface_id); |
| 110 LocalSurfaceId root_local_surface_id = allocator_.GenerateId(); | 112 LocalSurfaceId root_local_surface_id = allocator_.GenerateId(); |
| 111 SurfaceId root_surface_id(factory_.frame_sink_id(), root_local_surface_id); | 113 SurfaceId root_surface_id(support_.frame_sink_id(), root_local_surface_id); |
| 112 | 114 |
| 113 { | 115 { |
| 114 gfx::Rect rect(device_viewport_size_); | 116 gfx::Rect rect(device_viewport_size_); |
| 115 int id = 1; | 117 int id = 1; |
| 116 std::unique_ptr<RenderPass> pass = RenderPass::Create(); | 118 std::unique_ptr<RenderPass> pass = RenderPass::Create(); |
| 117 pass->SetNew(id, rect, rect, gfx::Transform()); | 119 pass->SetNew(id, rect, rect, gfx::Transform()); |
| 118 | 120 |
| 119 CreateAndAppendTestSharedQuadState( | 121 CreateAndAppendTestSharedQuadState( |
| 120 pass.get(), gfx::Transform(), device_viewport_size_); | 122 pass.get(), gfx::Transform(), device_viewport_size_); |
| 121 | 123 |
| 122 SurfaceDrawQuad* surface_quad = | 124 SurfaceDrawQuad* surface_quad = |
| 123 pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); | 125 pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); |
| 124 surface_quad->SetNew(pass->shared_quad_state_list.back(), | 126 surface_quad->SetNew(pass->shared_quad_state_list.back(), |
| 125 gfx::Rect(child_size), gfx::Rect(child_size), | 127 gfx::Rect(child_size), gfx::Rect(child_size), |
| 126 child_surface_id, SurfaceDrawQuadType::PRIMARY, | 128 child_surface_id, SurfaceDrawQuadType::PRIMARY, |
| 127 nullptr); | 129 nullptr); |
| 128 | 130 |
| 129 SolidColorDrawQuad* color_quad = | 131 SolidColorDrawQuad* color_quad = |
| 130 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 132 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
| 131 bool force_anti_aliasing_off = false; | 133 bool force_anti_aliasing_off = false; |
| 132 color_quad->SetNew(pass->shared_quad_state_list.back(), | 134 color_quad->SetNew(pass->shared_quad_state_list.back(), |
| 133 rect, | 135 rect, |
| 134 rect, | 136 rect, |
| 135 SK_ColorYELLOW, | 137 SK_ColorYELLOW, |
| 136 force_anti_aliasing_off); | 138 force_anti_aliasing_off); |
| 137 | 139 |
| 138 CompositorFrame root_frame; | 140 CompositorFrame root_frame; |
| 139 root_frame.render_pass_list.push_back(std::move(pass)); | 141 root_frame.render_pass_list.push_back(std::move(pass)); |
| 140 | 142 |
| 141 factory_.SubmitCompositorFrame(root_local_surface_id, std::move(root_frame), | 143 support_.SubmitCompositorFrame(root_local_surface_id, |
| 142 SurfaceFactory::DrawCallback()); | 144 std::move(root_frame)); |
| 143 } | 145 } |
| 144 | 146 |
| 145 { | 147 { |
| 146 gfx::Rect rect(child_size); | 148 gfx::Rect rect(child_size); |
| 147 int id = 1; | 149 int id = 1; |
| 148 std::unique_ptr<RenderPass> pass = RenderPass::Create(); | 150 std::unique_ptr<RenderPass> pass = RenderPass::Create(); |
| 149 pass->SetNew(id, rect, rect, gfx::Transform()); | 151 pass->SetNew(id, rect, rect, gfx::Transform()); |
| 150 | 152 |
| 151 CreateAndAppendTestSharedQuadState( | 153 CreateAndAppendTestSharedQuadState( |
| 152 pass.get(), gfx::Transform(), child_size); | 154 pass.get(), gfx::Transform(), child_size); |
| 153 | 155 |
| 154 SolidColorDrawQuad* color_quad = | 156 SolidColorDrawQuad* color_quad = |
| 155 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 157 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
| 156 bool force_anti_aliasing_off = false; | 158 bool force_anti_aliasing_off = false; |
| 157 color_quad->SetNew(pass->shared_quad_state_list.back(), | 159 color_quad->SetNew(pass->shared_quad_state_list.back(), |
| 158 rect, | 160 rect, |
| 159 rect, | 161 rect, |
| 160 SK_ColorBLUE, | 162 SK_ColorBLUE, |
| 161 force_anti_aliasing_off); | 163 force_anti_aliasing_off); |
| 162 | 164 |
| 163 CompositorFrame child_frame; | 165 CompositorFrame child_frame; |
| 164 child_frame.render_pass_list.push_back(std::move(pass)); | 166 child_frame.render_pass_list.push_back(std::move(pass)); |
| 165 | 167 |
| 166 child_factory.SubmitCompositorFrame(child_local_surface_id, | 168 child_support.SubmitCompositorFrame(child_local_surface_id, |
| 167 std::move(child_frame), | 169 std::move(child_frame)); |
| 168 SurfaceFactory::DrawCallback()); | |
| 169 } | 170 } |
| 170 | 171 |
| 171 SurfaceAggregator aggregator(&manager_, resource_provider_.get(), true); | 172 SurfaceAggregator aggregator(&manager_, resource_provider_.get(), true); |
| 172 CompositorFrame aggregated_frame = aggregator.Aggregate(root_surface_id); | 173 CompositorFrame aggregated_frame = aggregator.Aggregate(root_surface_id); |
| 173 | 174 |
| 174 bool discard_alpha = false; | 175 bool discard_alpha = false; |
| 175 ExactPixelComparator pixel_comparator(discard_alpha); | 176 ExactPixelComparator pixel_comparator(discard_alpha); |
| 176 RenderPassList* pass_list = &aggregated_frame.render_pass_list; | 177 RenderPassList* pass_list = &aggregated_frame.render_pass_list; |
| 177 EXPECT_TRUE(RunPixelTest(pass_list, | 178 EXPECT_TRUE(RunPixelTest(pass_list, |
| 178 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")), | 179 base::FilePath(FILE_PATH_LITERAL("blue_yellow.png")), |
| 179 pixel_comparator)); | 180 pixel_comparator)); |
| 180 | 181 |
| 181 child_factory.EvictSurface(); | 182 child_support.EvictFrame(); |
| 182 } | 183 } |
| 183 | 184 |
| 184 // Tests a surface quad that has a non-identity transform into its pass. | 185 // Tests a surface quad that has a non-identity transform into its pass. |
| 185 TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { | 186 TEST_F(SurfacesPixelTest, DrawAggregatedFrameWithSurfaceTransforms) { |
| 186 gfx::Size child_size(100, 200); | 187 gfx::Size child_size(100, 200); |
| 187 gfx::Size quad_size(100, 100); | 188 gfx::Size quad_size(100, 100); |
| 188 // Structure: | 189 // Structure: |
| 189 // root (200x200) -> left_child (100x200 @ 0x0, | 190 // root (200x200) -> left_child (100x200 @ 0x0, |
| 190 // right_child (100x200 @ 0x100) | 191 // right_child (100x200 @ 0x100) |
| 191 // left_child -> top_green_quad (100x100 @ 0x0), | 192 // left_child -> top_green_quad (100x100 @ 0x0), |
| 192 // bottom_blue_quad (100x100 @ 0x100) | 193 // bottom_blue_quad (100x100 @ 0x100) |
| 193 // right_child -> top_blue_quad (100x100 @ 0x0), | 194 // right_child -> top_blue_quad (100x100 @ 0x0), |
| 194 // bottom_green_quad (100x100 @ 0x100) | 195 // bottom_green_quad (100x100 @ 0x100) |
| 195 SurfaceFactory left_factory(kArbitraryLeftFrameSinkId, &manager_, &client_); | 196 constexpr bool is_root = false; |
| 196 SurfaceFactory right_factory(kArbitraryRightFrameSinkId, &manager_, &client_); | 197 CompositorFrameSinkSupport left_support( |
| 198 nullptr, &manager_, kArbitraryLeftFrameSinkId, is_root, | |
| 199 handles_frame_sink_id_invalidation_, needs_sync_points_); | |
| 200 CompositorFrameSinkSupport right_support( | |
| 201 nullptr, &manager_, kArbitraryRightFrameSinkId, is_root, | |
| 202 handles_frame_sink_id_invalidation_, needs_sync_points_); | |
| 197 LocalSurfaceId left_child_local_id = allocator_.GenerateId(); | 203 LocalSurfaceId left_child_local_id = allocator_.GenerateId(); |
| 198 SurfaceId left_child_id(left_factory.frame_sink_id(), left_child_local_id); | 204 SurfaceId left_child_id(left_support.frame_sink_id(), left_child_local_id); |
| 199 LocalSurfaceId right_child_local_id = allocator_.GenerateId(); | 205 LocalSurfaceId right_child_local_id = allocator_.GenerateId(); |
| 200 SurfaceId right_child_id(right_factory.frame_sink_id(), right_child_local_id); | 206 SurfaceId right_child_id(right_support.frame_sink_id(), right_child_local_id); |
| 201 LocalSurfaceId root_local_surface_id = allocator_.GenerateId(); | 207 LocalSurfaceId root_local_surface_id = allocator_.GenerateId(); |
| 202 SurfaceId root_surface_id(factory_.frame_sink_id(), root_local_surface_id); | 208 SurfaceId root_surface_id(support_.frame_sink_id(), root_local_surface_id); |
| 203 | 209 |
| 204 { | 210 { |
| 205 gfx::Rect rect(device_viewport_size_); | 211 gfx::Rect rect(device_viewport_size_); |
| 206 int id = 1; | 212 int id = 1; |
| 207 std::unique_ptr<RenderPass> pass = RenderPass::Create(); | 213 std::unique_ptr<RenderPass> pass = RenderPass::Create(); |
| 208 pass->SetNew(id, rect, rect, gfx::Transform()); | 214 pass->SetNew(id, rect, rect, gfx::Transform()); |
| 209 | 215 |
| 210 gfx::Transform surface_transform; | 216 gfx::Transform surface_transform; |
| 211 CreateAndAppendTestSharedQuadState( | 217 CreateAndAppendTestSharedQuadState( |
| 212 pass.get(), surface_transform, device_viewport_size_); | 218 pass.get(), surface_transform, device_viewport_size_); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 225 SurfaceDrawQuad* right_surface_quad = | 231 SurfaceDrawQuad* right_surface_quad = |
| 226 pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); | 232 pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); |
| 227 right_surface_quad->SetNew(pass->shared_quad_state_list.back(), | 233 right_surface_quad->SetNew(pass->shared_quad_state_list.back(), |
| 228 gfx::Rect(child_size), gfx::Rect(child_size), | 234 gfx::Rect(child_size), gfx::Rect(child_size), |
| 229 right_child_id, SurfaceDrawQuadType::PRIMARY, | 235 right_child_id, SurfaceDrawQuadType::PRIMARY, |
| 230 nullptr); | 236 nullptr); |
| 231 | 237 |
| 232 CompositorFrame root_frame; | 238 CompositorFrame root_frame; |
| 233 root_frame.render_pass_list.push_back(std::move(pass)); | 239 root_frame.render_pass_list.push_back(std::move(pass)); |
| 234 | 240 |
| 235 factory_.SubmitCompositorFrame(root_local_surface_id, std::move(root_frame), | 241 support_.SubmitCompositorFrame(root_local_surface_id, |
| 236 SurfaceFactory::DrawCallback()); | 242 std::move(root_frame)); |
| 237 } | 243 } |
| 238 | 244 |
| 239 { | 245 { |
| 240 gfx::Rect rect(child_size); | 246 gfx::Rect rect(child_size); |
| 241 int id = 1; | 247 int id = 1; |
| 242 std::unique_ptr<RenderPass> pass = RenderPass::Create(); | 248 std::unique_ptr<RenderPass> pass = RenderPass::Create(); |
| 243 pass->SetNew(id, rect, rect, gfx::Transform()); | 249 pass->SetNew(id, rect, rect, gfx::Transform()); |
| 244 | 250 |
| 245 CreateAndAppendTestSharedQuadState( | 251 CreateAndAppendTestSharedQuadState( |
| 246 pass.get(), gfx::Transform(), child_size); | 252 pass.get(), gfx::Transform(), child_size); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 258 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 264 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
| 259 bottom_color_quad->SetNew(pass->shared_quad_state_list.back(), | 265 bottom_color_quad->SetNew(pass->shared_quad_state_list.back(), |
| 260 gfx::Rect(0, 100, 100, 100), | 266 gfx::Rect(0, 100, 100, 100), |
| 261 gfx::Rect(0, 100, 100, 100), | 267 gfx::Rect(0, 100, 100, 100), |
| 262 SK_ColorBLUE, | 268 SK_ColorBLUE, |
| 263 force_anti_aliasing_off); | 269 force_anti_aliasing_off); |
| 264 | 270 |
| 265 CompositorFrame child_frame; | 271 CompositorFrame child_frame; |
| 266 child_frame.render_pass_list.push_back(std::move(pass)); | 272 child_frame.render_pass_list.push_back(std::move(pass)); |
| 267 | 273 |
| 268 left_factory.SubmitCompositorFrame(left_child_local_id, | 274 left_support.SubmitCompositorFrame(left_child_local_id, |
| 269 std::move(child_frame), | 275 std::move(child_frame)); |
| 270 SurfaceFactory::DrawCallback()); | |
| 271 } | 276 } |
| 272 | 277 |
| 273 { | 278 { |
| 274 gfx::Rect rect(child_size); | 279 gfx::Rect rect(child_size); |
| 275 int id = 1; | 280 int id = 1; |
| 276 std::unique_ptr<RenderPass> pass = RenderPass::Create(); | 281 std::unique_ptr<RenderPass> pass = RenderPass::Create(); |
| 277 pass->SetNew(id, rect, rect, gfx::Transform()); | 282 pass->SetNew(id, rect, rect, gfx::Transform()); |
| 278 | 283 |
| 279 CreateAndAppendTestSharedQuadState( | 284 CreateAndAppendTestSharedQuadState( |
| 280 pass.get(), gfx::Transform(), child_size); | 285 pass.get(), gfx::Transform(), child_size); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 292 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); | 297 pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>(); |
| 293 bottom_color_quad->SetNew(pass->shared_quad_state_list.back(), | 298 bottom_color_quad->SetNew(pass->shared_quad_state_list.back(), |
| 294 gfx::Rect(0, 100, 100, 100), | 299 gfx::Rect(0, 100, 100, 100), |
| 295 gfx::Rect(0, 100, 100, 100), | 300 gfx::Rect(0, 100, 100, 100), |
| 296 SK_ColorGREEN, | 301 SK_ColorGREEN, |
| 297 force_anti_aliasing_off); | 302 force_anti_aliasing_off); |
| 298 | 303 |
| 299 CompositorFrame child_frame; | 304 CompositorFrame child_frame; |
| 300 child_frame.render_pass_list.push_back(std::move(pass)); | 305 child_frame.render_pass_list.push_back(std::move(pass)); |
| 301 | 306 |
| 302 right_factory.SubmitCompositorFrame(right_child_local_id, | 307 right_support.SubmitCompositorFrame(right_child_local_id, |
| 303 std::move(child_frame), | 308 std::move(child_frame)); |
| 304 SurfaceFactory::DrawCallback()); | |
| 305 } | 309 } |
| 306 | 310 |
| 307 SurfaceAggregator aggregator(&manager_, resource_provider_.get(), true); | 311 SurfaceAggregator aggregator(&manager_, resource_provider_.get(), true); |
| 308 CompositorFrame aggregated_frame = aggregator.Aggregate(root_surface_id); | 312 CompositorFrame aggregated_frame = aggregator.Aggregate(root_surface_id); |
| 309 | 313 |
| 310 bool discard_alpha = false; | 314 bool discard_alpha = false; |
| 311 ExactPixelComparator pixel_comparator(discard_alpha); | 315 ExactPixelComparator pixel_comparator(discard_alpha); |
| 312 RenderPassList* pass_list = &aggregated_frame.render_pass_list; | 316 RenderPassList* pass_list = &aggregated_frame.render_pass_list; |
| 313 EXPECT_TRUE(RunPixelTest( | 317 EXPECT_TRUE(RunPixelTest( |
| 314 pass_list, | 318 pass_list, |
| 315 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), | 319 base::FilePath(FILE_PATH_LITERAL("four_blue_green_checkers.png")), |
| 316 pixel_comparator)); | 320 pixel_comparator)); |
| 317 | 321 |
| 318 left_factory.EvictSurface(); | 322 left_support.EvictFrame(); |
| 319 right_factory.EvictSurface(); | 323 right_support.EvictFrame(); |
| 320 } | 324 } |
| 321 | 325 |
| 322 } // namespace | 326 } // namespace |
| 323 } // namespace cc | 327 } // namespace cc |
| 324 | 328 |
| 325 #endif // !defined(OS_ANDROID) | 329 #endif // !defined(OS_ANDROID) |
| OLD | NEW |