| 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 | 10 |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "cc/tiles/tile.h" | 12 #include "cc/tiles/tile.h" |
| 13 #include "cc/trees/layer_tree_impl.h" | 13 #include "cc/trees/layer_tree_impl.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 FakePictureLayerImpl::FakePictureLayerImpl( | 17 FakePictureLayerImpl::FakePictureLayerImpl( |
| 18 LayerTreeImpl* tree_impl, | 18 LayerTreeImpl* tree_impl, |
| 19 int id, | 19 int id, |
| 20 scoped_refptr<RasterSource> raster_source, | 20 scoped_refptr<RasterSource> raster_source, |
| 21 bool is_mask) | 21 Layer::LayerMaskType mask_type) |
| 22 : PictureLayerImpl(tree_impl, id, is_mask) { | 22 : PictureLayerImpl(tree_impl, id, mask_type) { |
| 23 SetBounds(raster_source->GetSize()); | 23 SetBounds(raster_source->GetSize()); |
| 24 SetRasterSourceOnPending(raster_source, Region()); | 24 SetRasterSourceOnPending(raster_source, Region()); |
| 25 } | 25 } |
| 26 | 26 |
| 27 FakePictureLayerImpl::FakePictureLayerImpl( | 27 FakePictureLayerImpl::FakePictureLayerImpl( |
| 28 LayerTreeImpl* tree_impl, | 28 LayerTreeImpl* tree_impl, |
| 29 int id, | 29 int id, |
| 30 scoped_refptr<RasterSource> raster_source, | 30 scoped_refptr<RasterSource> raster_source, |
| 31 bool is_mask, | 31 Layer::LayerMaskType mask_type, |
| 32 const gfx::Size& layer_bounds) | 32 const gfx::Size& layer_bounds) |
| 33 : PictureLayerImpl(tree_impl, id, is_mask) { | 33 : PictureLayerImpl(tree_impl, id, mask_type) { |
| 34 SetBounds(layer_bounds); | 34 SetBounds(layer_bounds); |
| 35 SetRasterSourceOnPending(raster_source, Region()); | 35 SetRasterSourceOnPending(raster_source, Region()); |
| 36 } | 36 } |
| 37 | 37 |
| 38 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, | 38 FakePictureLayerImpl::FakePictureLayerImpl(LayerTreeImpl* tree_impl, |
| 39 int id, | 39 int id, |
| 40 bool is_mask) | 40 Layer::LayerMaskType mask_type) |
| 41 : PictureLayerImpl(tree_impl, id, is_mask) {} | 41 : PictureLayerImpl(tree_impl, id, mask_type) {} |
| 42 | 42 |
| 43 std::unique_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( | 43 std::unique_ptr<LayerImpl> FakePictureLayerImpl::CreateLayerImpl( |
| 44 LayerTreeImpl* tree_impl) { | 44 LayerTreeImpl* tree_impl) { |
| 45 return base::WrapUnique(new FakePictureLayerImpl(tree_impl, id(), is_mask_)); | 45 return base::WrapUnique( |
| 46 new FakePictureLayerImpl(tree_impl, id(), mask_type_)); |
| 46 } | 47 } |
| 47 | 48 |
| 48 void FakePictureLayerImpl::PushPropertiesTo(LayerImpl* layer_impl) { | 49 void FakePictureLayerImpl::PushPropertiesTo(LayerImpl* layer_impl) { |
| 49 FakePictureLayerImpl* picture_layer_impl = | 50 FakePictureLayerImpl* picture_layer_impl = |
| 50 static_cast<FakePictureLayerImpl*>(layer_impl); | 51 static_cast<FakePictureLayerImpl*>(layer_impl); |
| 51 picture_layer_impl->fixed_tile_size_ = fixed_tile_size_; | 52 picture_layer_impl->fixed_tile_size_ = fixed_tile_size_; |
| 52 PictureLayerImpl::PushPropertiesTo(layer_impl); | 53 PictureLayerImpl::PushPropertiesTo(layer_impl); |
| 53 } | 54 } |
| 54 | 55 |
| 55 void FakePictureLayerImpl::AppendQuads( | 56 void FakePictureLayerImpl::AppendQuads( |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 PictureLayerImpl::ReleaseResources(); | 205 PictureLayerImpl::ReleaseResources(); |
| 205 ++release_resources_count_; | 206 ++release_resources_count_; |
| 206 } | 207 } |
| 207 | 208 |
| 208 void FakePictureLayerImpl::ReleaseTileResources() { | 209 void FakePictureLayerImpl::ReleaseTileResources() { |
| 209 PictureLayerImpl::ReleaseTileResources(); | 210 PictureLayerImpl::ReleaseTileResources(); |
| 210 ++release_tile_resources_count_; | 211 ++release_tile_resources_count_; |
| 211 } | 212 } |
| 212 | 213 |
| 213 } // namespace cc | 214 } // namespace cc |
| OLD | NEW |