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 PaintCanvas; |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
21 | 21 |
22 class CC_EXPORT FilterDisplayItem : public DisplayItem { | 22 class CC_EXPORT FilterDisplayItem : public DisplayItem { |
23 public: | 23 public: |
24 FilterDisplayItem(const FilterOperations& filters, | 24 FilterDisplayItem(const FilterOperations& filters, |
25 const gfx::RectF& bounds, | 25 const gfx::RectF& bounds, |
26 const gfx::PointF& origin); | 26 const gfx::PointF& origin); |
27 explicit FilterDisplayItem(const proto::DisplayItem& proto); | 27 explicit FilterDisplayItem(const proto::DisplayItem& proto); |
28 ~FilterDisplayItem() override; | 28 ~FilterDisplayItem() override; |
29 | 29 |
30 void ToProtobuf(proto::DisplayItem* proto) const override; | 30 void ToProtobuf(proto::DisplayItem* proto) const override; |
31 void Raster(SkCanvas* canvas, | 31 void Raster(PaintCanvas* canvas, |
32 SkPicture::AbortCallback* callback) const override; | 32 PaintRecord::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 | 35 |
36 size_t ExternalMemoryUsage() const { | 36 size_t ExternalMemoryUsage() const { |
37 // FilterOperations doesn't expose its capacity, but size is probably good | 37 // FilterOperations doesn't expose its capacity, but size is probably good |
38 // enough. | 38 // enough. |
39 return filters_.size() * sizeof(filters_.at(0)); | 39 return filters_.size() * sizeof(filters_.at(0)); |
40 } | 40 } |
41 int ApproximateOpCount() const { return 1; } | 41 int ApproximateOpCount() const { return 1; } |
42 | 42 |
(...skipping 11 matching lines...) Expand all Loading... |
54 public: | 54 public: |
55 EndFilterDisplayItem(); | 55 EndFilterDisplayItem(); |
56 explicit EndFilterDisplayItem(const proto::DisplayItem& proto); | 56 explicit EndFilterDisplayItem(const proto::DisplayItem& proto); |
57 ~EndFilterDisplayItem() override; | 57 ~EndFilterDisplayItem() override; |
58 | 58 |
59 static std::unique_ptr<EndFilterDisplayItem> Create() { | 59 static std::unique_ptr<EndFilterDisplayItem> Create() { |
60 return base::MakeUnique<EndFilterDisplayItem>(); | 60 return base::MakeUnique<EndFilterDisplayItem>(); |
61 } | 61 } |
62 | 62 |
63 void ToProtobuf(proto::DisplayItem* proto) const override; | 63 void ToProtobuf(proto::DisplayItem* proto) const override; |
64 void Raster(SkCanvas* canvas, | 64 void Raster(PaintCanvas* canvas, |
65 SkPicture::AbortCallback* callback) const override; | 65 PaintRecord::AbortCallback* callback) const override; |
66 void AsValueInto(const gfx::Rect& visual_rect, | 66 void AsValueInto(const gfx::Rect& visual_rect, |
67 base::trace_event::TracedValue* array) const override; | 67 base::trace_event::TracedValue* array) const override; |
68 | 68 |
69 int ApproximateOpCount() const { return 0; } | 69 int ApproximateOpCount() const { return 0; } |
70 }; | 70 }; |
71 | 71 |
72 } // namespace cc | 72 } // namespace cc |
73 | 73 |
74 #endif // CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ | 74 #endif // CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ |
OLD | NEW |