Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: src/core/SkPathMeasure.cpp

Issue 1534223002: fix large dashed paths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPathMeasure.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « include/core/SkPathMeasure.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698