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_PAINT_FILTER_DISPLAY_ITEM_H_ | 5 #ifndef CC_PAINT_FILTER_DISPLAY_ITEM_H_ |
6 #define CC_PAINT_FILTER_DISPLAY_ITEM_H_ | 6 #define CC_PAINT_FILTER_DISPLAY_ITEM_H_ |
7 | 7 |
8 #include "cc/base/filter_operations.h" | 8 #include "cc/base/filter_operations.h" |
9 #include "cc/paint/display_item.h" | 9 #include "cc/paint/display_item.h" |
10 #include "cc/paint/paint_export.h" | 10 #include "cc/paint/paint_export.h" |
11 #include "ui/gfx/geometry/point_f.h" | 11 #include "ui/gfx/geometry/point_f.h" |
12 #include "ui/gfx/geometry/rect_f.h" | 12 #include "ui/gfx/geometry/rect_f.h" |
13 | 13 |
14 namespace cc { | 14 namespace cc { |
15 | 15 |
16 class CC_PAINT_EXPORT FilterDisplayItem : public DisplayItem { | 16 class CC_PAINT_EXPORT FilterDisplayItem : public DisplayItem { |
17 public: | 17 public: |
18 FilterDisplayItem(const FilterOperations& filters, | 18 FilterDisplayItem(const FilterOperations& filters, |
19 const gfx::RectF& bounds, | 19 const gfx::RectF& bounds, |
20 const gfx::PointF& origin); | 20 const gfx::PointF& origin); |
21 ~FilterDisplayItem() override; | 21 ~FilterDisplayItem() override; |
22 | 22 |
23 size_t ExternalMemoryUsage() const { | 23 size_t ExternalMemoryUsage() const { |
24 // FilterOperations doesn't expose its capacity, but size is probably good | 24 // FilterOperations doesn't expose its capacity, but size is probably good |
25 // enough. | 25 // enough. |
26 return filters.size() * sizeof(filters.at(0)); | 26 return filters.size() * sizeof(filters.at(0)); |
27 } | 27 } |
28 int ApproximateOpCount() const { return 1; } | 28 int OpCount() const { return 1; } |
29 | 29 |
30 const FilterOperations filters; | 30 const FilterOperations filters; |
31 const gfx::RectF bounds; | 31 const gfx::RectF bounds; |
32 const gfx::PointF origin; | 32 const gfx::PointF origin; |
33 }; | 33 }; |
34 | 34 |
35 class CC_PAINT_EXPORT EndFilterDisplayItem : public DisplayItem { | 35 class CC_PAINT_EXPORT EndFilterDisplayItem : public DisplayItem { |
36 public: | 36 public: |
37 EndFilterDisplayItem(); | 37 EndFilterDisplayItem(); |
38 ~EndFilterDisplayItem() override; | 38 ~EndFilterDisplayItem() override; |
39 | 39 |
40 int ApproximateOpCount() const { return 0; } | 40 int OpCount() const { return 0; } |
41 }; | 41 }; |
42 | 42 |
43 } // namespace cc | 43 } // namespace cc |
44 | 44 |
45 #endif // CC_PAINT_FILTER_DISPLAY_ITEM_H_ | 45 #endif // CC_PAINT_FILTER_DISPLAY_ITEM_H_ |
OLD | NEW |