aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-12-06 20:18:05 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-12-06 20:18:05 +0000
commit5ae777dcad2c211814f5e9cde803ef6cc96a595f (patch)
tree55c8052b5530fde9ed3c4be8d4da25c40bb5b082 /include
parent675c5c4303f75581405b510537e2fccd69bd416f (diff)
rename sk_float_isNaN to sk_float_isnan to match related functions
add sk_float_isinf returning non-zero if the argument is +/- infinity git-svn-id: http://skia.googlecode.com/svn/trunk@2813 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkFloatingPoint.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/core/SkFloatingPoint.h b/include/core/SkFloatingPoint.h
index b204e48595..ee91cd9799 100644
--- a/include/core/SkFloatingPoint.h
+++ b/include/core/SkFloatingPoint.h
@@ -67,10 +67,15 @@ static inline float sk_float_copysign(float x, float y) {
#ifdef SK_BUILD_FOR_WIN
#define sk_float_isfinite(x) _finite(x)
- #define sk_float_isNaN(x) _isnan(x)
+ #define sk_float_isnan(x) _isnan(x)
+ static inline int sk_float_isinf(float x) {
+ int32_t bits = SkFloat2Bits(x);
+ return (bits << 1) == (0xFF << 24);
+ }
#else
#define sk_float_isfinite(x) isfinite(x)
- #define sk_float_isNaN(x) isnan(x)
+ #define sk_float_isnan(x) isnan(x)
+ #define sk_float_isinf(x) isinf(x)
#endif
#ifdef SK_USE_FLOATBITS