Index: include/core/SkScalar.h |
diff --git a/include/core/SkScalar.h b/include/core/SkScalar.h |
index b2d966cb3bbf79daba3cdd5beb6b4728afd0b2a2..b3ac022410abec77c5ef8453b635bb0e492c4ba9 100644 |
--- a/include/core/SkScalar.h |
+++ b/include/core/SkScalar.h |
@@ -30,6 +30,9 @@ typedef float SkScalar; |
#define SK_ScalarInfinity SK_FloatInfinity |
#define SK_ScalarNegativeInfinity SK_FloatNegativeInfinity |
#define SK_ScalarNaN SK_FloatNaN |
+// This is the largest number <= SK_MaxS32 that can be round-trip converted between SkScalar and |
+// int32_t. |
+#define SK_MaxS32Scalar 2.14748352e+9f |
#define SkScalarFloorToScalar(x) sk_float_floor(x) |
#define SkScalarCeilToScalar(x) sk_float_ceil(x) |
@@ -70,6 +73,7 @@ typedef double SkScalar; |
#define SK_ScalarInfinity SK_DoubleInfinity |
#define SK_ScalarNegativeInfinity SK_DoubleNegativeInfinity |
#define SK_ScalarNaN SK_DoubleNaN |
+#define SK_MaxS32Scalar SkIntToScalar(SK_MaxS32) |
#define SkScalarFloorToScalar(x) floor(x) |
#define SkScalarCeilToScalar(x) ceil(x) |