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 "skia/ext/refptr.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 | 20 |
21 class CC_EXPORT DrawingDisplayItem : public DisplayItem { | 21 class CC_EXPORT DrawingDisplayItem : public DisplayItem { |
22 public: | 22 public: |
23 DrawingDisplayItem(); | 23 DrawingDisplayItem(); |
24 explicit DrawingDisplayItem(skia::RefPtr<SkPicture> picture); | 24 explicit DrawingDisplayItem(skia::RefPtr<const SkPicture> picture); |
25 explicit DrawingDisplayItem(const proto::DisplayItem& proto); | 25 explicit DrawingDisplayItem(const proto::DisplayItem& proto); |
26 explicit DrawingDisplayItem(const DrawingDisplayItem& item); | 26 explicit DrawingDisplayItem(const DrawingDisplayItem& item); |
27 ~DrawingDisplayItem() override; | 27 ~DrawingDisplayItem() override; |
28 | 28 |
29 void ToProtobuf(proto::DisplayItem* proto) const override; | 29 void ToProtobuf(proto::DisplayItem* proto) const override; |
30 void Raster(SkCanvas* canvas, | 30 void Raster(SkCanvas* canvas, |
31 const gfx::Rect& canvas_playback_rect, | 31 const gfx::Rect& canvas_playback_rect, |
32 SkPicture::AbortCallback* callback) const override; | 32 SkPicture::AbortCallback* callback) const override; |
33 void AsValueInto(const gfx::Rect& visual_rect, | 33 void AsValueInto(const gfx::Rect& visual_rect, |
34 base::trace_event::TracedValue* array) const override; | 34 base::trace_event::TracedValue* array) const override; |
35 size_t ExternalMemoryUsage() const override; | 35 size_t ExternalMemoryUsage() const override; |
36 | 36 |
37 int ApproximateOpCount() const; | 37 int ApproximateOpCount() const; |
38 bool IsSuitableForGpuRasterization() const; | 38 bool IsSuitableForGpuRasterization() const; |
39 | 39 |
40 void CloneTo(DrawingDisplayItem* item) const; | 40 void CloneTo(DrawingDisplayItem* item) const; |
41 | 41 |
42 private: | 42 private: |
43 void SetNew(skia::RefPtr<SkPicture> picture); | 43 void SetNew(skia::RefPtr<const SkPicture> picture); |
44 | 44 |
45 skia::RefPtr<SkPicture> picture_; | 45 skia::RefPtr<const SkPicture> picture_; |
46 }; | 46 }; |
47 | 47 |
48 } // namespace cc | 48 } // namespace cc |
49 | 49 |
50 #endif // CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ | 50 #endif // CC_PLAYBACK_DRAWING_DISPLAY_ITEM_H_ |
OLD | NEW |