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