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 SkPicture::AbortCallback* callback) const override; | 30 SkPicture::AbortCallback* callback) const override; |
34 void AsValueInto(const gfx::Rect& visual_rect, | 31 void AsValueInto(const gfx::Rect& visual_rect, |
35 base::trace_event::TracedValue* array) const override; | 32 base::trace_event::TracedValue* array) const override; |
36 size_t ExternalMemoryUsage() const override; | 33 size_t ExternalMemoryUsage() const override; |
37 | 34 |
38 int ApproximateOpCount() const { return 1; } | 35 int ApproximateOpCount() const { return 1; } |
39 | 36 |
40 private: | 37 private: |
41 void SetNew(const FilterOperations& filters, const gfx::RectF& bounds); | 38 void SetNew(const FilterOperations& filters, const gfx::RectF& bounds); |
42 | 39 |
43 FilterOperations filters_; | 40 FilterOperations filters_; |
44 gfx::RectF bounds_; | 41 gfx::RectF bounds_; |
45 }; | 42 }; |
46 | 43 |
47 class CC_EXPORT EndFilterDisplayItem : public DisplayItem { | 44 class CC_EXPORT EndFilterDisplayItem : public DisplayItem { |
48 public: | 45 public: |
49 EndFilterDisplayItem(); | 46 EndFilterDisplayItem(); |
50 explicit EndFilterDisplayItem(const proto::DisplayItem& proto); | 47 explicit EndFilterDisplayItem(const proto::DisplayItem& proto); |
51 ~EndFilterDisplayItem() override; | 48 ~EndFilterDisplayItem() override; |
52 | 49 |
53 static std::unique_ptr<EndFilterDisplayItem> Create() { | 50 static std::unique_ptr<EndFilterDisplayItem> Create() { |
54 return base::WrapUnique(new EndFilterDisplayItem()); | 51 return base::WrapUnique(new EndFilterDisplayItem()); |
55 } | 52 } |
56 | 53 |
57 void ToProtobuf(proto::DisplayItem* proto, | 54 void ToProtobuf(proto::DisplayItem* proto) const override; |
58 ImageSerializationProcessor* image_serialization_processor) | |
59 const override; | |
60 void Raster(SkCanvas* canvas, | 55 void Raster(SkCanvas* canvas, |
61 SkPicture::AbortCallback* callback) const override; | 56 SkPicture::AbortCallback* callback) const override; |
62 void AsValueInto(const gfx::Rect& visual_rect, | 57 void AsValueInto(const gfx::Rect& visual_rect, |
63 base::trace_event::TracedValue* array) const override; | 58 base::trace_event::TracedValue* array) const override; |
64 size_t ExternalMemoryUsage() const override; | 59 size_t ExternalMemoryUsage() const override; |
65 | 60 |
66 int ApproximateOpCount() const { return 0; } | 61 int ApproximateOpCount() const { return 0; } |
67 }; | 62 }; |
68 | 63 |
69 } // namespace cc | 64 } // namespace cc |
70 | 65 |
71 #endif // CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ | 66 #endif // CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ |
OLD | NEW |