diff options
author | Mike Reed <reed@google.com> | 2018-05-14 16:05:08 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-14 16:05:20 +0000 |
commit | 0e6db75eebab430e7f6665c8cfa1e7dcd2fef123 (patch) | |
tree | 2959f7e76f8b56681280f8c7ecbb83399bbaf23c /include/private/SkFloatingPoint.h | |
parent | 8c2de8f76bc1f48702ca006c484ac9750dc8e3b0 (diff) |
Revert "implement SkScalar versions in terms of float versions"
This reverts commit 4c3cb3767f5af3860998b932702dc18619ab3e1e.
Reason for revert: investigate asan failures
Original change's description:
> implement SkScalar versions in terms of float versions
>
> Bug: skia:
> Change-Id: I44ce228290f7fda5b7e3553c8543dcf581b1ca3b
> Reviewed-on: https://skia-review.googlesource.com/127128
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=caryclark@google.com,reed@google.com
Change-Id: Ic790b15130a67f46a0a99fdf991c5c08d682be5e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/128060
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'include/private/SkFloatingPoint.h')
-rw-r--r-- | include/private/SkFloatingPoint.h | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/include/private/SkFloatingPoint.h b/include/private/SkFloatingPoint.h index e2f2133f3d..a2e6ee5122 100644 --- a/include/private/SkFloatingPoint.h +++ b/include/private/SkFloatingPoint.h @@ -12,7 +12,6 @@ #include "SkTypes.h" #include "SkSafe_math.h" #include <float.h> -#include <math.h> #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE1 #include <xmmintrin.h> @@ -65,17 +64,17 @@ static inline float sk_float_pow(float base, float exp) { #define sk_float_log2(x) log2f(x) #endif -static inline bool sk_float_isfinite(float x) { - return SkFloatBits_IsFinite(SkFloat2Bits(x)); -} - -static inline bool sk_float_isinf(float x) { - return SkFloatBits_IsInf(SkFloat2Bits(x)); -} - -static inline bool sk_float_isnan(float x) { - return !(x == x); -} +#ifdef SK_BUILD_FOR_WIN + #define sk_float_isfinite(x) _finite(x) + #define sk_float_isnan(x) _isnan(x) + static inline int sk_float_isinf(float x) { + return x && (x + x == x); + } +#else + #define sk_float_isfinite(x) isfinite(x) + #define sk_float_isnan(x) isnan(x) + #define sk_float_isinf(x) isinf(x) +#endif #define sk_double_isnan(a) sk_float_isnan(a) |