| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_mask_layer_impl.h" | 5 #include "cc/test/fake_mask_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 | 8 |
| 9 namespace cc { | 9 namespace cc { |
| 10 | 10 |
| 11 FakeMaskLayerImpl::FakeMaskLayerImpl(LayerTreeImpl* tree_impl, | 11 FakeMaskLayerImpl::FakeMaskLayerImpl(LayerTreeImpl* tree_impl, int id) |
| 12 int id, | 12 : LayerImpl(tree_impl, id) {} |
| 13 scoped_refptr<RasterSource> raster_source, | |
| 14 Layer::LayerMaskType mask_type) | |
| 15 : PictureLayerImpl(tree_impl, id, mask_type) { | |
| 16 SetBounds(raster_source->GetSize()); | |
| 17 Region region; | |
| 18 UpdateRasterSource(raster_source, ®ion, nullptr); | |
| 19 } | |
| 20 | 13 |
| 21 std::unique_ptr<FakeMaskLayerImpl> FakeMaskLayerImpl::Create( | 14 std::unique_ptr<FakeMaskLayerImpl> FakeMaskLayerImpl::Create( |
| 22 LayerTreeImpl* tree_impl, | 15 LayerTreeImpl* tree_impl, |
| 23 int id, | 16 int id) { |
| 24 scoped_refptr<RasterSource> raster_source, | 17 return base::WrapUnique(new FakeMaskLayerImpl(tree_impl, id)); |
| 25 Layer::LayerMaskType mask_type) { | |
| 26 return base::WrapUnique( | |
| 27 new FakeMaskLayerImpl(tree_impl, id, raster_source, mask_type)); | |
| 28 } | 18 } |
| 29 | 19 |
| 30 void FakeMaskLayerImpl::GetContentsResourceId(ResourceId* resource_id, | 20 void FakeMaskLayerImpl::GetContentsResourceId(ResourceId* resource_id, |
| 31 gfx::Size* resource_size) const { | 21 gfx::Size* resource_size) const { |
| 32 *resource_id = 0; | 22 *resource_id = 0; |
| 33 } | 23 } |
| 34 | 24 |
| 35 } // namespace cc | 25 } // namespace cc |
| OLD | NEW |