aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkGeometry.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-08-26 09:54:25 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-08-26 09:54:25 -0700
commitf71ab8f58b0a7abb7818cf665dfb116ef370d572 (patch)
tree76146780c3400c7f33920b840fd3f1f31ce064bd /src/core/SkGeometry.cpp
parent56f33ea2acb39ebb041340a8ab7564facb95afce (diff)
avoid generating degenerate conic from arc
R=bsalomon@google.com BUG=skia:5672 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2281953002 Review-Url: https://codereview.chromium.org/2281953002
Diffstat (limited to 'src/core/SkGeometry.cpp')
-rw-r--r--src/core/SkGeometry.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/SkGeometry.cpp b/src/core/SkGeometry.cpp
index 03a63b2bda..8f270f9722 100644
--- a/src/core/SkGeometry.cpp
+++ b/src/core/SkGeometry.cpp
@@ -1351,8 +1351,10 @@ int SkConic::BuildUnitArc(const SkVector& uStart, const SkVector& uStop, SkRotat
//
const SkScalar cosThetaOver2 = SkScalarSqrt((1 + dot) / 2);
offCurve.setLength(SkScalarInvert(cosThetaOver2));
- dst[conicCount].set(lastQ, offCurve, finalP, cosThetaOver2);
- conicCount += 1;
+ if (!lastQ.equalsWithinTolerance(offCurve)) {
+ dst[conicCount].set(lastQ, offCurve, finalP, cosThetaOver2);
+ conicCount += 1;
+ }
}
// now handle counter-clockwise and the initial unitStart rotation