| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DISPLAY_ITEM_H_ | 5 #ifndef CC_PLAYBACK_DISPLAY_ITEM_H_ |
| 6 #define CC_PLAYBACK_DISPLAY_ITEM_H_ | 6 #define CC_PLAYBACK_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 "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
| 13 #include "cc/debug/traced_value.h" | 13 #include "cc/debug/traced_value.h" |
| 14 #include "third_party/skia/include/core/SkPicture.h" | 14 #include "third_party/skia/include/core/SkPicture.h" |
| 15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
| 16 | 16 |
| 17 class SkCanvas; | 17 class SkCanvas; |
| 18 | 18 |
| 19 namespace cc { | 19 namespace cc { |
| 20 | 20 |
| 21 namespace proto { | 21 namespace proto { |
| 22 class DisplayItem; | 22 class DisplayItem; |
| 23 } // namespace proto | 23 } // namespace proto |
| 24 | 24 |
| 25 class CC_EXPORT DisplayItem { | 25 class CC_EXPORT DisplayItem { |
| 26 public: | 26 public: |
| 27 enum Type { |
| 28 CLIP, |
| 29 END_CLIP, |
| 30 CLIP_PATH, |
| 31 END_CLIP_PATH, |
| 32 COMPOSITING, |
| 33 END_COMPOSITING, |
| 34 DRAWING, |
| 35 FILTER, |
| 36 END_FILTER, |
| 37 FLOAT_CLIP, |
| 38 END_FLOAT_CLIP, |
| 39 TRANSFORM, |
| 40 END_TRANSFORM, |
| 41 }; |
| 42 |
| 27 virtual ~DisplayItem() {} | 43 virtual ~DisplayItem() {} |
| 28 | 44 |
| 29 virtual void ToProtobuf(proto::DisplayItem* proto) const = 0; | 45 virtual void ToProtobuf(proto::DisplayItem* proto) const = 0; |
| 30 virtual sk_sp<const SkPicture> GetPicture() const; | 46 virtual sk_sp<const SkPicture> GetPicture() const; |
| 31 virtual void Raster(SkCanvas* canvas, | 47 virtual void Raster(SkCanvas* canvas, |
| 32 SkPicture::AbortCallback* callback) const = 0; | 48 SkPicture::AbortCallback* callback) const = 0; |
| 33 virtual void AsValueInto(const gfx::Rect& visual_rect, | 49 virtual void AsValueInto(const gfx::Rect& visual_rect, |
| 34 base::trace_event::TracedValue* array) const = 0; | 50 base::trace_event::TracedValue* array) const = 0; |
| 35 // For tracing. | 51 |
| 36 virtual size_t ExternalMemoryUsage() const = 0; | 52 Type type() const { return type_; } |
| 37 | 53 |
| 38 protected: | 54 protected: |
| 39 DisplayItem(); | 55 explicit DisplayItem(Type type) : type_(type) {} |
| 56 |
| 57 const Type type_; |
| 40 }; | 58 }; |
| 41 | 59 |
| 42 } // namespace cc | 60 } // namespace cc |
| 43 | 61 |
| 44 #endif // CC_PLAYBACK_DISPLAY_ITEM_H_ | 62 #endif // CC_PLAYBACK_DISPLAY_ITEM_H_ |
| OLD | NEW |