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

Side by Side Diff: include/core/SkRect.h

Issue 1111013002: Remove useless SkASSERT in SkRect.h and SkRegion.h (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | include/core/SkRegion.h » ('j') | 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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 SkRect_DEFINED 8 #ifndef SkRect_DEFINED
9 #define SkRect_DEFINED 9 #define SkRect_DEFINED
10 10
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 bool containsNoEmptyCheck(const SkIRect& r) const { 275 bool containsNoEmptyCheck(const SkIRect& r) const {
276 return containsNoEmptyCheck(r.fLeft, r.fTop, r.fRight, r.fBottom); 276 return containsNoEmptyCheck(r.fLeft, r.fTop, r.fRight, r.fBottom);
277 } 277 }
278 278
279 /** If r intersects this rectangle, return true and set this rectangle to th at 279 /** If r intersects this rectangle, return true and set this rectangle to th at
280 intersection, otherwise return false and do not change this rectangle. 280 intersection, otherwise return false and do not change this rectangle.
281 If either rectangle is empty, do nothing and return false. 281 If either rectangle is empty, do nothing and return false.
282 */ 282 */
283 bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& r) { 283 bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& r) {
284 SkASSERT(&r);
285 return this->intersect(r.fLeft, r.fTop, r.fRight, r.fBottom); 284 return this->intersect(r.fLeft, r.fTop, r.fRight, r.fBottom);
286 } 285 }
287 286
288 /** If rectangles a and b intersect, return true and set this rectangle to 287 /** If rectangles a and b intersect, return true and set this rectangle to
289 that intersection, otherwise return false and do not change this 288 that intersection, otherwise return false and do not change this
290 rectangle. If either rectangle is empty, do nothing and return false. 289 rectangle. If either rectangle is empty, do nothing and return false.
291 */ 290 */
292 bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& a, const SkIRect& b) { 291 bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& a, const SkIRect& b) {
293 292
294 if (!a.isEmpty() && !b.isEmpty() && 293 if (!a.isEmpty() && !b.isEmpty() &&
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 void dumpHex() const { this->dump(true); } 909 void dumpHex() const { this->dump(true); }
911 }; 910 };
912 911
913 inline bool SkIRect::contains(const SkRect& r) const { 912 inline bool SkIRect::contains(const SkRect& r) const {
914 return !r.isEmpty() && !this->isEmpty() && // check for empties 913 return !r.isEmpty() && !this->isEmpty() && // check for empties
915 (SkScalar)fLeft <= r.fLeft && (SkScalar)fTop <= r.fTop && 914 (SkScalar)fLeft <= r.fLeft && (SkScalar)fTop <= r.fTop &&
916 (SkScalar)fRight >= r.fRight && (SkScalar)fBottom >= r.fBottom; 915 (SkScalar)fRight >= r.fRight && (SkScalar)fBottom >= r.fBottom;
917 } 916 }
918 917
919 #endif 918 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkRegion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698