| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/layers/picture_image_layer.h" | 5 #include "cc/layers/picture_image_layer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "cc/layers/picture_layer_impl.h" | 9 #include "cc/layers/picture_layer_impl.h" |
| 10 #include "cc/paint/paint_canvas.h" | 10 #include "cc/paint/paint_canvas.h" |
| 11 #include "cc/paint/paint_recorder.h" | 11 #include "cc/paint/paint_recorder.h" |
| 12 #include "cc/playback/drawing_display_item.h" | 12 #include "cc/playback/drawing_display_item.h" |
| 13 #include "cc/trees/layer_tree_host.h" | 13 #include "cc/trees/layer_tree_host.h" |
| 14 #include "cc/trees/layer_tree_settings.h" | 14 #include "cc/trees/layer_tree_settings.h" |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 | 17 |
| 18 scoped_refptr<PictureImageLayer> PictureImageLayer::Create() { | 18 scoped_refptr<PictureImageLayer> PictureImageLayer::Create() { |
| 19 return make_scoped_refptr(new PictureImageLayer()); | 19 return make_scoped_refptr(new PictureImageLayer()); |
| 20 } | 20 } |
| 21 | 21 |
| 22 PictureImageLayer::PictureImageLayer() : PictureLayer(this) {} | 22 PictureImageLayer::PictureImageLayer() : PictureLayer(this) {} |
| 23 | 23 |
| 24 PictureImageLayer::~PictureImageLayer() { | 24 PictureImageLayer::~PictureImageLayer() { |
| 25 ClearClient(); | 25 ClearClient(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 std::unique_ptr<LayerImpl> PictureImageLayer::CreateLayerImpl( | 28 std::unique_ptr<LayerImpl> PictureImageLayer::CreateLayerImpl( |
| 29 LayerTreeImpl* tree_impl) { | 29 LayerTreeImpl* tree_impl) { |
| 30 auto layer_impl = PictureLayerImpl::Create(tree_impl, id(), is_mask()); | 30 auto layer_impl = PictureLayerImpl::Create(tree_impl, id(), is_mask(), |
| 31 is_single_texture_mask()); |
| 31 layer_impl->set_is_directly_composited_image(true); | 32 layer_impl->set_is_directly_composited_image(true); |
| 32 return std::move(layer_impl); | 33 return std::move(layer_impl); |
| 33 } | 34 } |
| 34 | 35 |
| 35 bool PictureImageLayer::HasDrawableContent() const { | 36 bool PictureImageLayer::HasDrawableContent() const { |
| 36 return image_ && PictureLayer::HasDrawableContent(); | 37 return image_ && PictureLayer::HasDrawableContent(); |
| 37 } | 38 } |
| 38 | 39 |
| 39 void PictureImageLayer::SetImage(sk_sp<const SkImage> image) { | 40 void PictureImageLayer::SetImage(sk_sp<const SkImage> image) { |
| 40 // SetImage() currently gets called whenever there is any | 41 // SetImage() currently gets called whenever there is any |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 87 |
| 87 bool PictureImageLayer::FillsBoundsCompletely() const { | 88 bool PictureImageLayer::FillsBoundsCompletely() const { |
| 88 return false; | 89 return false; |
| 89 } | 90 } |
| 90 | 91 |
| 91 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { | 92 size_t PictureImageLayer::GetApproximateUnsharedMemoryUsage() const { |
| 92 return 0; | 93 return 0; |
| 93 } | 94 } |
| 94 | 95 |
| 95 } // namespace cc | 96 } // namespace cc |
| OLD | NEW |