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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "cc/base/cc_export.h" | 13 #include "cc/base/cc_export.h" |
14 #include "cc/playback/display_item.h" | 14 #include "cc/playback/display_item.h" |
15 #include "third_party/skia/include/core/SkRRect.h" | 15 #include "third_party/skia/include/core/SkRRect.h" |
16 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
17 | 17 |
18 class SkCanvas; | 18 class SkCanvas; |
19 | 19 |
20 namespace cc { | 20 namespace cc { |
21 class ImageSerializationProcessor; | |
22 | 21 |
23 class CC_EXPORT ClipDisplayItem : public DisplayItem { | 22 class CC_EXPORT ClipDisplayItem : public DisplayItem { |
24 public: | 23 public: |
25 ClipDisplayItem(const gfx::Rect& clip_rect, | 24 ClipDisplayItem(const gfx::Rect& clip_rect, |
26 const std::vector<SkRRect>& rounded_clip_rects, | 25 const std::vector<SkRRect>& rounded_clip_rects, |
27 bool antialias); | 26 bool antialias); |
28 explicit ClipDisplayItem(const proto::DisplayItem& proto); | 27 explicit ClipDisplayItem(const proto::DisplayItem& proto); |
29 ~ClipDisplayItem() override; | 28 ~ClipDisplayItem() override; |
30 | 29 |
31 void ToProtobuf(proto::DisplayItem* proto, | 30 void ToProtobuf(proto::DisplayItem* proto) const override; |
32 ImageSerializationProcessor* image_serialization_processor) | |
33 const override; | |
34 void Raster(SkCanvas* canvas, | 31 void Raster(SkCanvas* canvas, |
35 SkPicture::AbortCallback* callback) const override; | 32 SkPicture::AbortCallback* callback) const override; |
36 void AsValueInto(const gfx::Rect& visual_rect, | 33 void AsValueInto(const gfx::Rect& visual_rect, |
37 base::trace_event::TracedValue* array) const override; | 34 base::trace_event::TracedValue* array) const override; |
38 size_t ExternalMemoryUsage() const override; | 35 size_t ExternalMemoryUsage() const override; |
39 | 36 |
40 int ApproximateOpCount() const { return 1; } | 37 int ApproximateOpCount() const { return 1; } |
41 | 38 |
42 private: | 39 private: |
43 void SetNew(const gfx::Rect& clip_rect, | 40 void SetNew(const gfx::Rect& clip_rect, |
44 const std::vector<SkRRect>& rounded_clip_rects, | 41 const std::vector<SkRRect>& rounded_clip_rects, |
45 bool antialias); | 42 bool antialias); |
46 | 43 |
47 gfx::Rect clip_rect_; | 44 gfx::Rect clip_rect_; |
48 std::vector<SkRRect> rounded_clip_rects_; | 45 std::vector<SkRRect> rounded_clip_rects_; |
49 bool antialias_; | 46 bool antialias_; |
50 }; | 47 }; |
51 | 48 |
52 class CC_EXPORT EndClipDisplayItem : public DisplayItem { | 49 class CC_EXPORT EndClipDisplayItem : public DisplayItem { |
53 public: | 50 public: |
54 EndClipDisplayItem(); | 51 EndClipDisplayItem(); |
55 explicit EndClipDisplayItem(const proto::DisplayItem& proto); | 52 explicit EndClipDisplayItem(const proto::DisplayItem& proto); |
56 ~EndClipDisplayItem() override; | 53 ~EndClipDisplayItem() override; |
57 | 54 |
58 void ToProtobuf(proto::DisplayItem* proto, | 55 void ToProtobuf(proto::DisplayItem* proto) const override; |
59 ImageSerializationProcessor* image_serialization_processor) | |
60 const override; | |
61 void Raster(SkCanvas* canvas, | 56 void Raster(SkCanvas* canvas, |
62 SkPicture::AbortCallback* callback) const override; | 57 SkPicture::AbortCallback* callback) const override; |
63 void AsValueInto(const gfx::Rect& visual_rect, | 58 void AsValueInto(const gfx::Rect& visual_rect, |
64 base::trace_event::TracedValue* array) const override; | 59 base::trace_event::TracedValue* array) const override; |
65 size_t ExternalMemoryUsage() const override; | 60 size_t ExternalMemoryUsage() const override; |
66 | 61 |
67 int ApproximateOpCount() const { return 0; } | 62 int ApproximateOpCount() const { return 0; } |
68 }; | 63 }; |
69 | 64 |
70 } // namespace cc | 65 } // namespace cc |
71 | 66 |
72 #endif // CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_ | 67 #endif // CC_PLAYBACK_CLIP_DISPLAY_ITEM_H_ |
OLD | NEW |