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_CLIP_DISPLAY_ITEM_H_ | 5 #ifndef CC_PAINT_CLIP_DISPLAY_ITEM_H_ |
6 #define CC_PAINT_CLIP_DISPLAY_ITEM_H_ | 6 #define CC_PAINT_CLIP_DISPLAY_ITEM_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "cc/paint/display_item.h" | 12 #include "cc/paint/display_item.h" |
13 #include "cc/paint/paint_export.h" | 13 #include "cc/paint/paint_export.h" |
14 #include "third_party/skia/include/core/SkRRect.h" | 14 #include "third_party/skia/include/core/SkRRect.h" |
15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
16 | 16 |
17 namespace cc { | 17 namespace cc { |
18 | 18 |
19 class CC_PAINT_EXPORT ClipDisplayItem : public DisplayItem { | 19 class CC_PAINT_EXPORT ClipDisplayItem : public DisplayItem { |
20 public: | 20 public: |
21 ClipDisplayItem(const gfx::Rect& clip_rect, | 21 ClipDisplayItem(const gfx::Rect& clip_rect, |
22 std::vector<SkRRect> rounded_clip_rects, | 22 std::vector<SkRRect> rounded_clip_rects, |
23 bool antialias); | 23 bool antialias); |
24 ~ClipDisplayItem() override; | 24 ~ClipDisplayItem() override; |
25 | 25 |
26 size_t ExternalMemoryUsage() const { | 26 size_t ExternalMemoryUsage() const { |
27 return rounded_clip_rects.capacity() * sizeof(rounded_clip_rects[0]); | 27 return rounded_clip_rects.capacity() * sizeof(rounded_clip_rects[0]); |
28 } | 28 } |
29 int ApproximateOpCount() const { return 1; } | 29 int OpCount() const { return 1; } |
30 | 30 |
31 const gfx::Rect clip_rect; | 31 const gfx::Rect clip_rect; |
32 const std::vector<SkRRect> rounded_clip_rects; | 32 const std::vector<SkRRect> rounded_clip_rects; |
33 const bool antialias; | 33 const bool antialias; |
34 }; | 34 }; |
35 | 35 |
36 class CC_PAINT_EXPORT EndClipDisplayItem : public DisplayItem { | 36 class CC_PAINT_EXPORT EndClipDisplayItem : public DisplayItem { |
37 public: | 37 public: |
38 EndClipDisplayItem(); | 38 EndClipDisplayItem(); |
39 ~EndClipDisplayItem() override; | 39 ~EndClipDisplayItem() override; |
40 | 40 |
41 int ApproximateOpCount() const { return 0; } | 41 int OpCount() const { return 0; } |
42 }; | 42 }; |
43 | 43 |
44 } // namespace cc | 44 } // namespace cc |
45 | 45 |
46 #endif // CC_PAINT_CLIP_DISPLAY_ITEM_H_ | 46 #endif // CC_PAINT_CLIP_DISPLAY_ITEM_H_ |
OLD | NEW |