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

Side by Side Diff: cc/layers/surface_layer_impl_unittest.cc

Issue 2861593002: cc: Only add surface ID to embedded_surfaces if fallback does not match (Closed)
Patch Set: Updated Created 3 years, 7 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 unified diff | Download patch
OLDNEW
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/layers/surface_layer_impl.h" 5 #include "cc/layers/surface_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "cc/layers/append_quads_data.h" 9 #include "cc/layers/append_quads_data.h"
10 #include "cc/test/layer_test_common.h" 10 #include "cc/test/layer_test_common.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 surface_layer_impl->SetDrawsContent(true); 285 surface_layer_impl->SetDrawsContent(true);
286 surface_layer_impl->SetPrimarySurfaceInfo(primary_surface_info); 286 surface_layer_impl->SetPrimarySurfaceInfo(primary_surface_info);
287 surface_layer_impl->SetFallbackSurfaceInfo(primary_surface_info); 287 surface_layer_impl->SetFallbackSurfaceInfo(primary_surface_info);
288 288
289 gfx::Size viewport_size(1000, 1000); 289 gfx::Size viewport_size(1000, 1000);
290 impl.CalcDrawProps(viewport_size); 290 impl.CalcDrawProps(viewport_size);
291 291
292 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); 292 std::unique_ptr<RenderPass> render_pass = RenderPass::Create();
293 AppendQuadsData data; 293 AppendQuadsData data;
294 surface_layer_impl->AppendQuads(render_pass.get(), &data); 294 surface_layer_impl->AppendQuads(render_pass.get(), &data);
295 EXPECT_THAT(data.embedded_surfaces, UnorderedElementsAre(surface_id1)); 295 // SurfaceLayerImpl should not add a surface ID to the embedded_surfaces
296 // vector if it is also a fallback surface. The fallback surface will already
297 // be added as a reference in referenced_surfaces. Since the fallback is known
298 // to exist, then it isn't a dependency.
299 EXPECT_THAT(data.embedded_surfaces, testing::IsEmpty());
296 300
297 ASSERT_EQ(1u, render_pass->quad_list.size()); 301 ASSERT_EQ(1u, render_pass->quad_list.size());
298 const SurfaceDrawQuad* surface_draw_quad1 = 302 const SurfaceDrawQuad* surface_draw_quad1 =
299 SurfaceDrawQuad::MaterialCast(render_pass->quad_list.ElementAt(0)); 303 SurfaceDrawQuad::MaterialCast(render_pass->quad_list.ElementAt(0));
300 ASSERT_TRUE(surface_draw_quad1); 304 ASSERT_TRUE(surface_draw_quad1);
301 305
302 EXPECT_EQ(SurfaceDrawQuadType::PRIMARY, 306 EXPECT_EQ(SurfaceDrawQuadType::PRIMARY,
303 surface_draw_quad1->surface_draw_quad_type); 307 surface_draw_quad1->surface_draw_quad_type);
304 EXPECT_EQ(surface_id1, surface_draw_quad1->surface_id); 308 EXPECT_EQ(surface_id1, surface_draw_quad1->surface_id);
305 EXPECT_FALSE(surface_draw_quad1->fallback_quad); 309 EXPECT_FALSE(surface_draw_quad1->fallback_quad);
306 } 310 }
307 311
308 } // namespace 312 } // namespace
309 } // namespace cc 313 } // namespace cc
OLDNEW
« cc/layers/surface_layer_impl.cc ('K') | « cc/layers/surface_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698