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

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

Issue 1724283003: Revert of Simple cleanups related to SkFixed. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 10 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 | « include/core/SkFixed.h ('k') | samplecode/SampleText.cpp » ('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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 */ 456 */
457 bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; } 457 bool isEmpty() const { return fLeft >= fRight || fTop >= fBottom; }
458 458
459 bool isLargest() const { return SK_ScalarMin == fLeft && 459 bool isLargest() const { return SK_ScalarMin == fLeft &&
460 SK_ScalarMin == fTop && 460 SK_ScalarMin == fTop &&
461 SK_ScalarMax == fRight && 461 SK_ScalarMax == fRight &&
462 SK_ScalarMax == fBottom; } 462 SK_ScalarMax == fBottom; }
463 463
464 /** 464 /**
465 * Returns true iff all values in the rect are finite. If any are 465 * Returns true iff all values in the rect are finite. If any are
466 * infinite or NaN then this returns false. 466 * infinite or NaN (or SK_FixedNaN when SkScalar is fixed) then this
467 * returns false.
467 */ 468 */
468 bool isFinite() const { 469 bool isFinite() const {
469 float accum = 0; 470 float accum = 0;
470 accum *= fLeft; 471 accum *= fLeft;
471 accum *= fTop; 472 accum *= fTop;
472 accum *= fRight; 473 accum *= fRight;
473 accum *= fBottom; 474 accum *= fBottom;
474 475
475 // accum is either NaN or it is finite (zero). 476 // accum is either NaN or it is finite (zero).
476 SkASSERT(0 == accum || SkScalarIsNaN(accum)); 477 SkASSERT(0 == accum || SkScalarIsNaN(accum));
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 void dumpHex() const { this->dump(true); } 899 void dumpHex() const { this->dump(true); }
899 }; 900 };
900 901
901 inline bool SkIRect::contains(const SkRect& r) const { 902 inline bool SkIRect::contains(const SkRect& r) const {
902 return !r.isEmpty() && !this->isEmpty() && // check for empties 903 return !r.isEmpty() && !this->isEmpty() && // check for empties
903 (SkScalar)fLeft <= r.fLeft && (SkScalar)fTop <= r.fTop && 904 (SkScalar)fLeft <= r.fLeft && (SkScalar)fTop <= r.fTop &&
904 (SkScalar)fRight >= r.fRight && (SkScalar)fBottom >= r.fBottom; 905 (SkScalar)fRight >= r.fRight && (SkScalar)fBottom >= r.fBottom;
905 } 906 }
906 907
907 #endif 908 #endif
OLDNEW
« no previous file with comments | « include/core/SkFixed.h ('k') | samplecode/SampleText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698