| 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> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 public: | 23 public: |
| 24 ClipPathDisplayItem(const SkPath& path, SkClipOp clip_op, bool antialias); | 24 ClipPathDisplayItem(const SkPath& path, SkClipOp clip_op, bool antialias); |
| 25 explicit ClipPathDisplayItem(const proto::DisplayItem& proto); | 25 explicit ClipPathDisplayItem(const proto::DisplayItem& proto); |
| 26 ~ClipPathDisplayItem() override; | 26 ~ClipPathDisplayItem() override; |
| 27 | 27 |
| 28 void ToProtobuf(proto::DisplayItem* proto) const override; | 28 void ToProtobuf(proto::DisplayItem* proto) const override; |
| 29 void Raster(SkCanvas* canvas, | 29 void Raster(SkCanvas* canvas, |
| 30 SkPicture::AbortCallback* callback) const override; | 30 SkPicture::AbortCallback* callback) const override; |
| 31 void AsValueInto(const gfx::Rect& visual_rect, | 31 void AsValueInto(const gfx::Rect& visual_rect, |
| 32 base::trace_event::TracedValue* array) const override; | 32 base::trace_event::TracedValue* array) const override; |
| 33 size_t ExternalMemoryUsage() const override; | |
| 34 | 33 |
| 34 size_t ExternalMemoryUsage() const { |
| 35 // The size of SkPath's external storage is not currently accounted for (and |
| 36 // may well be shared anyway). |
| 37 return 0; |
| 38 } |
| 35 int ApproximateOpCount() const { return 1; } | 39 int ApproximateOpCount() const { return 1; } |
| 36 | 40 |
| 37 private: | 41 private: |
| 38 void SetNew(const SkPath& path, SkClipOp clip_op, bool antialias); | 42 void SetNew(const SkPath& path, SkClipOp clip_op, bool antialias); |
| 39 | 43 |
| 40 SkPath clip_path_; | 44 SkPath clip_path_; |
| 41 SkClipOp clip_op_; | 45 SkClipOp clip_op_; |
| 42 bool antialias_; | 46 bool antialias_; |
| 43 }; | 47 }; |
| 44 | 48 |
| 45 class CC_EXPORT EndClipPathDisplayItem : public DisplayItem { | 49 class CC_EXPORT EndClipPathDisplayItem : public DisplayItem { |
| 46 public: | 50 public: |
| 47 EndClipPathDisplayItem(); | 51 EndClipPathDisplayItem(); |
| 48 explicit EndClipPathDisplayItem(const proto::DisplayItem& proto); | 52 explicit EndClipPathDisplayItem(const proto::DisplayItem& proto); |
| 49 ~EndClipPathDisplayItem() override; | 53 ~EndClipPathDisplayItem() override; |
| 50 | 54 |
| 51 static std::unique_ptr<EndClipPathDisplayItem> Create() { | 55 static std::unique_ptr<EndClipPathDisplayItem> Create() { |
| 52 return base::MakeUnique<EndClipPathDisplayItem>(); | 56 return base::MakeUnique<EndClipPathDisplayItem>(); |
| 53 } | 57 } |
| 54 | 58 |
| 55 void ToProtobuf(proto::DisplayItem* proto) const override; | 59 void ToProtobuf(proto::DisplayItem* proto) const override; |
| 56 void Raster(SkCanvas* canvas, | 60 void Raster(SkCanvas* canvas, |
| 57 SkPicture::AbortCallback* callback) const override; | 61 SkPicture::AbortCallback* callback) const override; |
| 58 void AsValueInto(const gfx::Rect& visual_rect, | 62 void AsValueInto(const gfx::Rect& visual_rect, |
| 59 base::trace_event::TracedValue* array) const override; | 63 base::trace_event::TracedValue* array) const override; |
| 60 size_t ExternalMemoryUsage() const override; | |
| 61 | 64 |
| 62 int ApproximateOpCount() const { return 0; } | 65 int ApproximateOpCount() const { return 0; } |
| 63 }; | 66 }; |
| 64 | 67 |
| 65 } // namespace cc | 68 } // namespace cc |
| 66 | 69 |
| 67 #endif // CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_ | 70 #endif // CC_PLAYBACK_CLIP_PATH_DISPLAY_ITEM_H_ |
| OLD | NEW |