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 ClipList_h | 5 #ifndef ClipList_h |
6 #define ClipList_h | 6 #define ClipList_h |
7 | 7 |
8 #include "platform/graphics/GraphicsTypes.h" | 8 #include "platform/graphics/GraphicsTypes.h" |
| 9 #include "wtf/Allocator.h" |
9 #include "wtf/Vector.h" | 10 #include "wtf/Vector.h" |
10 | 11 |
11 class SkCanvas; | 12 class SkCanvas; |
12 class SkPath; | 13 class SkPath; |
13 | 14 |
14 namespace blink { | 15 namespace blink { |
15 | 16 |
16 class AffineTransform; | 17 class AffineTransform; |
17 | 18 |
18 class ClipList { | 19 class ClipList { |
| 20 DISALLOW_ALLOCATION(); |
19 public: | 21 public: |
20 ClipList() { } | 22 ClipList() { } |
21 ClipList(const ClipList&); | 23 ClipList(const ClipList&); |
22 ~ClipList() { } | 24 ~ClipList() { } |
23 | 25 |
24 void clipPath(const SkPath&, AntiAliasingMode, const SkMatrix&); | 26 void clipPath(const SkPath&, AntiAliasingMode, const SkMatrix&); |
25 void playback(SkCanvas*) const; | 27 void playback(SkCanvas*) const; |
26 | 28 |
27 private: | 29 private: |
28 | 30 |
29 struct ClipOp { | 31 struct ClipOp { |
30 SkPath m_path; | 32 SkPath m_path; |
31 AntiAliasingMode m_antiAliasingMode; | 33 AntiAliasingMode m_antiAliasingMode; |
32 | 34 |
33 ClipOp(); | 35 ClipOp(); |
34 ClipOp(const ClipOp&); | 36 ClipOp(const ClipOp&); |
35 }; | 37 }; |
36 | 38 |
37 // Number of clip ops that can be stored in a ClipList without resorting to
dynamic allocation | 39 // Number of clip ops that can be stored in a ClipList without resorting to
dynamic allocation |
38 static const size_t cInlineClipOpCapacity = 4; | 40 static const size_t cInlineClipOpCapacity = 4; |
39 | 41 |
40 WTF::Vector<ClipOp, cInlineClipOpCapacity> m_clipList; | 42 WTF::Vector<ClipOp, cInlineClipOpCapacity> m_clipList; |
41 }; | 43 }; |
42 | 44 |
43 } // namespace blink | 45 } // namespace blink |
44 | 46 |
45 #endif | 47 #endif |
OLD | NEW |