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