Index: src/core/SkStroke.cpp |
diff --git a/src/core/SkStroke.cpp b/src/core/SkStroke.cpp |
index a05bfd448fdfdd89a6af314f576060658488ed11..b5725225294c083321be47f35c8081e40a9afb8e 100644 |
--- a/src/core/SkStroke.cpp |
+++ b/src/core/SkStroke.cpp |
@@ -676,6 +676,7 @@ void SkPathStroker::quadTo(const SkPoint& pt1, const SkPoint& pt2) { |
// compute the perpendicular point and its tangent. |
void SkPathStroker::setRayPts(const SkPoint& tPt, SkVector* dxy, SkPoint* onPt, |
SkPoint* tangent) const { |
+#if 01 |
SkPoint oldDxy = *dxy; |
if (!dxy->setLength(fRadius)) { // consider moving double logic into SkPoint::setLength |
double xx = oldDxy.fX; |
@@ -684,6 +685,11 @@ void SkPathStroker::setRayPts(const SkPoint& tPt, SkVector* dxy, SkPoint* onPt, |
dxy->fX = SkDoubleToScalar(xx * dscale); |
dxy->fY = SkDoubleToScalar(yy * dscale); |
} |
+#else |
+ SkScalar scale = fRadius * sk_float_rsqrt(dxy->fX * dxy->fX + dxy->fY * dxy->fY); |
+ dxy->fX *= scale; |
+ dxy->fY *= scale; |
+#endif |
SkScalar axisFlip = SkIntToScalar(fStrokeType); // go opposite ways for outer, inner |
onPt->fX = tPt.fX + axisFlip * dxy->fY; |
onPt->fY = tPt.fY - axisFlip * dxy->fX; |