Chromium Code Reviews| Index: include/core/SkFloatingPoint.h |
| diff --git a/include/core/SkFloatingPoint.h b/include/core/SkFloatingPoint.h |
| index 1003b80b4f1109db3730c54d0b76ede4ae865703..a6a17bc67ece9bdf16d34e536974db78925152df 100644 |
| --- a/include/core/SkFloatingPoint.h |
| +++ b/include/core/SkFloatingPoint.h |
| @@ -91,6 +91,12 @@ static inline float sk_float_copysign(float x, float y) { |
| #define sk_float_log(x) logf(x) |
|
robertphillips
2015/01/16 01:13:37
Map sk_float_log2 to log2f here?
reed1
2015/01/16 13:00:11
Done.
|
| #endif |
| +// 1 / ln(2) |
| +#define SK_INVERSE_LN_2 1.44269504088896 |
| + |
| +// log2(x) = log(x) / log(2) |
| +#define sk_float_log2(x) (float)(::log(x) * SK_INVERSE_LN_2) |
| + |
| #ifdef SK_BUILD_FOR_WIN |
| #define sk_float_isfinite(x) _finite(x) |
| #define sk_float_isnan(x) _isnan(x) |