OLD | NEW |
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 Loading... |
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 occluded, | 201 occluded, |
202 &partially_occluded_count); | 202 &partially_occluded_count); |
203 // The layer outputs one quad, which is partially occluded. | 203 // The layer outputs one quad, which is partially occluded. |
204 EXPECT_EQ(1u, impl.quad_list().size()); | 204 EXPECT_EQ(1u, impl.quad_list().size()); |
205 EXPECT_EQ(1u, partially_occluded_count); | 205 EXPECT_EQ(1u, partially_occluded_count); |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 } // namespace | 209 } // namespace |
210 } // namespace cc | 210 } // namespace cc |
OLD | NEW |