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