Chromium Code Reviews| Index: include/core/SkFloatingPoint.h |
| diff --git a/include/core/SkFloatingPoint.h b/include/core/SkFloatingPoint.h |
| index f85c456aa88cd89fc1ec9508a5826d2c01848348..1003b80b4f1109db3730c54d0b76ede4ae865703 100644 |
| --- a/include/core/SkFloatingPoint.h |
| +++ b/include/core/SkFloatingPoint.h |
| @@ -116,6 +116,13 @@ static inline float sk_float_copysign(float x, float y) { |
| #define sk_float_ceil2int(x) (int)sk_float_ceil(x) |
| #endif |
| +#define sk_double_floor(x) floor(x) |
| +#define sk_double_round(x) floor((x) + 0.5) |
|
Peter Kasting
2014/10/21 18:56:09
This doesn't match std::round() for negative numbe
reed1
2014/10/21 19:08:08
Agreed, this is very deliberate on skia's part. We
|
| +#define sk_double_ceil(x) ceil(x) |
| +#define sk_double_floor2int(x) (int)floor(x) |
| +#define sk_double_round2int(x) (int)floor((x) + 0.5f) |
| +#define sk_double_ceil2int(x) (int)ceil(x) |
| + |
| extern const uint32_t gIEEENotANumber; |
| extern const uint32_t gIEEEInfinity; |
| extern const uint32_t gIEEENegativeInfinity; |