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