| 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 "cc/paint/paint_canvas.h" |
| 15 #include "cc/paint/paint_record.h" |
| 15 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
| 16 | 17 |
| 17 class SkCanvas; | |
| 18 | |
| 19 namespace cc { | 18 namespace cc { |
| 20 | 19 |
| 21 namespace proto { | 20 namespace proto { |
| 22 class DisplayItem; | 21 class DisplayItem; |
| 23 } // namespace proto | 22 } // namespace proto |
| 24 | 23 |
| 25 class CC_EXPORT DisplayItem { | 24 class CC_EXPORT DisplayItem { |
| 26 public: | 25 public: |
| 27 enum Type { | 26 enum Type { |
| 28 CLIP, | 27 CLIP, |
| 29 END_CLIP, | 28 END_CLIP, |
| 30 CLIP_PATH, | 29 CLIP_PATH, |
| 31 END_CLIP_PATH, | 30 END_CLIP_PATH, |
| 32 COMPOSITING, | 31 COMPOSITING, |
| 33 END_COMPOSITING, | 32 END_COMPOSITING, |
| 34 DRAWING, | 33 DRAWING, |
| 35 FILTER, | 34 FILTER, |
| 36 END_FILTER, | 35 END_FILTER, |
| 37 FLOAT_CLIP, | 36 FLOAT_CLIP, |
| 38 END_FLOAT_CLIP, | 37 END_FLOAT_CLIP, |
| 39 TRANSFORM, | 38 TRANSFORM, |
| 40 END_TRANSFORM, | 39 END_TRANSFORM, |
| 41 }; | 40 }; |
| 42 | 41 |
| 43 virtual ~DisplayItem() {} | 42 virtual ~DisplayItem() {} |
| 44 | 43 |
| 45 virtual void ToProtobuf(proto::DisplayItem* proto) const = 0; | 44 virtual void ToProtobuf(proto::DisplayItem* proto) const = 0; |
| 46 virtual sk_sp<const SkPicture> GetPicture() const; | 45 virtual sk_sp<const PaintRecord> GetPicture() const; |
| 47 virtual void Raster(SkCanvas* canvas, | 46 virtual void Raster(PaintCanvas* canvas, |
| 48 SkPicture::AbortCallback* callback) const = 0; | 47 PaintRecord::AbortCallback* callback) const = 0; |
| 49 virtual void AsValueInto(const gfx::Rect& visual_rect, | 48 virtual void AsValueInto(const gfx::Rect& visual_rect, |
| 50 base::trace_event::TracedValue* array) const = 0; | 49 base::trace_event::TracedValue* array) const = 0; |
| 51 | 50 |
| 52 Type type() const { return type_; } | 51 Type type() const { return type_; } |
| 53 | 52 |
| 54 protected: | 53 protected: |
| 55 explicit DisplayItem(Type type) : type_(type) {} | 54 explicit DisplayItem(Type type) : type_(type) {} |
| 56 | 55 |
| 57 const Type type_; | 56 const Type type_; |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 } // namespace cc | 59 } // namespace cc |
| 61 | 60 |
| 62 #endif // CC_PLAYBACK_DISPLAY_ITEM_H_ | 61 #endif // CC_PLAYBACK_DISPLAY_ITEM_H_ |
| OLD | NEW |