diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkPoint.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/core/SkPoint.h b/include/core/SkPoint.h index 4570e25613..cc483a62ac 100644 --- a/include/core/SkPoint.h +++ b/include/core/SkPoint.h @@ -213,7 +213,13 @@ struct SK_API SkPoint { * Return true if the computed length of the vector is >= the internal * tolerance (used to avoid dividing by tiny values). */ - static bool CanNormalize(SkScalar dx, SkScalar dy); + static bool CanNormalize(SkScalar dx, SkScalar dy) +#ifdef SK_SCALAR_IS_FLOAT + // Simple enough (and performance critical sometimes) so we inline it. + { return (dx*dx + dy*dy) > (SK_ScalarNearlyZero * SK_ScalarNearlyZero); } +#else + ; +#endif bool canNormalize() const { return CanNormalize(fX, fY); |