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