| 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 #ifndef CC_LAYERS_PICTURE_IMAGE_LAYER_H_ | 5 #ifndef CC_LAYERS_PICTURE_IMAGE_LAYER_H_ |
| 6 #define CC_LAYERS_PICTURE_IMAGE_LAYER_H_ | 6 #define CC_LAYERS_PICTURE_IMAGE_LAYER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
| 12 #include "cc/layers/content_layer_client.h" | 12 #include "cc/layers/content_layer_client.h" |
| 13 #include "cc/layers/picture_layer.h" | 13 #include "cc/layers/picture_layer.h" |
| 14 #include "skia/ext/refptr.h" | 14 #include "skia/ext/refptr.h" |
| 15 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
| 16 | 16 |
| 17 class SkColorFilter; |
| 17 class SkImage; | 18 class SkImage; |
| 18 | 19 |
| 19 namespace cc { | 20 namespace cc { |
| 20 | 21 |
| 21 class CC_EXPORT PictureImageLayer : public PictureLayer, ContentLayerClient { | 22 class CC_EXPORT PictureImageLayer : public PictureLayer, ContentLayerClient { |
| 22 public: | 23 public: |
| 23 static scoped_refptr<PictureImageLayer> Create(const LayerSettings& settings); | 24 static scoped_refptr<PictureImageLayer> Create(const LayerSettings& settings); |
| 24 | 25 |
| 25 void SetImage(skia::RefPtr<const SkImage> image); | 26 void SetImage(skia::RefPtr<const SkImage> image, |
| 27 skia::RefPtr<SkColorFilter> transform = nullptr); |
| 26 | 28 |
| 27 // Layer implementation. | 29 // Layer implementation. |
| 28 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 30 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 29 | 31 |
| 30 gfx::Rect PaintableRegion() override; | 32 gfx::Rect PaintableRegion() override; |
| 31 | 33 |
| 32 // ContentLayerClient implementation. | 34 // ContentLayerClient implementation. |
| 33 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( | 35 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( |
| 34 ContentLayerClient::PaintingControlSetting painting_control) override; | 36 ContentLayerClient::PaintingControlSetting painting_control) override; |
| 35 bool FillsBoundsCompletely() const override; | 37 bool FillsBoundsCompletely() const override; |
| 36 size_t GetApproximateUnsharedMemoryUsage() const override; | 38 size_t GetApproximateUnsharedMemoryUsage() const override; |
| 37 | 39 |
| 38 protected: | 40 protected: |
| 39 bool HasDrawableContent() const override; | 41 bool HasDrawableContent() const override; |
| 40 | 42 |
| 41 private: | 43 private: |
| 42 explicit PictureImageLayer(const LayerSettings& settings); | 44 explicit PictureImageLayer(const LayerSettings& settings); |
| 43 ~PictureImageLayer() override; | 45 ~PictureImageLayer() override; |
| 44 | 46 |
| 45 skia::RefPtr<const SkImage> image_; | 47 skia::RefPtr<const SkImage> image_; |
| 48 skia::RefPtr<SkColorFilter> transform_; |
| 46 | 49 |
| 47 DISALLOW_COPY_AND_ASSIGN(PictureImageLayer); | 50 DISALLOW_COPY_AND_ASSIGN(PictureImageLayer); |
| 48 }; | 51 }; |
| 49 | 52 |
| 50 } // namespace cc | 53 } // namespace cc |
| 51 | 54 |
| 52 #endif // CC_LAYERS_PICTURE_IMAGE_LAYER_H_ | 55 #endif // CC_LAYERS_PICTURE_IMAGE_LAYER_H_ |
| OLD | NEW |