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
This commit is contained in:
reed 2014-12-17 05:50:55 -08:00 committed by Commit bot
parent ccb28e16fd
commit 2b9445b84e
2 changed files with 17 additions and 3 deletions

View File

@ -51,6 +51,9 @@ imagemagnifier
#reed
modecolorfilters
#reed -- https://codereview.chromium.org/803213003/
patheffect
#humper skia:2049
dashcubics

View File

@ -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;
}