diff options
author | reed <reed@google.com> | 2014-12-17 05:50:55 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-17 05:50:55 -0800 |
commit | 2b9445b84e64a122676b65637d40cb31f5437c17 (patch) | |
tree | 2b53504ce36d424a330b81a7c3d5582489bbf3ba | |
parent | ccb28e16fde7a3e4bdaaccaced126c70c0beee2b (diff) |
fix end-point and conic bugs in cornerpatheffect
fixes bug in GM/patheffect -- will need to be rebaselined
BUG=skia:
Review URL: https://codereview.chromium.org/803213003
-rw-r--r-- | expectations/gm/ignored-tests.txt | 3 | ||||
-rw-r--r-- | src/effects/SkCornerPathEffect.cpp | 17 |
2 files changed, 17 insertions, 3 deletions
diff --git a/expectations/gm/ignored-tests.txt b/expectations/gm/ignored-tests.txt index 44577413b8..8395c0c607 100644 --- a/expectations/gm/ignored-tests.txt +++ b/expectations/gm/ignored-tests.txt @@ -51,6 +51,9 @@ imagemagnifier #reed modecolorfilters +#reed -- https://codereview.chromium.org/803213003/ +patheffect + #humper skia:2049 dashcubics diff --git a/src/effects/SkCornerPathEffect.cpp b/src/effects/SkCornerPathEffect.cpp index 8dc506ace4..31f55a3901 100644 --- a/src/effects/SkCornerPathEffect.cpp +++ b/src/effects/SkCornerPathEffect.cpp @@ -94,6 +94,16 @@ bool SkCornerPathEffect::filterPath(SkPath* dst, const SkPath& src, lastCorner = pts[2]; firstStep.set(0, 0); break; + case SkPath::kConic_Verb: + // TBD - just replicate the curve for now + if (!prevIsValid) { + dst->moveTo(pts[0]); + prevIsValid = true; + } + dst->conicTo(pts[1], pts[2], iter.conicWeight()); + lastCorner = pts[2]; + firstStep.set(0, 0); + break; case SkPath::kCubic_Verb: if (!prevIsValid) { dst->moveTo(pts[0]); @@ -111,11 +121,12 @@ bool SkCornerPathEffect::filterPath(SkPath* dst, const SkPath& src, lastCorner.fY + firstStep.fY); } dst->close(); - break; - case SkPath::kConic_Verb: - SkASSERT(0); + prevIsValid = false; break; case SkPath::kDone_Verb: + if (prevIsValid) { + dst->lineTo(lastCorner); + } goto DONE; } |