Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: src/core/SkRasterClip.h

Issue 554743007: SkRasterClip::quickReject doesn't need to check for emptiness as SkIRect::Intersect already does th… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698