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 class ImageSerializationProcessor; | |
21 | 20 |
22 namespace proto { | 21 namespace proto { |
23 class DisplayItem; | 22 class DisplayItem; |
24 } // namespace proto | 23 } // namespace proto |
25 | 24 |
26 class CC_EXPORT DisplayItem { | 25 class CC_EXPORT DisplayItem { |
27 public: | 26 public: |
28 virtual ~DisplayItem() {} | 27 virtual ~DisplayItem() {} |
29 | 28 |
30 virtual void ToProtobuf( | 29 virtual void ToProtobuf(proto::DisplayItem* proto) const = 0; |
31 proto::DisplayItem* proto, | 30 virtual sk_sp<const SkPicture> GetPicture() const; |
32 ImageSerializationProcessor* image_serialization_processor) const = 0; | |
33 virtual void Raster(SkCanvas* canvas, | 31 virtual void Raster(SkCanvas* canvas, |
34 SkPicture::AbortCallback* callback) const = 0; | 32 SkPicture::AbortCallback* callback) const = 0; |
35 virtual void AsValueInto(const gfx::Rect& visual_rect, | 33 virtual void AsValueInto(const gfx::Rect& visual_rect, |
36 base::trace_event::TracedValue* array) const = 0; | 34 base::trace_event::TracedValue* array) const = 0; |
37 // For tracing. | 35 // For tracing. |
38 virtual size_t ExternalMemoryUsage() const = 0; | 36 virtual size_t ExternalMemoryUsage() const = 0; |
39 | 37 |
40 protected: | 38 protected: |
41 DisplayItem(); | 39 DisplayItem(); |
42 }; | 40 }; |
43 | 41 |
44 } // namespace cc | 42 } // namespace cc |
45 | 43 |
46 #endif // CC_PLAYBACK_DISPLAY_ITEM_H_ | 44 #endif // CC_PLAYBACK_DISPLAY_ITEM_H_ |
OLD | NEW |