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

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

Issue 448303002: Use custom ListContainer to allocate DrawQuads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@perftest
Patch Set: change header files to try fix compile error Created 6 years, 2 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/tiled_layer_impl_unittest.cc ('k') | cc/layers/video_layer_impl_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/append_quads_data.h" 5 #include "cc/layers/append_quads_data.h"
6 #include "cc/layers/ui_resource_layer_impl.h" 6 #include "cc/layers/ui_resource_layer_impl.h"
7 #include "cc/quads/draw_quad.h" 7 #include "cc/quads/draw_quad.h"
8 #include "cc/resources/ui_resource_bitmap.h" 8 #include "cc/resources/ui_resource_bitmap.h"
9 #include "cc/resources/ui_resource_client.h" 9 #include "cc/resources/ui_resource_client.h"
10 #include "cc/test/fake_impl_proxy.h" 10 #include "cc/test/fake_impl_proxy.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 const gfx::Rect& expected_opaque_bounds) { 88 const gfx::Rect& expected_opaque_bounds) {
89 MockOcclusionTracker<LayerImpl> occlusion_tracker; 89 MockOcclusionTracker<LayerImpl> occlusion_tracker;
90 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); 90 scoped_ptr<RenderPass> render_pass = RenderPass::Create();
91 91
92 AppendQuadsData data; 92 AppendQuadsData data;
93 layer->AppendQuads(render_pass.get(), occlusion_tracker, &data); 93 layer->AppendQuads(render_pass.get(), occlusion_tracker, &data);
94 94
95 // Verify quad rects 95 // Verify quad rects
96 const QuadList& quads = render_pass->quad_list; 96 const QuadList& quads = render_pass->quad_list;
97 EXPECT_GE(quads.size(), (size_t)0); 97 EXPECT_GE(quads.size(), (size_t)0);
98 gfx::Rect opaque_rect = quads.at(0)->opaque_rect; 98 gfx::Rect opaque_rect = quads.front()->opaque_rect;
99 EXPECT_EQ(expected_opaque_bounds, opaque_rect); 99 EXPECT_EQ(expected_opaque_bounds, opaque_rect);
100 } 100 }
101 101
102 TEST(UIResourceLayerImplTest, VerifySetOpaqueOnSkBitmap) { 102 TEST(UIResourceLayerImplTest, VerifySetOpaqueOnSkBitmap) {
103 FakeImplProxy proxy; 103 FakeImplProxy proxy;
104 TestSharedBitmapManager shared_bitmap_manager; 104 TestSharedBitmapManager shared_bitmap_manager;
105 FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager); 105 FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager);
106 106
107 gfx::Size bitmap_size(100, 100); 107 gfx::Size bitmap_size(100, 100);
108 gfx::Size layer_size(100, 100);; 108 gfx::Size layer_size(100, 100);;
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 LayerTestCommon::VerifyQuadsAreOccluded( 198 LayerTestCommon::VerifyQuadsAreOccluded(
199 impl.quad_list(), occluded, &partially_occluded_count); 199 impl.quad_list(), occluded, &partially_occluded_count);
200 // The layer outputs one quad, which is partially occluded. 200 // The layer outputs one quad, which is partially occluded.
201 EXPECT_EQ(1u, impl.quad_list().size()); 201 EXPECT_EQ(1u, impl.quad_list().size());
202 EXPECT_EQ(1u, partially_occluded_count); 202 EXPECT_EQ(1u, partially_occluded_count);
203 } 203 }
204 } 204 }
205 205
206 } // namespace 206 } // namespace
207 } // namespace cc 207 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/tiled_layer_impl_unittest.cc ('k') | cc/layers/video_layer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698