OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "base/containers/hash_tables.h" | 5 #include "base/containers/hash_tables.h" |
6 #include "cc/layers/append_quads_data.h" | 6 #include "cc/layers/append_quads_data.h" |
7 #include "cc/layers/nine_patch_layer_impl.h" | 7 #include "cc/layers/nine_patch_layer_impl.h" |
8 #include "cc/quads/texture_draw_quad.h" | 8 #include "cc/quads/texture_draw_quad.h" |
9 #include "cc/resources/ui_resource_bitmap.h" | 9 #include "cc/resources/ui_resource_bitmap.h" |
10 #include "cc/resources/ui_resource_client.h" | 10 #include "cc/resources/ui_resource_client.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 gfx::ToRoundedInt(rect_f.width()), | 29 gfx::ToRoundedInt(rect_f.width()), |
30 gfx::ToRoundedInt(rect_f.height())); | 30 gfx::ToRoundedInt(rect_f.height())); |
31 } | 31 } |
32 | 32 |
33 void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size, | 33 void NinePatchLayerLayoutTest(const gfx::Size& bitmap_size, |
34 const gfx::Rect& aperture_rect, | 34 const gfx::Rect& aperture_rect, |
35 const gfx::Size& layer_size, | 35 const gfx::Size& layer_size, |
36 const gfx::Rect& border, | 36 const gfx::Rect& border, |
37 bool fill_center, | 37 bool fill_center, |
38 size_t expected_quad_size) { | 38 size_t expected_quad_size) { |
39 MockQuadCuller quad_culler; | 39 MockOcclusionTracker<LayerImpl> occlusion_tracker; |
| 40 scoped_ptr<RenderPass> render_pass = RenderPass::Create(); |
| 41 MockQuadCuller quad_culler(render_pass.get(), &occlusion_tracker); |
40 gfx::Rect visible_content_rect(layer_size); | 42 gfx::Rect visible_content_rect(layer_size); |
41 gfx::Rect expected_remaining(border.x(), | 43 gfx::Rect expected_remaining(border.x(), |
42 border.y(), | 44 border.y(), |
43 layer_size.width() - border.width(), | 45 layer_size.width() - border.width(), |
44 layer_size.height() - border.height()); | 46 layer_size.height() - border.height()); |
45 | 47 |
46 FakeImplProxy proxy; | 48 FakeImplProxy proxy; |
47 TestSharedBitmapManager shared_bitmap_manager; | 49 TestSharedBitmapManager shared_bitmap_manager; |
48 FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager); | 50 FakeUIResourceLayerTreeHostImpl host_impl(&proxy, &shared_bitmap_manager); |
49 scoped_ptr<NinePatchLayerImpl> layer = | 51 scoped_ptr<NinePatchLayerImpl> layer = |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 &partially_occluded_count); | 274 &partially_occluded_count); |
273 // The layer outputs nine quads, three of which are partially occluded, and | 275 // The layer outputs nine quads, three of which are partially occluded, and |
274 // three fully occluded. | 276 // three fully occluded. |
275 EXPECT_EQ(6u, impl.quad_list().size()); | 277 EXPECT_EQ(6u, impl.quad_list().size()); |
276 EXPECT_EQ(3u, partially_occluded_count); | 278 EXPECT_EQ(3u, partially_occluded_count); |
277 } | 279 } |
278 } | 280 } |
279 | 281 |
280 } // namespace | 282 } // namespace |
281 } // namespace cc | 283 } // namespace cc |
OLD | NEW |