| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 |
| 11 #include "base/memory/ptr_util.h" |
| 10 #include "cc/tiles/tile.h" | 12 #include "cc/tiles/tile.h" |
| 11 #include "cc/trees/layer_tree_impl.h" | 13 #include "cc/trees/layer_tree_impl.h" |
| 12 | 14 |
| 13 namespace cc { | 15 namespace cc { |
| 14 | 16 |
| 15 FakePictureLayerImpl::FakePictureLayerImpl( | 17 FakePictureLayerImpl::FakePictureLayerImpl( |
| 16 LayerTreeImpl* tree_impl, | 18 LayerTreeImpl* tree_impl, |
| 17 int id, | 19 int id, |
| 18 scoped_refptr<RasterSource> raster_source, | 20 scoped_refptr<RasterSource> raster_source, |
| 19 bool is_mask) | 21 bool is_mask) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 46 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, | 48 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, |
| 47 int id, | 49 int id, |
| 48 bool is_mask) | 50 bool is_mask) |
| 49 : PictureLayerImpl(tree_impl, id, is_mask), | 51 : PictureLayerImpl(tree_impl, id, is_mask), |
| 50 append_quads_count_(0), | 52 append_quads_count_(0), |
| 51 did_become_active_call_count_(0), | 53 did_become_active_call_count_(0), |
| 52 has_valid_tile_priorities_(false), | 54 has_valid_tile_priorities_(false), |
| 53 use_set_valid_tile_priorities_flag_(false), | 55 use_set_valid_tile_priorities_flag_(false), |
| 54 release_resources_count_(0) {} | 56 release_resources_count_(0) {} |
| 55 | 57 |
| 56 scoped_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( | 58 std::unique_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( |
| 57 LayerTreeImpl* tree_impl) { | 59 LayerTreeImpl* tree_impl) { |
| 58 return make_scoped_ptr(new FakePictureLayerImpl(tree_impl, id(), is_mask_)); | 60 return base::WrapUnique(new FakePictureLayerImpl(tree_impl, id(), is_mask_)); |
| 59 } | 61 } |
| 60 | 62 |
| 61 void FakePictureLayerImpl::PushPropertiesTo(LayerImpl* layer_impl) { | 63 void FakePictureLayerImpl::PushPropertiesTo(LayerImpl* layer_impl) { |
| 62 FakePictureLayerImpl* picture_layer_impl = | 64 FakePictureLayerImpl* picture_layer_impl = |
| 63 static_cast<FakePictureLayerImpl*>(layer_impl); | 65 static_cast<FakePictureLayerImpl*>(layer_impl); |
| 64 picture_layer_impl->fixed_tile_size_ = fixed_tile_size_; | 66 picture_layer_impl->fixed_tile_size_ = fixed_tile_size_; |
| 65 PictureLayerImpl::PushPropertiesTo(layer_impl); | 67 PictureLayerImpl::PushPropertiesTo(layer_impl); |
| 66 } | 68 } |
| 67 | 69 |
| 68 void FakePictureLayerImpl::AppendQuads( | 70 void FakePictureLayerImpl::AppendQuads( |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 220 |
| 219 return CountTilesRequired(&PictureLayerTiling::IsTileRequiredForDraw); | 221 return CountTilesRequired(&PictureLayerTiling::IsTileRequiredForDraw); |
| 220 } | 222 } |
| 221 | 223 |
| 222 void FakePictureLayerImpl::ReleaseResources() { | 224 void FakePictureLayerImpl::ReleaseResources() { |
| 223 PictureLayerImpl::ReleaseResources(); | 225 PictureLayerImpl::ReleaseResources(); |
| 224 ++release_resources_count_; | 226 ++release_resources_count_; |
| 225 } | 227 } |
| 226 | 228 |
| 227 } // namespace cc | 229 } // namespace cc |
| OLD | NEW |