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_FILTER_DISPLAY_ITEM_H_ | 5 #ifndef CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ |
6 #define CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ | 6 #define CC_PLAYBACK_FILTER_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 "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
14 #include "cc/output/filter_operations.h" | 14 #include "cc/output/filter_operations.h" |
15 #include "cc/playback/display_item.h" | 15 #include "cc/playback/display_item.h" |
16 #include "ui/gfx/geometry/rect_f.h" | 16 #include "ui/gfx/geometry/rect_f.h" |
17 | 17 |
18 class SkCanvas; | 18 class SkCanvas; |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
21 class ImageSerializationProcessor; | |
22 | 21 |
23 class CC_EXPORT FilterDisplayItem : public DisplayItem { | 22 class CC_EXPORT FilterDisplayItem : public DisplayItem { |
24 public: | 23 public: |
25 FilterDisplayItem(const FilterOperations& filters, const gfx::RectF& bounds); | 24 FilterDisplayItem(const FilterOperations& filters, const gfx::RectF& bounds); |
26 explicit FilterDisplayItem(const proto::DisplayItem& proto); | 25 explicit FilterDisplayItem(const proto::DisplayItem& proto); |
27 ~FilterDisplayItem() override; | 26 ~FilterDisplayItem() override; |
28 | 27 |
29 void ToProtobuf(proto::DisplayItem* proto, | 28 void ToProtobuf(proto::DisplayItem* proto) const override; |
30 ImageSerializationProcessor* image_serialization_processor) | |
31 const override; | |
32 void Raster(SkCanvas* canvas, | 29 void Raster(SkCanvas* canvas, |
33 const gfx::Rect& canvas_target_playback_rect, | 30 const gfx::Rect& canvas_target_playback_rect, |
34 SkPicture::AbortCallback* callback) const override; | 31 SkPicture::AbortCallback* callback) const override; |
35 void AsValueInto(const gfx::Rect& visual_rect, | 32 void AsValueInto(const gfx::Rect& visual_rect, |
36 base::trace_event::TracedValue* array) const override; | 33 base::trace_event::TracedValue* array) const override; |
37 size_t ExternalMemoryUsage() const override; | 34 size_t ExternalMemoryUsage() const override; |
38 | 35 |
39 int ApproximateOpCount() const { return 1; } | 36 int ApproximateOpCount() const { return 1; } |
40 | 37 |
41 private: | 38 private: |
42 void SetNew(const FilterOperations& filters, const gfx::RectF& bounds); | 39 void SetNew(const FilterOperations& filters, const gfx::RectF& bounds); |
43 | 40 |
44 FilterOperations filters_; | 41 FilterOperations filters_; |
45 gfx::RectF bounds_; | 42 gfx::RectF bounds_; |
46 }; | 43 }; |
47 | 44 |
48 class CC_EXPORT EndFilterDisplayItem : public DisplayItem { | 45 class CC_EXPORT EndFilterDisplayItem : public DisplayItem { |
49 public: | 46 public: |
50 EndFilterDisplayItem(); | 47 EndFilterDisplayItem(); |
51 explicit EndFilterDisplayItem(const proto::DisplayItem& proto); | 48 explicit EndFilterDisplayItem(const proto::DisplayItem& proto); |
52 ~EndFilterDisplayItem() override; | 49 ~EndFilterDisplayItem() override; |
53 | 50 |
54 static std::unique_ptr<EndFilterDisplayItem> Create() { | 51 static std::unique_ptr<EndFilterDisplayItem> Create() { |
55 return base::WrapUnique(new EndFilterDisplayItem()); | 52 return base::WrapUnique(new EndFilterDisplayItem()); |
56 } | 53 } |
57 | 54 |
58 void ToProtobuf(proto::DisplayItem* proto, | 55 void ToProtobuf(proto::DisplayItem* proto) const override; |
59 ImageSerializationProcessor* image_serialization_processor) | |
60 const override; | |
61 void Raster(SkCanvas* canvas, | 56 void Raster(SkCanvas* canvas, |
62 const gfx::Rect& canvas_target_playback_rect, | 57 const gfx::Rect& canvas_target_playback_rect, |
63 SkPicture::AbortCallback* callback) const override; | 58 SkPicture::AbortCallback* callback) const override; |
64 void AsValueInto(const gfx::Rect& visual_rect, | 59 void AsValueInto(const gfx::Rect& visual_rect, |
65 base::trace_event::TracedValue* array) const override; | 60 base::trace_event::TracedValue* array) const override; |
66 size_t ExternalMemoryUsage() const override; | 61 size_t ExternalMemoryUsage() const override; |
67 | 62 |
68 int ApproximateOpCount() const { return 0; } | 63 int ApproximateOpCount() const { return 0; } |
69 }; | 64 }; |
70 | 65 |
71 } // namespace cc | 66 } // namespace cc |
72 | 67 |
73 #endif // CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ | 68 #endif // CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ |
OLD | NEW |