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 "cc/layers/tiled_layer_impl.h" | 5 #include "cc/layers/tiled_layer_impl.h" |
6 | 6 |
7 #include "cc/layers/append_quads_data.h" | 7 #include "cc/layers/append_quads_data.h" |
8 #include "cc/quads/tile_draw_quad.h" | 8 #include "cc/quads/tile_draw_quad.h" |
9 #include "cc/resources/layer_tiling_data.h" | 9 #include "cc/resources/layer_tiling_data.h" |
10 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 return layer.Pass(); | 67 return layer.Pass(); |
68 } | 68 } |
69 | 69 |
70 void GetQuads(QuadList* quads, | 70 void GetQuads(QuadList* quads, |
71 SharedQuadStateList* shared_states, | 71 SharedQuadStateList* shared_states, |
72 gfx::Size tile_size, | 72 gfx::Size tile_size, |
73 gfx::Size layer_size, | 73 gfx::Size layer_size, |
74 LayerTilingData::BorderTexelOption border_texel_option, | 74 LayerTilingData::BorderTexelOption border_texel_option, |
75 gfx::Rect visible_content_rect) { | 75 const gfx::Rect& visible_content_rect) { |
76 scoped_ptr<TiledLayerImpl> layer = | 76 scoped_ptr<TiledLayerImpl> layer = |
77 CreateLayer(tile_size, layer_size, border_texel_option); | 77 CreateLayer(tile_size, layer_size, border_texel_option); |
78 layer->draw_properties().visible_content_rect = visible_content_rect; | 78 layer->draw_properties().visible_content_rect = visible_content_rect; |
79 layer->SetBounds(layer_size); | 79 layer->SetBounds(layer_size); |
80 | 80 |
81 MockQuadCuller quad_culler(quads, shared_states); | 81 MockQuadCuller quad_culler(quads, shared_states); |
82 AppendQuadsData data; | 82 AppendQuadsData data; |
83 layer->AppendQuads(&quad_culler, &data); | 83 layer->AppendQuads(&quad_culler, &data); |
84 } | 84 } |
85 | 85 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 ResourceProvider::ResourceId empty_resource(0); | 299 ResourceProvider::ResourceId empty_resource(0); |
300 layer->PushTileProperties(0, 1, empty_resource, gfx::Rect(0, 0, 1, 1), false); | 300 layer->PushTileProperties(0, 1, empty_resource, gfx::Rect(0, 0, 1, 1), false); |
301 layer->PushTileProperties(2, 3, empty_resource, gfx::Rect(0, 0, 1, 1), false); | 301 layer->PushTileProperties(2, 3, empty_resource, gfx::Rect(0, 0, 1, 1), false); |
302 layer->PushTileProperties(2, 0, empty_resource, gfx::Rect(0, 0, 1, 1), false); | 302 layer->PushTileProperties(2, 0, empty_resource, gfx::Rect(0, 0, 1, 1), false); |
303 | 303 |
304 EXPECT_EQ(layer->GPUMemoryUsageInBytes(), 0u); | 304 EXPECT_EQ(layer->GPUMemoryUsageInBytes(), 0u); |
305 } | 305 } |
306 | 306 |
307 } // namespace | 307 } // namespace |
308 } // namespace cc | 308 } // namespace cc |
OLD | NEW |