OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef SkAAClip_DEFINED | 9 #ifndef SkAAClip_DEFINED |
10 #define SkAAClip_DEFINED | 10 #define SkAAClip_DEFINED |
(...skipping 11 matching lines...) Expand all Loading... |
22 friend bool operator==(const SkAAClip&, const SkAAClip&); | 22 friend bool operator==(const SkAAClip&, const SkAAClip&); |
23 friend bool operator!=(const SkAAClip& a, const SkAAClip& b) { | 23 friend bool operator!=(const SkAAClip& a, const SkAAClip& b) { |
24 return !(a == b); | 24 return !(a == b); |
25 } | 25 } |
26 | 26 |
27 void swap(SkAAClip&); | 27 void swap(SkAAClip&); |
28 | 28 |
29 bool isEmpty() const { return NULL == fRunHead; } | 29 bool isEmpty() const { return NULL == fRunHead; } |
30 const SkIRect& getBounds() const { return fBounds; } | 30 const SkIRect& getBounds() const { return fBounds; } |
31 | 31 |
| 32 // Returns true iff the clip is not empty, and is just a hard-edged rect (no
partial alpha). |
| 33 // If true, getBounds() can be used in place of this clip. |
| 34 bool isRect() const; |
| 35 |
32 bool setEmpty(); | 36 bool setEmpty(); |
33 bool setRect(const SkIRect&); | 37 bool setRect(const SkIRect&); |
34 bool setRect(const SkRect&, bool doAA = true); | 38 bool setRect(const SkRect&, bool doAA = true); |
35 bool setPath(const SkPath&, const SkRegion* clip = NULL, bool doAA = true); | 39 bool setPath(const SkPath&, const SkRegion* clip = NULL, bool doAA = true); |
36 bool setRegion(const SkRegion&); | 40 bool setRegion(const SkRegion&); |
37 bool set(const SkAAClip&); | 41 bool set(const SkAAClip&); |
38 | 42 |
39 bool op(const SkAAClip&, const SkAAClip&, SkRegion::Op); | 43 bool op(const SkAAClip&, const SkAAClip&, SkRegion::Op); |
40 | 44 |
41 // Helpers for op() | 45 // Helpers for op() |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 enum { | 127 enum { |
124 kSize = 32 * 32 | 128 kSize = 32 * 32 |
125 }; | 129 }; |
126 SkAutoSMalloc<kSize> fGrayMaskScratch; // used for blitMask | 130 SkAutoSMalloc<kSize> fGrayMaskScratch; // used for blitMask |
127 void* fScanlineScratch; // enough for a mask at 32bit, or runs+aa | 131 void* fScanlineScratch; // enough for a mask at 32bit, or runs+aa |
128 | 132 |
129 void ensureRunsAndAA(); | 133 void ensureRunsAndAA(); |
130 }; | 134 }; |
131 | 135 |
132 #endif | 136 #endif |
OLD | NEW |