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 namespace cc { | 7 namespace cc { |
8 | 8 |
9 FakePictureLayerImpl::FakePictureLayerImpl( | 9 FakePictureLayerImpl::FakePictureLayerImpl( |
10 LayerTreeImpl* tree_impl, | 10 LayerTreeImpl* tree_impl, |
11 int id, | 11 int id, |
12 scoped_refptr<PicturePileImpl> pile) | 12 scoped_refptr<PicturePileImpl> pile) |
13 : PictureLayerImpl(tree_impl, id), | 13 : PictureLayerImpl(tree_impl, id), |
14 append_quads_count_(0) { | 14 append_quads_count_(0), |
| 15 update_tile_priorities_count_(0) { |
15 pile_ = pile; | 16 pile_ = pile; |
16 SetBounds(pile_->size()); | 17 SetBounds(pile_->size()); |
17 } | 18 } |
18 | 19 |
19 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id) | 20 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, int id) |
20 : PictureLayerImpl(tree_impl, id), append_quads_count_(0) {} | 21 : PictureLayerImpl(tree_impl, id), |
| 22 append_quads_count_(0), |
| 23 update_tile_priorities_count_(0) { |
| 24 } |
21 | 25 |
22 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( | 26 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( |
23 LayerTreeImpl* tree_impl) { | 27 LayerTreeImpl* tree_impl) { |
24 return make_scoped_ptr( | 28 return make_scoped_ptr( |
25 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>(); | 29 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>(); |
26 } | 30 } |
27 | 31 |
28 void FakePictureLayerImpl::AppendQuads(QuadSink* quad_sink, | 32 void FakePictureLayerImpl::AppendQuads(QuadSink* quad_sink, |
29 AppendQuadsData* append_quads_data) { | 33 AppendQuadsData* append_quads_data) { |
30 PictureLayerImpl::AppendQuads(quad_sink, append_quads_data); | 34 PictureLayerImpl::AppendQuads(quad_sink, append_quads_data); |
31 ++append_quads_count_; | 35 ++append_quads_count_; |
32 } | 36 } |
33 | 37 |
| 38 void FakePictureLayerImpl::UpdateTilePriorities() { |
| 39 PictureLayerImpl::UpdateTilePriorities(); |
| 40 ++update_tile_priorities_count_; |
| 41 } |
| 42 |
34 gfx::Size FakePictureLayerImpl::CalculateTileSize( | 43 gfx::Size FakePictureLayerImpl::CalculateTileSize( |
35 gfx::Size content_bounds) const { | 44 gfx::Size content_bounds) const { |
36 if (fixed_tile_size_.IsEmpty()) { | 45 if (fixed_tile_size_.IsEmpty()) { |
37 return PictureLayerImpl::CalculateTileSize(content_bounds); | 46 return PictureLayerImpl::CalculateTileSize(content_bounds); |
38 } | 47 } |
39 | 48 |
40 return fixed_tile_size_; | 49 return fixed_tile_size_; |
41 } | 50 } |
42 | 51 |
43 PictureLayerTiling* FakePictureLayerImpl::HighResTiling() const { | 52 PictureLayerTiling* FakePictureLayerImpl::HighResTiling() const { |
(...skipping 16 matching lines...) Expand all Loading... |
60 if (tiling->resolution() == LOW_RESOLUTION) { | 69 if (tiling->resolution() == LOW_RESOLUTION) { |
61 // There should be only one low res tiling. | 70 // There should be only one low res tiling. |
62 CHECK(!result); | 71 CHECK(!result); |
63 result = tiling; | 72 result = tiling; |
64 } | 73 } |
65 } | 74 } |
66 return result; | 75 return result; |
67 } | 76 } |
68 | 77 |
69 } // namespace cc | 78 } // namespace cc |
OLD | NEW |