aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkCornerPathEffect.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-12-17 05:50:55 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2014-12-17 05:50:55 -0800
commit2b9445b84e64a122676b65637d40cb31f5437c17 (patch)
tree2b53504ce36d424a330b81a7c3d5582489bbf3ba /src/effects/SkCornerPathEffect.cpp
parentccb28e16fde7a3e4bdaaccaced126c70c0beee2b (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
Diffstat (limited to 'src/effects/SkCornerPathEffect.cpp')
-rw-r--r--src/effects/SkCornerPathEffect.cpp17
1 files changed, 14 insertions, 3 deletions
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;
}