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