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(LayerTreeImpl* tree_impl, |
14 LayerTreeImpl* tree_impl, | 14 int id, |
15 int id, | 15 scoped_refptr<PicturePileImpl> pile) |
16 scoped_refptr<PicturePileImpl> pile) | |
17 : PictureLayerImpl(tree_impl, id), | 16 : PictureLayerImpl(tree_impl, id), |
18 append_quads_count_(0) { | 17 append_quads_count_(0), |
| 18 did_become_active_call_count_(0) { |
19 pile_ = pile; | 19 pile_ = pile; |
20 SetBounds(pile_->tiling_size()); | 20 SetBounds(pile_->tiling_size()); |
21 SetContentBounds(pile_->tiling_size()); | 21 SetContentBounds(pile_->tiling_size()); |
22 } | 22 } |
23 | 23 |
24 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, | 24 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, |
25 int id, | 25 int id, |
26 scoped_refptr<PicturePileImpl> pile, | 26 scoped_refptr<PicturePileImpl> pile, |
27 const gfx::Size& layer_bounds) | 27 const gfx::Size& layer_bounds) |
28 : PictureLayerImpl(tree_impl, id), append_quads_count_(0) { | 28 : PictureLayerImpl(tree_impl, id), |
| 29 append_quads_count_(0), |
| 30 did_become_active_call_count_(0) { |
29 pile_ = pile; | 31 pile_ = pile; |
30 SetBounds(layer_bounds); | 32 SetBounds(layer_bounds); |
31 SetContentBounds(layer_bounds); | 33 SetContentBounds(layer_bounds); |
32 } | 34 } |
33 | 35 |
34 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id) | 36 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id) |
35 : PictureLayerImpl(tree_impl, id), append_quads_count_(0) {} | 37 : PictureLayerImpl(tree_impl, id), |
| 38 append_quads_count_(0), |
| 39 did_become_active_call_count_(0) { |
| 40 } |
36 | 41 |
37 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( | 42 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( |
38 LayerTreeImpl* tree_impl) { | 43 LayerTreeImpl* tree_impl) { |
39 return make_scoped_ptr( | 44 return make_scoped_ptr( |
40 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>(); | 45 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>(); |
41 } | 46 } |
42 | 47 |
43 void FakePictureLayerImpl::AppendQuads( | 48 void FakePictureLayerImpl::AppendQuads( |
44 RenderPass* render_pass, | 49 RenderPass* render_pass, |
45 const OcclusionTracker<LayerImpl>& occlusion_tracker, | 50 const OcclusionTracker<LayerImpl>& occlusion_tracker, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 HighResTiling()->CreateAllTilesForTesting(); | 151 HighResTiling()->CreateAllTilesForTesting(); |
147 if (layer_tree_impl()->settings().create_low_res_tiling) { | 152 if (layer_tree_impl()->settings().create_low_res_tiling) { |
148 DCHECK_EQ(tilings()->tiling_at(1)->resolution(), LOW_RESOLUTION); | 153 DCHECK_EQ(tilings()->tiling_at(1)->resolution(), LOW_RESOLUTION); |
149 LowResTiling()->CreateAllTilesForTesting(); | 154 LowResTiling()->CreateAllTilesForTesting(); |
150 } | 155 } |
151 } else { | 156 } else { |
152 DCHECK_EQ(tilings()->num_tilings(), 0u); | 157 DCHECK_EQ(tilings()->num_tilings(), 0u); |
153 } | 158 } |
154 } | 159 } |
155 | 160 |
| 161 void FakePictureLayerImpl::DidBecomeActive() { |
| 162 PictureLayerImpl::DidBecomeActive(); |
| 163 ++did_become_active_call_count_; |
| 164 } |
| 165 |
156 } // namespace cc | 166 } // namespace cc |
OLD | NEW |