| 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> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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 ~FilterDisplayItem() override; | 27 ~FilterDisplayItem() override; |
| 28 | 28 |
| 29 void Raster(SkCanvas* canvas, | 29 void Raster(SkCanvas* canvas, |
| 30 SkPicture::AbortCallback* callback) const override; | 30 SkPicture::AbortCallback* callback) const override; |
| 31 void AsValueInto(const gfx::Rect& visual_rect, | |
| 32 base::trace_event::TracedValue* array) const override; | |
| 33 | 31 |
| 34 size_t ExternalMemoryUsage() const { | 32 size_t ExternalMemoryUsage() const { |
| 35 // FilterOperations doesn't expose its capacity, but size is probably good | 33 // FilterOperations doesn't expose its capacity, but size is probably good |
| 36 // enough. | 34 // enough. |
| 37 return filters_.size() * sizeof(filters_.at(0)); | 35 return filters_.size() * sizeof(filters_.at(0)); |
| 38 } | 36 } |
| 39 int ApproximateOpCount() const { return 1; } | 37 int ApproximateOpCount() const { return 1; } |
| 40 | 38 |
| 39 const gfx::RectF& bounds() const { return bounds_; } |
| 40 |
| 41 private: | 41 private: |
| 42 void SetNew(const FilterOperations& filters, | 42 void SetNew(const FilterOperations& filters, |
| 43 const gfx::RectF& bounds, | 43 const gfx::RectF& bounds, |
| 44 const gfx::PointF& origin); | 44 const gfx::PointF& origin); |
| 45 | 45 |
| 46 FilterOperations filters_; | 46 FilterOperations filters_; |
| 47 gfx::RectF bounds_; | 47 gfx::RectF bounds_; |
| 48 gfx::PointF origin_; | 48 gfx::PointF origin_; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class CC_EXPORT EndFilterDisplayItem : public DisplayItem { | 51 class CC_EXPORT EndFilterDisplayItem : public DisplayItem { |
| 52 public: | 52 public: |
| 53 EndFilterDisplayItem(); | 53 EndFilterDisplayItem(); |
| 54 ~EndFilterDisplayItem() override; | 54 ~EndFilterDisplayItem() override; |
| 55 | 55 |
| 56 static std::unique_ptr<EndFilterDisplayItem> Create() { | 56 static std::unique_ptr<EndFilterDisplayItem> Create() { |
| 57 return base::MakeUnique<EndFilterDisplayItem>(); | 57 return base::MakeUnique<EndFilterDisplayItem>(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void Raster(SkCanvas* canvas, | 60 void Raster(SkCanvas* canvas, |
| 61 SkPicture::AbortCallback* callback) const override; | 61 SkPicture::AbortCallback* callback) const override; |
| 62 void AsValueInto(const gfx::Rect& visual_rect, | |
| 63 base::trace_event::TracedValue* array) const override; | |
| 64 | 62 |
| 65 int ApproximateOpCount() const { return 0; } | 63 int ApproximateOpCount() const { return 0; } |
| 66 }; | 64 }; |
| 67 | 65 |
| 68 } // namespace cc | 66 } // namespace cc |
| 69 | 67 |
| 70 #endif // CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ | 68 #endif // CC_PLAYBACK_FILTER_DISPLAY_ITEM_H_ |
| OLD | NEW |