OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkFloatingPoint_DEFINED | 10 #ifndef SkFloatingPoint_DEFINED |
(...skipping 17 matching lines...) Expand all Loading... |
28 static inline float sk_float_pow(float base, float exp) { | 28 static inline float sk_float_pow(float base, float exp) { |
29 return powf(base, exp); | 29 return powf(base, exp); |
30 } | 30 } |
31 | 31 |
32 #define sk_float_sqrt(x) sqrtf(x) | 32 #define sk_float_sqrt(x) sqrtf(x) |
33 #define sk_float_sin(x) sinf(x) | 33 #define sk_float_sin(x) sinf(x) |
34 #define sk_float_cos(x) cosf(x) | 34 #define sk_float_cos(x) cosf(x) |
35 #define sk_float_tan(x) tanf(x) | 35 #define sk_float_tan(x) tanf(x) |
36 #define sk_float_floor(x) floorf(x) | 36 #define sk_float_floor(x) floorf(x) |
37 #define sk_float_ceil(x) ceilf(x) | 37 #define sk_float_ceil(x) ceilf(x) |
| 38 #define sk_float_trunc(x) truncf(x) |
38 #ifdef SK_BUILD_FOR_MAC | 39 #ifdef SK_BUILD_FOR_MAC |
39 # define sk_float_acos(x) static_cast<float>(acos(x)) | 40 # define sk_float_acos(x) static_cast<float>(acos(x)) |
40 # define sk_float_asin(x) static_cast<float>(asin(x)) | 41 # define sk_float_asin(x) static_cast<float>(asin(x)) |
41 #else | 42 #else |
42 # define sk_float_acos(x) acosf(x) | 43 # define sk_float_acos(x) acosf(x) |
43 # define sk_float_asin(x) asinf(x) | 44 # define sk_float_asin(x) asinf(x) |
44 #endif | 45 #endif |
45 #define sk_float_atan2(y,x) atan2f(y,x) | 46 #define sk_float_atan2(y,x) atan2f(y,x) |
46 #define sk_float_abs(x) fabsf(x) | 47 #define sk_float_abs(x) fabsf(x) |
47 #define sk_float_copysign(x, y) copysignf(x, y) | 48 #define sk_float_copysign(x, y) copysignf(x, y) |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // This is the number of significant digits we can print in a string such that w
hen we read that | 143 // This is the number of significant digits we can print in a string such that w
hen we read that |
143 // string back we get the floating point number we expect. The minimum value C
requires is 6, but | 144 // string back we get the floating point number we expect. The minimum value C
requires is 6, but |
144 // most compilers support 9 | 145 // most compilers support 9 |
145 #ifdef FLT_DECIMAL_DIG | 146 #ifdef FLT_DECIMAL_DIG |
146 #define SK_FLT_DECIMAL_DIG FLT_DECIMAL_DIG | 147 #define SK_FLT_DECIMAL_DIG FLT_DECIMAL_DIG |
147 #else | 148 #else |
148 #define SK_FLT_DECIMAL_DIG 9 | 149 #define SK_FLT_DECIMAL_DIG 9 |
149 #endif | 150 #endif |
150 | 151 |
151 #endif | 152 #endif |
OLD | NEW |