| 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 #ifndef CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_ | 5 #ifndef CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_ |
| 6 #define CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_ | 6 #define CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
| 14 #include "cc/playback/display_item.h" | 14 #include "cc/playback/display_item.h" |
| 15 #include "third_party/skia/include/core/SkPath.h" | 15 #include "third_party/skia/include/core/SkPath.h" |
| 16 #include "third_party/skia/include/core/SkRegion.h" | 16 #include "third_party/skia/include/core/SkRegion.h" |
| 17 | 17 |
| 18 class SkCanvas; | 18 class SkCanvas; |
| 19 | 19 |
| 20 namespace cc { | 20 namespace cc { |
| 21 class ImageSerializationProcessor; | |
| 22 | 21 |
| 23 class CC_EXPORT ClipPathDisplayItem : public DisplayItem { | 22 class CC_EXPORT ClipPathDisplayItem : public DisplayItem { |
| 24 public: | 23 public: |
| 25 ClipPathDisplayItem(const SkPath& path, SkRegion::Op clip_op, bool antialias); | 24 ClipPathDisplayItem(const SkPath& path, SkRegion::Op clip_op, bool antialias); |
| 26 explicit ClipPathDisplayItem(const proto::DisplayItem& proto); | 25 explicit ClipPathDisplayItem(const proto::DisplayItem& proto); |
| 27 ~ClipPathDisplayItem() override; | 26 ~ClipPathDisplayItem() override; |
| 28 | 27 |
| 29 void ToProtobuf(proto::DisplayItem* proto, | 28 void ToProtobuf(proto::DisplayItem* proto) const override; |
| 30 ImageSerializationProcessor* image_serialization_processor) | |
| 31 const override; | |
| 32 void Raster(SkCanvas* canvas, | 29 void Raster(SkCanvas* canvas, |
| 33 const gfx::Rect& canvas_target_playback_rect, | 30 const gfx::Rect& canvas_target_playback_rect, |
| 34 SkPicture::AbortCallback* callback) const override; | 31 SkPicture::AbortCallback* callback) const override; |
| 35 void AsValueInto(const gfx::Rect& visual_rect, | 32 void AsValueInto(const gfx::Rect& visual_rect, |
| 36 base::trace_event::TracedValue* array) const override; | 33 base::trace_event::TracedValue* array) const override; |
| 37 size_t ExternalMemoryUsage() const override; | 34 size_t ExternalMemoryUsage() const override; |
| 38 | 35 |
| 39 int ApproximateOpCount() const { return 1; } | 36 int ApproximateOpCount() const { return 1; } |
| 40 | 37 |
| 41 private: | 38 private: |
| 42 void SetNew(const SkPath& path, SkRegion::Op clip_op, bool antialias); | 39 void SetNew(const SkPath& path, SkRegion::Op clip_op, bool antialias); |
| 43 | 40 |
| 44 SkPath clip_path_; | 41 SkPath clip_path_; |
| 45 SkRegion::Op clip_op_; | 42 SkRegion::Op clip_op_; |
| 46 bool antialias_; | 43 bool antialias_; |
| 47 }; | 44 }; |
| 48 | 45 |
| 49 class CC_EXPORT EndClipPathDisplayItem : public DisplayItem { | 46 class CC_EXPORT EndClipPathDisplayItem : public DisplayItem { |
| 50 public: | 47 public: |
| 51 EndClipPathDisplayItem(); | 48 EndClipPathDisplayItem(); |
| 52 explicit EndClipPathDisplayItem(const proto::DisplayItem& proto); | 49 explicit EndClipPathDisplayItem(const proto::DisplayItem& proto); |
| 53 ~EndClipPathDisplayItem() override; | 50 ~EndClipPathDisplayItem() override; |
| 54 | 51 |
| 55 static std::unique_ptr<EndClipPathDisplayItem> Create() { | 52 static std::unique_ptr<EndClipPathDisplayItem> Create() { |
| 56 return base::WrapUnique(new EndClipPathDisplayItem()); | 53 return base::WrapUnique(new EndClipPathDisplayItem()); |
| 57 } | 54 } |
| 58 | 55 |
| 59 void ToProtobuf(proto::DisplayItem* proto, | 56 void ToProtobuf(proto::DisplayItem* proto) const override; |
| 60 ImageSerializationProcessor* image_serialization_processor) | |
| 61 const override; | |
| 62 void Raster(SkCanvas* canvas, | 57 void Raster(SkCanvas* canvas, |
| 63 const gfx::Rect& canvas_target_playback_rect, | 58 const gfx::Rect& canvas_target_playback_rect, |
| 64 SkPicture::AbortCallback* callback) const override; | 59 SkPicture::AbortCallback* callback) const override; |
| 65 void AsValueInto(const gfx::Rect& visual_rect, | 60 void AsValueInto(const gfx::Rect& visual_rect, |
| 66 base::trace_event::TracedValue* array) const override; | 61 base::trace_event::TracedValue* array) const override; |
| 67 size_t ExternalMemoryUsage() const override; | 62 size_t ExternalMemoryUsage() const override; |
| 68 | 63 |
| 69 int ApproximateOpCount() const { return 0; } | 64 int ApproximateOpCount() const { return 0; } |
| 70 }; | 65 }; |
| 71 | 66 |
| 72 } // namespace cc | 67 } // namespace cc |
| 73 | 68 |
| 74 #endif // CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_ | 69 #endif // CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_ |
| OLD | NEW |