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