Index: src/core/SkPathMeasure.cpp |
diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp |
index caff6df399d5318aedda719d2a744cad3a5bce42..d959f45f4f8718c4ee4ab539e8136852654ad939 100644 |
--- a/src/core/SkPathMeasure.cpp |
+++ b/src/core/SkPathMeasure.cpp |
@@ -20,11 +20,20 @@ enum { |
kConic_SegType, |
}; |
+#ifdef SK_SUPPORT_LEGACY_PATH_MEASURE_TVALUE |
#define kMaxTValue 32767 |
+#else |
+#define kMaxTValue 0x3FFFFFFF |
+#endif |
static inline SkScalar tValue2Scalar(int t) { |
SkASSERT((unsigned)t <= kMaxTValue); |
+#ifdef SK_SUPPORT_LEGACY_PATH_MEASURE_TVALUE |
return t * 3.05185e-5f; // t / 32767 |
+#else |
+ const SkScalar kMaxTReciprocal = 1.0f / kMaxTValue; |
+ return t * kMaxTReciprocal; |
+#endif |
} |
SkScalar SkPathMeasure::Segment::getScalarT() const { |