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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 bool quickContains(int left, int top, int right, int bottom) const { | 53 bool quickContains(int left, int top, int right, int bottom) const { |
54 return quickContains(SkIRect::MakeLTRB(left, top, right, bottom)); | 54 return quickContains(SkIRect::MakeLTRB(left, top, right, bottom)); |
55 } | 55 } |
56 | 56 |
57 /** | 57 /** |
58 * Return true if this region is empty, or if the specified rectangle does | 58 * Return true if this region is empty, or if the specified rectangle does |
59 * not intersect the region. Returning false is not a guarantee that they | 59 * not intersect the region. Returning false is not a guarantee that they |
60 * intersect, but returning true is a guarantee that they do not. | 60 * intersect, but returning true is a guarantee that they do not. |
61 */ | 61 */ |
62 bool quickReject(const SkIRect& rect) const { | 62 bool quickReject(const SkIRect& rect) const { |
63 return this->isEmpty() || rect.isEmpty() || | 63 return !SkIRect::Intersects(this->getBounds(), rect); |
64 !SkIRect::Intersects(this->getBounds(), rect); | |
65 } | 64 } |
66 | 65 |
67 // hack for SkCanvas::getTotalClip | 66 // hack for SkCanvas::getTotalClip |
68 const SkRegion& forceGetBW(); | 67 const SkRegion& forceGetBW(); |
69 | 68 |
70 #ifdef SK_DEBUG | 69 #ifdef SK_DEBUG |
71 void validate() const; | 70 void validate() const; |
72 #else | 71 #else |
73 void validate() const {} | 72 void validate() const {} |
74 #endif | 73 #endif |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 162 |
164 private: | 163 private: |
165 SkRegion fBWRgn; | 164 SkRegion fBWRgn; |
166 SkAAClipBlitter fAABlitter; | 165 SkAAClipBlitter fAABlitter; |
167 // what we return | 166 // what we return |
168 const SkRegion* fClipRgn; | 167 const SkRegion* fClipRgn; |
169 SkBlitter* fBlitter; | 168 SkBlitter* fBlitter; |
170 }; | 169 }; |
171 | 170 |
172 #endif | 171 #endif |
OLD | NEW |