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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "cc/layers/append_quads_data.h" | 7 #include "cc/layers/append_quads_data.h" |
8 #include "cc/layers/ui_resource_layer_impl.h" | 8 #include "cc/layers/ui_resource_layer_impl.h" |
9 #include "cc/quads/draw_quad.h" | 9 #include "cc/quads/draw_quad.h" |
10 #include "cc/resources/ui_resource_bitmap.h" | 10 #include "cc/resources/ui_resource_bitmap.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 FakeUIResourceLayerTreeHostImpl* host_impl, | 28 FakeUIResourceLayerTreeHostImpl* host_impl, |
29 const gfx::Size& bitmap_size, | 29 const gfx::Size& bitmap_size, |
30 const gfx::Size& layer_size, | 30 const gfx::Size& layer_size, |
31 bool opaque, | 31 bool opaque, |
32 UIResourceId uid) { | 32 UIResourceId uid) { |
33 gfx::Rect visible_layer_rect(layer_size); | 33 gfx::Rect visible_layer_rect(layer_size); |
34 std::unique_ptr<UIResourceLayerImpl> layer = | 34 std::unique_ptr<UIResourceLayerImpl> layer = |
35 UIResourceLayerImpl::Create(host_impl->active_tree(), 1); | 35 UIResourceLayerImpl::Create(host_impl->active_tree(), 1); |
36 layer->draw_properties().visible_layer_rect = visible_layer_rect; | 36 layer->draw_properties().visible_layer_rect = visible_layer_rect; |
37 layer->SetBounds(layer_size); | 37 layer->SetBounds(layer_size); |
38 layer->SetForceRenderSurface(true); | 38 layer->test_properties()->force_render_surface = true; |
39 | 39 |
40 UIResourceBitmap bitmap(bitmap_size, opaque); | 40 UIResourceBitmap bitmap(bitmap_size, opaque); |
41 | 41 |
42 host_impl->CreateUIResource(uid, bitmap); | 42 host_impl->CreateUIResource(uid, bitmap); |
43 layer->SetUIResourceId(uid); | 43 layer->SetUIResourceId(uid); |
44 | 44 |
45 return layer; | 45 return layer; |
46 } | 46 } |
47 | 47 |
48 void QuadSizeTest(std::unique_ptr<UIResourceLayerImpl> layer, | 48 void QuadSizeTest(std::unique_ptr<UIResourceLayerImpl> layer, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 LayerTestCommon::VerifyQuadsAreOccluded( | 207 LayerTestCommon::VerifyQuadsAreOccluded( |
208 impl.quad_list(), occluded, &partially_occluded_count); | 208 impl.quad_list(), occluded, &partially_occluded_count); |
209 // The layer outputs one quad, which is partially occluded. | 209 // The layer outputs one quad, which is partially occluded. |
210 EXPECT_EQ(1u, impl.quad_list().size()); | 210 EXPECT_EQ(1u, impl.quad_list().size()); |
211 EXPECT_EQ(1u, partially_occluded_count); | 211 EXPECT_EQ(1u, partially_occluded_count); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 } // namespace | 215 } // namespace |
216 } // namespace cc | 216 } // namespace cc |
OLD | NEW |