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