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

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

Issue 2834123002: cc: Replace render surface layer list with a render surface list (Closed)
Patch Set: Address review comments 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/render_surface_unittest.cc ('k') | cc/output/bsp_tree_perftest.cc » ('j') | 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 22 matching lines...) Expand all
33 LayerTestCommon::LayerImplTest impl; 33 LayerTestCommon::LayerImplTest impl;
34 34
35 SurfaceLayerImpl* surface_layer_impl = 35 SurfaceLayerImpl* surface_layer_impl =
36 impl.AddChildToRoot<SurfaceLayerImpl>(); 36 impl.AddChildToRoot<SurfaceLayerImpl>();
37 surface_layer_impl->SetBounds(layer_size); 37 surface_layer_impl->SetBounds(layer_size);
38 surface_layer_impl->SetDrawsContent(true); 38 surface_layer_impl->SetDrawsContent(true);
39 SurfaceId surface_id(kArbitraryFrameSinkId, kArbitraryLocalSurfaceId); 39 SurfaceId surface_id(kArbitraryFrameSinkId, kArbitraryLocalSurfaceId);
40 surface_layer_impl->SetPrimarySurfaceInfo( 40 surface_layer_impl->SetPrimarySurfaceInfo(
41 SurfaceInfo(surface_id, device_scale_factor, scaled_surface_size)); 41 SurfaceInfo(surface_id, device_scale_factor, scaled_surface_size));
42 42
43 LayerImplList layer_list; 43 RenderSurfaceList render_surface_list;
44 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs( 44 LayerTreeHostCommon::CalcDrawPropsImplInputsForTesting inputs(
45 impl.root_layer_for_testing(), viewport_size, device_scale_factor, 45 impl.root_layer_for_testing(), viewport_size, device_scale_factor,
46 &layer_list); 46 &render_surface_list);
47 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs); 47 LayerTreeHostCommon::CalculateDrawPropertiesForTesting(&inputs);
48 48
49 { 49 {
50 SCOPED_TRACE("No occlusion"); 50 SCOPED_TRACE("No occlusion");
51 gfx::Rect occluded; 51 gfx::Rect occluded;
52 impl.AppendQuadsWithOcclusion(surface_layer_impl, occluded); 52 impl.AppendQuadsWithOcclusion(surface_layer_impl, occluded);
53 53
54 LayerTestCommon::VerifyQuadsExactlyCoverRect( 54 LayerTestCommon::VerifyQuadsExactlyCoverRect(
55 impl.quad_list(), gfx::Rect(scaled_surface_size)); 55 impl.quad_list(), gfx::Rect(scaled_surface_size));
56 EXPECT_EQ(1u, impl.quad_list().size()); 56 EXPECT_EQ(1u, impl.quad_list().size());
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 ASSERT_TRUE(surface_draw_quad1); 300 ASSERT_TRUE(surface_draw_quad1);
301 301
302 EXPECT_EQ(SurfaceDrawQuadType::PRIMARY, 302 EXPECT_EQ(SurfaceDrawQuadType::PRIMARY,
303 surface_draw_quad1->surface_draw_quad_type); 303 surface_draw_quad1->surface_draw_quad_type);
304 EXPECT_EQ(surface_id1, surface_draw_quad1->surface_id); 304 EXPECT_EQ(surface_id1, surface_draw_quad1->surface_id);
305 EXPECT_FALSE(surface_draw_quad1->fallback_quad); 305 EXPECT_FALSE(surface_draw_quad1->fallback_quad);
306 } 306 }
307 307
308 } // namespace 308 } // namespace
309 } // namespace cc 309 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/render_surface_unittest.cc ('k') | cc/output/bsp_tree_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698