diff options
Diffstat (limited to 'include/core')
-rw-r--r-- | include/core/SkPoint.h | 4 | ||||
-rw-r--r-- | include/core/SkRect.h | 4 | ||||
-rw-r--r-- | include/core/SkScalar.h | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h index 323c824a1b..4a97391c70 100644 --- a/include/core/SkPoint.h +++ b/include/core/SkPoint.h @@ -357,11 +357,11 @@ struct SK_API SkPoint { accum *= fY; // accum is either NaN or it is finite (zero). - SkASSERT(0 == accum || !(accum == accum)); + SkASSERT(0 == accum || SkScalarIsNaN(accum)); // value==value will be true iff value is not NaN // TODO: is it faster to say !accum or accum==accum? - return accum == accum; + return !SkScalarIsNaN(accum); } /** diff --git a/include/core/SkRect.h b/include/core/SkRect.h index 394e45d4ca..0038c7c2fa 100644 --- a/include/core/SkRect.h +++ b/include/core/SkRect.h @@ -455,11 +455,11 @@ struct SK_API SkRect { accum *= fBottom; // accum is either NaN or it is finite (zero). - SkASSERT(0 == accum || !(accum == accum)); + SkASSERT(0 == accum || SkScalarIsNaN(accum)); // value==value will be true iff value is not NaN // TODO: is it faster to say !accum or accum==accum? - return accum == accum; + return !SkScalarIsNaN(accum); } SkScalar x() const { return fLeft; } diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h index e0490e2b0b..94c3ce15c0 100644 --- a/include/core/SkScalar.h +++ b/include/core/SkScalar.h @@ -127,7 +127,7 @@ static inline bool SkScalarIsFinite(SkScalar x) { SkScalar prod = x * 0; // At this point, prod will either be NaN or 0 // Therefore we can return (prod == prod) or (0 == prod). - return prod == prod; + return !SkScalarIsNaN(prod); } /** |