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 13 matching lines...) Expand all Loading... |
24 public: | 24 public: |
25 ClipDisplayItem(const gfx::Rect& clip_rect, | 25 ClipDisplayItem(const gfx::Rect& clip_rect, |
26 const std::vector<SkRRect>& rounded_clip_rects); | 26 const std::vector<SkRRect>& rounded_clip_rects); |
27 explicit ClipDisplayItem(const proto::DisplayItem& proto); | 27 explicit ClipDisplayItem(const proto::DisplayItem& proto); |
28 ~ClipDisplayItem() override; | 28 ~ClipDisplayItem() override; |
29 | 29 |
30 void ToProtobuf(proto::DisplayItem* proto, | 30 void ToProtobuf(proto::DisplayItem* proto, |
31 ImageSerializationProcessor* image_serialization_processor) | 31 ImageSerializationProcessor* image_serialization_processor) |
32 const override; | 32 const override; |
33 void Raster(SkCanvas* canvas, | 33 void Raster(SkCanvas* canvas, |
34 const gfx::Rect& canvas_target_playback_rect, | |
35 SkPicture::AbortCallback* callback) const override; | 34 SkPicture::AbortCallback* callback) const override; |
36 void AsValueInto(const gfx::Rect& visual_rect, | 35 void AsValueInto(const gfx::Rect& visual_rect, |
37 base::trace_event::TracedValue* array) const override; | 36 base::trace_event::TracedValue* array) const override; |
38 size_t ExternalMemoryUsage() const override; | 37 size_t ExternalMemoryUsage() const override; |
39 | 38 |
40 int ApproximateOpCount() const { return 1; } | 39 int ApproximateOpCount() const { return 1; } |
41 | 40 |
42 private: | 41 private: |
43 void SetNew(const gfx::Rect& clip_rect, | 42 void SetNew(const gfx::Rect& clip_rect, |
44 const std::vector<SkRRect>& rounded_clip_rects); | 43 const std::vector<SkRRect>& rounded_clip_rects); |
45 | 44 |
46 gfx::Rect clip_rect_; | 45 gfx::Rect clip_rect_; |
47 std::vector<SkRRect> rounded_clip_rects_; | 46 std::vector<SkRRect> rounded_clip_rects_; |
48 }; | 47 }; |
49 | 48 |
50 class CC_EXPORT EndClipDisplayItem : public DisplayItem { | 49 class CC_EXPORT EndClipDisplayItem : public DisplayItem { |
51 public: | 50 public: |
52 EndClipDisplayItem(); | 51 EndClipDisplayItem(); |
53 explicit EndClipDisplayItem(const proto::DisplayItem& proto); | 52 explicit EndClipDisplayItem(const proto::DisplayItem& proto); |
54 ~EndClipDisplayItem() override; | 53 ~EndClipDisplayItem() override; |
55 | 54 |
56 void ToProtobuf(proto::DisplayItem* proto, | 55 void ToProtobuf(proto::DisplayItem* proto, |
57 ImageSerializationProcessor* image_serialization_processor) | 56 ImageSerializationProcessor* image_serialization_processor) |
58 const override; | 57 const override; |
59 void Raster(SkCanvas* canvas, | 58 void Raster(SkCanvas* canvas, |
60 const gfx::Rect& canvas_target_playback_rect, | |
61 SkPicture::AbortCallback* callback) const override; | 59 SkPicture::AbortCallback* callback) const override; |
62 void AsValueInto(const gfx::Rect& visual_rect, | 60 void AsValueInto(const gfx::Rect& visual_rect, |
63 base::trace_event::TracedValue* array) const override; | 61 base::trace_event::TracedValue* array) const override; |
64 size_t ExternalMemoryUsage() const override; | 62 size_t ExternalMemoryUsage() const override; |
65 | 63 |
66 int ApproximateOpCount() const { return 0; } | 64 int ApproximateOpCount() const { return 0; } |
67 }; | 65 }; |
68 | 66 |
69 } // namespace cc | 67 } // namespace cc |
70 | 68 |
71 #endif // CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_ | 69 #endif // CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_ |
OLD | NEW |