| 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_DRAWING_DISPLAY_ITEM_H_ | 5 #ifndef CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ |
| 6 #define CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ | 6 #define CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | |
| 11 #include <vector> | |
| 12 | |
| 13 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
| 14 #include "cc/paint/paint_record.h" | 11 #include "cc/paint/paint_record.h" |
| 15 #include "cc/playback/display_item.h" | 12 #include "cc/playback/display_item.h" |
| 16 #include "third_party/skia/include/core/SkRefCnt.h" | 13 #include "third_party/skia/include/core/SkRefCnt.h" |
| 17 #include "ui/gfx/geometry/point_f.h" | |
| 18 | |
| 19 class SkCanvas; | |
| 20 | 14 |
| 21 namespace cc { | 15 namespace cc { |
| 22 | 16 |
| 23 class CC_EXPORT DrawingDisplayItem : public DisplayItem { | 17 class CC_EXPORT DrawingDisplayItem : public DisplayItem { |
| 24 public: | 18 public: |
| 25 DrawingDisplayItem(); | 19 DrawingDisplayItem(); |
| 26 explicit DrawingDisplayItem(sk_sp<const PaintRecord> record); | 20 explicit DrawingDisplayItem(sk_sp<const PaintRecord> record); |
| 27 explicit DrawingDisplayItem(const DrawingDisplayItem& item); | 21 explicit DrawingDisplayItem(const DrawingDisplayItem& item); |
| 28 ~DrawingDisplayItem() override; | 22 ~DrawingDisplayItem() override; |
| 29 | 23 |
| 30 void Raster(SkCanvas* canvas, | |
| 31 SkPicture::AbortCallback* callback) const override; | |
| 32 | |
| 33 size_t ExternalMemoryUsage() const; | 24 size_t ExternalMemoryUsage() const; |
| 34 int ApproximateOpCount() const; | 25 int ApproximateOpCount() const; |
| 35 | 26 |
| 36 void CloneTo(DrawingDisplayItem* item) const; | 27 const sk_sp<const PaintRecord> picture; |
| 37 | |
| 38 const PaintRecord& picture() const { return *picture_; } | |
| 39 | |
| 40 private: | |
| 41 void SetNew(sk_sp<const PaintRecord> record); | |
| 42 | |
| 43 sk_sp<const PaintRecord> picture_; | |
| 44 }; | 28 }; |
| 45 | 29 |
| 46 } // namespace cc | 30 } // namespace cc |
| 47 | 31 |
| 48 #endif // CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ | 32 #endif // CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ |
| OLD | NEW |