| 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 | |
| 36 bool setEmpty(); | 32 bool setEmpty(); |
| 37 bool setRect(const SkIRect&); | 33 bool setRect(const SkIRect&); |
| 38 bool setRect(const SkRect&, bool doAA = true); | 34 bool setRect(const SkRect&, bool doAA = true); |
| 39 bool setPath(const SkPath&, const SkRegion* clip = NULL, bool doAA = true); | 35 bool setPath(const SkPath&, const SkRegion* clip = NULL, bool doAA = true); |
| 40 bool setRegion(const SkRegion&); | 36 bool setRegion(const SkRegion&); |
| 41 bool set(const SkAAClip&); | 37 bool set(const SkAAClip&); |
| 42 | 38 |
| 43 bool op(const SkAAClip&, const SkAAClip&, SkRegion::Op); | 39 bool op(const SkAAClip&, const SkAAClip&, SkRegion::Op); |
| 44 | 40 |
| 45 // Helpers for op() | 41 // Helpers for op() |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 enum { | 123 enum { |
| 128 kSize = 32 * 32 | 124 kSize = 32 * 32 |
| 129 }; | 125 }; |
| 130 SkAutoSMalloc<kSize> fGrayMaskScratch; // used for blitMask | 126 SkAutoSMalloc<kSize> fGrayMaskScratch; // used for blitMask |
| 131 void* fScanlineScratch; // enough for a mask at 32bit, or runs+aa | 127 void* fScanlineScratch; // enough for a mask at 32bit, or runs+aa |
| 132 | 128 |
| 133 void ensureRunsAndAA(); | 129 void ensureRunsAndAA(); |
| 134 }; | 130 }; |
| 135 | 131 |
| 136 #endif | 132 #endif |
| OLD | NEW |