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 |
11 #include "SkRegion.h" | 11 #include "SkRegion.h" |
12 #include "SkAAClip.h" | 12 #include "SkAAClip.h" |
13 | 13 |
14 class SkRRect; | 14 class SkRRect; |
15 | 15 |
16 class SkRasterClip { | 16 class SkRasterClip { |
17 public: | 17 public: |
18 SkRasterClip(bool forceConservativeRects = false); | 18 SkRasterClip(bool forceConservativeRects = false); |
19 SkRasterClip(const SkIRect&, bool forceConservativeRects = false); | 19 SkRasterClip(const SkIRect&, bool forceConservativeRects = false); |
| 20 SkRasterClip(const SkRegion&); |
20 SkRasterClip(const SkRasterClip&); | 21 SkRasterClip(const SkRasterClip&); |
21 ~SkRasterClip(); | 22 ~SkRasterClip(); |
22 | 23 |
| 24 // Only compares the current state. Does not compare isForceConservativeRect
s(), so that field |
| 25 // could be different but this could still return true. |
| 26 bool operator==(const SkRasterClip&) const; |
| 27 bool operator!=(const SkRasterClip& other) const { |
| 28 return !(*this == other); |
| 29 } |
| 30 |
23 bool isForceConservativeRects() const { return fForceConservativeRects; } | 31 bool isForceConservativeRects() const { return fForceConservativeRects; } |
24 | 32 |
25 bool isBW() const { return fIsBW; } | 33 bool isBW() const { return fIsBW; } |
26 bool isAA() const { return !fIsBW; } | 34 bool isAA() const { return !fIsBW; } |
27 const SkRegion& bwRgn() const { SkASSERT(fIsBW); return fBW; } | 35 const SkRegion& bwRgn() const { SkASSERT(fIsBW); return fBW; } |
28 const SkAAClip& aaRgn() const { SkASSERT(!fIsBW); return fAA; } | 36 const SkAAClip& aaRgn() const { SkASSERT(!fIsBW); return fAA; } |
29 | 37 |
30 bool isEmpty() const { | 38 bool isEmpty() const { |
31 SkASSERT(this->computeIsEmpty() == fIsEmpty); | 39 SkASSERT(this->computeIsEmpty() == fIsEmpty); |
32 return fIsEmpty; | 40 return fIsEmpty; |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 177 |
170 private: | 178 private: |
171 SkRegion fBWRgn; | 179 SkRegion fBWRgn; |
172 SkAAClipBlitter fAABlitter; | 180 SkAAClipBlitter fAABlitter; |
173 // what we return | 181 // what we return |
174 const SkRegion* fClipRgn; | 182 const SkRegion* fClipRgn; |
175 SkBlitter* fBlitter; | 183 SkBlitter* fBlitter; |
176 }; | 184 }; |
177 | 185 |
178 #endif | 186 #endif |
OLD | NEW |