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