aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsCubic.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2016-09-28 09:22:17 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-28 09:22:17 -0700
commite3a4e993ef79788d5ee807b10ff588e9c46bac6d (patch)
treeda042cd555a96f4fa5d8975e8fafeb20d7b75f26 /src/pathops/SkPathOpsCubic.cpp
parent33069255769246c703e1fbdbe14a752c31d0ad1e (diff)
fix cubic linear test
Check to see if the line between end points is degenerate before measuring control points. Also, add test case for a bug to see if it shows up on any platform. TBR=reed@google.com BUG=skia:5169, skia:5240 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2375053002 Review-Url: https://codereview.chromium.org/2375053002
Diffstat (limited to 'src/pathops/SkPathOpsCubic.cpp')
-rw-r--r--src/pathops/SkPathOpsCubic.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/pathops/SkPathOpsCubic.cpp b/src/pathops/SkPathOpsCubic.cpp
index 6fcb348e4f..bdae492de0 100644
--- a/src/pathops/SkPathOpsCubic.cpp
+++ b/src/pathops/SkPathOpsCubic.cpp
@@ -212,6 +212,9 @@ bool SkDCubic::hullIntersects(const SkDConic& conic, bool* isLinear) const {
}
bool SkDCubic::isLinear(int startIndex, int endIndex) const {
+ if (fPts[0].approximatelyDEqual(fPts[3])) {
+ return ((const SkDQuad *) this)->isLinear(0, 2);
+ }
SkLineParameters lineParameters;
lineParameters.cubicEndPoints(*this, startIndex, endIndex);
// FIXME: maybe it's possible to avoid this and compare non-normalized