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(LayerTreeImpl* tree_impl, | 13 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, |
14 int id, | 14 int id, |
15 scoped_refptr<PicturePileImpl> pile) | 15 scoped_refptr<PicturePileImpl> pile) |
16 : PictureLayerImpl(tree_impl, id), | 16 : PictureLayerImpl(tree_impl, id), |
17 append_quads_count_(0), | 17 append_quads_count_(0), |
18 did_become_active_call_count_(0), | 18 did_become_active_call_count_(0), |
19 has_valid_tile_priorities_(false), | 19 has_valid_tile_priorities_(false), |
20 use_set_valid_tile_priorities_flag_(false), | 20 use_set_valid_tile_priorities_flag_(false) { |
21 release_resources_count_(0) { | |
22 pile_ = pile; | 21 pile_ = pile; |
23 SetBounds(pile_->tiling_size()); | 22 SetBounds(pile_->tiling_size()); |
24 SetContentBounds(pile_->tiling_size()); | 23 SetContentBounds(pile_->tiling_size()); |
25 } | 24 } |
26 | 25 |
27 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, | 26 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, |
28 int id, | 27 int id, |
29 scoped_refptr<PicturePileImpl> pile, | 28 scoped_refptr<PicturePileImpl> pile, |
30 const gfx::Size& layer_bounds) | 29 const gfx::Size& layer_bounds) |
31 : PictureLayerImpl(tree_impl, id), | 30 : PictureLayerImpl(tree_impl, id), |
32 append_quads_count_(0), | 31 append_quads_count_(0), |
33 did_become_active_call_count_(0), | 32 did_become_active_call_count_(0), |
34 has_valid_tile_priorities_(false), | 33 has_valid_tile_priorities_(false), |
35 use_set_valid_tile_priorities_flag_(false), | 34 use_set_valid_tile_priorities_flag_(false) { |
36 release_resources_count_(0) { | |
37 pile_ = pile; | 35 pile_ = pile; |
38 SetBounds(layer_bounds); | 36 SetBounds(layer_bounds); |
39 SetContentBounds(layer_bounds); | 37 SetContentBounds(layer_bounds); |
40 } | 38 } |
41 | 39 |
42 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id) | 40 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id) |
43 : PictureLayerImpl(tree_impl, id), | 41 : PictureLayerImpl(tree_impl, id), |
44 append_quads_count_(0), | 42 append_quads_count_(0), |
45 did_become_active_call_count_(0), | 43 did_become_active_call_count_(0), |
46 has_valid_tile_priorities_(false), | 44 has_valid_tile_priorities_(false), |
47 use_set_valid_tile_priorities_flag_(false), | 45 use_set_valid_tile_priorities_flag_(false) { |
48 release_resources_count_(0) { | |
49 } | 46 } |
50 | 47 |
51 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( | 48 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( |
52 LayerTreeImpl* tree_impl) { | 49 LayerTreeImpl* tree_impl) { |
53 return make_scoped_ptr( | 50 return make_scoped_ptr( |
54 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>(); | 51 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>(); |
55 } | 52 } |
56 | 53 |
57 void FakePictureLayerImpl::AppendQuads( | 54 void FakePictureLayerImpl::AppendQuads( |
58 RenderPass* render_pass, | 55 RenderPass* render_pass, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 PictureLayerImpl::DidBecomeActive(); | 172 PictureLayerImpl::DidBecomeActive(); |
176 ++did_become_active_call_count_; | 173 ++did_become_active_call_count_; |
177 } | 174 } |
178 | 175 |
179 bool FakePictureLayerImpl::HasValidTilePriorities() const { | 176 bool FakePictureLayerImpl::HasValidTilePriorities() const { |
180 return use_set_valid_tile_priorities_flag_ | 177 return use_set_valid_tile_priorities_flag_ |
181 ? has_valid_tile_priorities_ | 178 ? has_valid_tile_priorities_ |
182 : PictureLayerImpl::HasValidTilePriorities(); | 179 : PictureLayerImpl::HasValidTilePriorities(); |
183 } | 180 } |
184 | 181 |
185 void FakePictureLayerImpl::ReleaseResources() { | |
186 PictureLayerImpl::ReleaseResources(); | |
187 ++release_resources_count_; | |
188 } | |
189 | |
190 } // namespace cc | 182 } // namespace cc |
OLD | NEW |