| 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_CLIP_DISPLAY_ITEM_H_ | 5 #ifndef CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_ |
| 6 #define CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_ | 6 #define CC_PLAYBACK_CLIP_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 ClipDisplayItem : public DisplayItem { | 22 class CC_EXPORT ClipDisplayItem : public DisplayItem { |
| 23 public: | 23 public: |
| 24 ClipDisplayItem(const gfx::Rect& clip_rect, | 24 ClipDisplayItem(const gfx::Rect& clip_rect, |
| 25 const std::vector<SkRRect>& rounded_clip_rects, | 25 const std::vector<SkRRect>& rounded_clip_rects, |
| 26 bool antialias); | 26 bool antialias); |
| 27 ~ClipDisplayItem() override; | 27 ~ClipDisplayItem() 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 return rounded_clip_rects_.capacity() * sizeof(rounded_clip_rects_[0]); | 33 return rounded_clip_rects_.capacity() * sizeof(rounded_clip_rects_[0]); |
| 36 } | 34 } |
| 37 int ApproximateOpCount() const { return 1; } | 35 int ApproximateOpCount() const { return 1; } |
| 38 | 36 |
| 37 const gfx::Rect& clip_rect() const { return clip_rect_; } |
| 38 const std::vector<SkRRect>& rounded_clip_rects() const { |
| 39 return rounded_clip_rects_; |
| 40 } |
| 41 |
| 39 private: | 42 private: |
| 40 void SetNew(const gfx::Rect& clip_rect, | 43 void SetNew(const gfx::Rect& clip_rect, |
| 41 const std::vector<SkRRect>& rounded_clip_rects, | 44 const std::vector<SkRRect>& rounded_clip_rects, |
| 42 bool antialias); | 45 bool antialias); |
| 43 | 46 |
| 44 gfx::Rect clip_rect_; | 47 gfx::Rect clip_rect_; |
| 45 std::vector<SkRRect> rounded_clip_rects_; | 48 std::vector<SkRRect> rounded_clip_rects_; |
| 46 bool antialias_; | 49 bool antialias_; |
| 47 }; | 50 }; |
| 48 | 51 |
| 49 class CC_EXPORT EndClipDisplayItem : public DisplayItem { | 52 class CC_EXPORT EndClipDisplayItem : public DisplayItem { |
| 50 public: | 53 public: |
| 51 EndClipDisplayItem(); | 54 EndClipDisplayItem(); |
| 52 ~EndClipDisplayItem() override; | 55 ~EndClipDisplayItem() override; |
| 53 | 56 |
| 54 void Raster(SkCanvas* canvas, | 57 void Raster(SkCanvas* canvas, |
| 55 SkPicture::AbortCallback* callback) const override; | 58 SkPicture::AbortCallback* callback) const override; |
| 56 void AsValueInto(const gfx::Rect& visual_rect, | |
| 57 base::trace_event::TracedValue* array) const override; | |
| 58 | 59 |
| 59 int ApproximateOpCount() const { return 0; } | 60 int ApproximateOpCount() const { return 0; } |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 } // namespace cc | 63 } // namespace cc |
| 63 | 64 |
| 64 #endif // CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_ | 65 #endif // CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_ |
| OLD | NEW |