diff --git a/gfx/skia/trunk/include/core/SkPoint.h b/gfx/skia/trunk/include/core/SkPoint.h index 6f32d98c751..8a0480ae730 100644 --- a/gfx/skia/trunk/include/core/SkPoint.h +++ b/gfx/skia/trunk/include/core/SkPoint.h @@ -348,11 +348,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/gfx/skia/trunk/include/core/SkRect.h b/gfx/skia/trunk/include/core/SkRect.h index 77051c2d8b0..dbeff1be36b 100644 --- a/gfx/skia/trunk/include/core/SkRect.h +++ b/gfx/skia/trunk/include/core/SkRect.h @@ -457,11 +457,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/gfx/skia/trunk/include/core/SkScalar.h b/gfx/skia/trunk/include/core/SkScalar.h index b37cf5c998f..3056b7297e1 100644 --- a/gfx/skia/trunk/include/core/SkScalar.h +++ b/gfx/skia/trunk/include/core/SkScalar.h @@ -49,7 +49,7 @@ static inline bool SkScalarIsFinite(float x) { float 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); } /** SkIntToScalar(n) returns its integer argument as an SkScalar