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/test/fake_picture_layer_impl.h" | 5 #include "cc/test/fake_picture_layer_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 #include "cc/resources/tile.h" | 8 #include "cc/resources/tile.h" |
9 #include "cc/trees/layer_tree_impl.h" | 9 #include "cc/trees/layer_tree_impl.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 FakePictureLayerImpl::FakePictureLayerImpl( | 13 FakePictureLayerImpl::FakePictureLayerImpl( |
14 LayerTreeImpl* tree_impl, | 14 LayerTreeImpl* tree_impl, |
15 int id, | 15 int id, |
16 scoped_refptr<PicturePileImpl> pile) | 16 scoped_refptr<PicturePileImpl> pile) |
17 : PictureLayerImpl(tree_impl, id), | 17 : PictureLayerImpl(tree_impl, id), |
18 append_quads_count_(0) { | 18 append_quads_count_(0) { |
19 pile_ = pile; | 19 pile_ = pile; |
20 CHECK(pile->tiling_rect().origin() == gfx::Point()); | 20 CHECK(pile->tiling_rect().origin() == gfx::Point()); |
21 SetBounds(pile_->tiling_rect().size()); | 21 SetBounds(pile_->tiling_rect().size()); |
22 SetContentBounds(pile_->tiling_rect().size()); | |
23 } | 22 } |
24 | 23 |
25 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, | 24 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, |
26 int id, | 25 int id, |
27 scoped_refptr<PicturePileImpl> pile, | 26 scoped_refptr<PicturePileImpl> pile, |
28 const gfx::Size& layer_bounds) | 27 const gfx::Size& layer_bounds) |
29 : PictureLayerImpl(tree_impl, id), append_quads_count_(0) { | 28 : PictureLayerImpl(tree_impl, id), append_quads_count_(0) { |
30 pile_ = pile; | 29 pile_ = pile; |
31 SetBounds(layer_bounds); | 30 SetBounds(layer_bounds); |
32 SetContentBounds(layer_bounds); | |
33 } | 31 } |
34 | 32 |
35 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id) | 33 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id) |
36 : PictureLayerImpl(tree_impl, id), append_quads_count_(0) {} | 34 : PictureLayerImpl(tree_impl, id), append_quads_count_(0) {} |
37 | 35 |
38 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( | 36 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( |
39 LayerTreeImpl* tree_impl) { | 37 LayerTreeImpl* tree_impl) { |
40 return make_scoped_ptr( | 38 return make_scoped_ptr( |
41 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>(); | 39 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>(); |
42 } | 40 } |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 if (layer_tree_impl()->settings().create_low_res_tiling) { | 143 if (layer_tree_impl()->settings().create_low_res_tiling) { |
146 DCHECK_EQ(tilings()->tiling_at(1)->resolution(), LOW_RESOLUTION); | 144 DCHECK_EQ(tilings()->tiling_at(1)->resolution(), LOW_RESOLUTION); |
147 LowResTiling()->CreateAllTilesForTesting(); | 145 LowResTiling()->CreateAllTilesForTesting(); |
148 } | 146 } |
149 } else { | 147 } else { |
150 DCHECK_EQ(tilings()->num_tilings(), 0u); | 148 DCHECK_EQ(tilings()->num_tilings(), 0u); |
151 } | 149 } |
152 } | 150 } |
153 | 151 |
154 } // namespace cc | 152 } // namespace cc |
OLD | NEW |