OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkRasterClip_DEFINED | 8 #ifndef SkRasterClip_DEFINED |
9 #define SkRasterClip_DEFINED | 9 #define SkRasterClip_DEFINED |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 SkASSERT(this->computeIsRect() == fIsRect); | 32 SkASSERT(this->computeIsRect() == fIsRect); |
33 return fIsRect; | 33 return fIsRect; |
34 } | 34 } |
35 | 35 |
36 bool isComplex() const; | 36 bool isComplex() const; |
37 const SkIRect& getBounds() const; | 37 const SkIRect& getBounds() const; |
38 | 38 |
39 bool setEmpty(); | 39 bool setEmpty(); |
40 bool setRect(const SkIRect&); | 40 bool setRect(const SkIRect&); |
41 | 41 |
42 bool setPath(const SkPath& path, const SkRegion& clip, bool doAA); | |
43 bool setPath(const SkPath& path, const SkIRect& clip, bool doAA); | |
44 | |
45 bool op(const SkIRect&, SkRegion::Op); | 42 bool op(const SkIRect&, SkRegion::Op); |
46 bool op(const SkRegion&, SkRegion::Op); | 43 bool op(const SkRegion&, SkRegion::Op); |
47 bool op(const SkRasterClip&, SkRegion::Op); | |
48 bool op(const SkRect&, SkRegion::Op, bool doAA); | 44 bool op(const SkRect&, SkRegion::Op, bool doAA); |
49 | 45 bool op(const SkPath&, const SkISize&, SkRegion::Op, bool doAA); |
| 46 |
50 void translate(int dx, int dy, SkRasterClip* dst) const; | 47 void translate(int dx, int dy, SkRasterClip* dst) const; |
51 void translate(int dx, int dy) { | 48 void translate(int dx, int dy) { |
52 this->translate(dx, dy, this); | 49 this->translate(dx, dy, this); |
53 } | 50 } |
54 | 51 |
55 bool quickContains(const SkIRect& rect) const; | 52 bool quickContains(const SkIRect& rect) const; |
56 bool quickContains(int left, int top, int right, int bottom) const { | 53 bool quickContains(int left, int top, int right, int bottom) const { |
57 return quickContains(SkIRect::MakeLTRB(left, top, right, bottom)); | 54 return quickContains(SkIRect::MakeLTRB(left, top, right, bottom)); |
58 } | 55 } |
59 | 56 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 fBW.setRect(fAA.getBounds()); | 97 fBW.setRect(fAA.getBounds()); |
101 fAA.setEmpty(); // don't need this guy anymore | 98 fAA.setEmpty(); // don't need this guy anymore |
102 fIsBW = true; | 99 fIsBW = true; |
103 } | 100 } |
104 | 101 |
105 fIsRect = this->computeIsRect(); | 102 fIsRect = this->computeIsRect(); |
106 return !fIsEmpty; | 103 return !fIsEmpty; |
107 } | 104 } |
108 | 105 |
109 void convertToAA(); | 106 void convertToAA(); |
| 107 |
| 108 bool setPath(const SkPath& path, const SkRegion& clip, bool doAA); |
| 109 bool setPath(const SkPath& path, const SkIRect& clip, bool doAA); |
| 110 bool op(const SkRasterClip&, SkRegion::Op); |
110 }; | 111 }; |
111 | 112 |
112 class SkAutoRasterClipValidate : SkNoncopyable { | 113 class SkAutoRasterClipValidate : SkNoncopyable { |
113 public: | 114 public: |
114 SkAutoRasterClipValidate(const SkRasterClip& rc) : fRC(rc) { | 115 SkAutoRasterClipValidate(const SkRasterClip& rc) : fRC(rc) { |
115 fRC.validate(); | 116 fRC.validate(); |
116 } | 117 } |
117 ~SkAutoRasterClipValidate() { | 118 ~SkAutoRasterClipValidate() { |
118 fRC.validate(); | 119 fRC.validate(); |
119 } | 120 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 163 |
163 private: | 164 private: |
164 SkRegion fBWRgn; | 165 SkRegion fBWRgn; |
165 SkAAClipBlitter fAABlitter; | 166 SkAAClipBlitter fAABlitter; |
166 // what we return | 167 // what we return |
167 const SkRegion* fClipRgn; | 168 const SkRegion* fClipRgn; |
168 SkBlitter* fBlitter; | 169 SkBlitter* fBlitter; |
169 }; | 170 }; |
170 | 171 |
171 #endif | 172 #endif |
OLD | NEW |