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: Added a comment 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
« no previous file with comments | « cc/layers/surface_layer_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 surface_layer_impl->SetDrawsContent(true); 320 surface_layer_impl->SetDrawsContent(true);
321 surface_layer_impl->SetPrimarySurfaceInfo(primary_surface_info); 321 surface_layer_impl->SetPrimarySurfaceInfo(primary_surface_info);
322 surface_layer_impl->SetFallbackSurfaceInfo(primary_surface_info); 322 surface_layer_impl->SetFallbackSurfaceInfo(primary_surface_info);
323 323
324 gfx::Size viewport_size(1000, 1000); 324 gfx::Size viewport_size(1000, 1000);
325 impl.CalcDrawProps(viewport_size); 325 impl.CalcDrawProps(viewport_size);
326 326
327 std::unique_ptr<RenderPass> render_pass = RenderPass::Create(); 327 std::unique_ptr<RenderPass> render_pass = RenderPass::Create();
328 AppendQuadsData data; 328 AppendQuadsData data;
329 surface_layer_impl->AppendQuads(render_pass.get(), &data); 329 surface_layer_impl->AppendQuads(render_pass.get(), &data);
330 EXPECT_THAT(data.embedded_surfaces, UnorderedElementsAre(surface_id1)); 330 // As the primary and fallback SurfaceInfos match, there is no reason to
331 // add the primary surface ID to |embedded_surfaces| because it is not an
332 // unresolved dependency. The fallback surface will already be added as a
333 // reference in referenced_surfaces.
334 EXPECT_THAT(data.embedded_surfaces, testing::IsEmpty());
331 335
332 ASSERT_EQ(1u, render_pass->quad_list.size()); 336 ASSERT_EQ(1u, render_pass->quad_list.size());
333 const SurfaceDrawQuad* surface_draw_quad1 = 337 const SurfaceDrawQuad* surface_draw_quad1 =
334 SurfaceDrawQuad::MaterialCast(render_pass->quad_list.ElementAt(0)); 338 SurfaceDrawQuad::MaterialCast(render_pass->quad_list.ElementAt(0));
335 ASSERT_TRUE(surface_draw_quad1); 339 ASSERT_TRUE(surface_draw_quad1);
336 340
337 EXPECT_EQ(SurfaceDrawQuadType::PRIMARY, 341 EXPECT_EQ(SurfaceDrawQuadType::PRIMARY,
338 surface_draw_quad1->surface_draw_quad_type); 342 surface_draw_quad1->surface_draw_quad_type);
339 EXPECT_EQ(surface_id1, surface_draw_quad1->surface_id); 343 EXPECT_EQ(surface_id1, surface_draw_quad1->surface_id);
340 EXPECT_FALSE(surface_draw_quad1->fallback_quad); 344 EXPECT_FALSE(surface_draw_quad1->fallback_quad);
341 } 345 }
342 346
343 } // namespace 347 } // namespace
344 } // namespace cc 348 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/surface_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698