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 pile_ = pile; | 15 pile_ = pile; |
15 SetBounds(pile_->size()); | 16 SetBounds(pile_->size()); |
16 CreateTilingSet(); | 17 CreateTilingSet(); |
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) {} | 21 : PictureLayerImpl(tree_impl, id), append_quads_count_(0) {} |
21 | 22 |
22 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( | 23 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( |
23 LayerTreeImpl* tree_impl) { | 24 LayerTreeImpl* tree_impl) { |
24 return make_scoped_ptr( | 25 return make_scoped_ptr( |
25 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>(); | 26 new FakePictureLayerImpl(tree_impl, id())).PassAs<LayerImpl>(); |
26 } | 27 } |
27 | 28 |
| 29 void FakePictureLayerImpl::AppendQuads(QuadSink* quad_sink, |
| 30 AppendQuadsData* append_quads_data) { |
| 31 PictureLayerImpl::AppendQuads(quad_sink, append_quads_data); |
| 32 ++append_quads_count_; |
| 33 } |
| 34 |
28 gfx::Size FakePictureLayerImpl::CalculateTileSize(gfx::Size content_bounds) { | 35 gfx::Size FakePictureLayerImpl::CalculateTileSize(gfx::Size content_bounds) { |
29 if (fixed_tile_size_.IsEmpty()) { | 36 if (fixed_tile_size_.IsEmpty()) { |
30 return PictureLayerImpl::CalculateTileSize(content_bounds); | 37 return PictureLayerImpl::CalculateTileSize(content_bounds); |
31 } | 38 } |
32 | 39 |
33 return fixed_tile_size_; | 40 return fixed_tile_size_; |
34 } | 41 } |
35 | 42 |
36 } // namespace cc | 43 } // namespace cc |
OLD | NEW |