Preserve fLastMoveToIndex in SkPath::transform

This should remedy some of the SkPath::reverseAddPath fuzzer failures

Change-Id: Ic9fe6106b4a0693084b75f0544b672cea78be3cc
Reviewed-on: https://skia-review.googlesource.com/154625
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2018-09-14 11:07:00 -04:00 committed by Skia Commit-Bot
parent 7724d3f494
commit f026d896dc

View File

@ -1716,10 +1716,10 @@ SkPath& SkPath::reverseAddPath(const SkPath& srcPath) {
src = tmp.set(srcPath);
}
SkPathRef::Editor ed(&fPathRef, src->fPathRef->countPoints(), src->fPathRef->countVerbs());
SkPathRef::Editor ed(&fPathRef, src->countVerbs(), src->countPoints());
const SkPoint* pts = src->fPathRef->pointsEnd();
// we will iterator through src's verbs backwards
// we will iterate through src's verbs backwards
const uint8_t* verbs = src->fPathRef->verbsMemBegin(); // points at the last verb
const uint8_t* verbsEnd = src->fPathRef->verbs(); // points just past the first verb
const SkScalar* conicWeights = src->fPathRef->conicWeightsEnd();
@ -1840,6 +1840,7 @@ void SkPath::transform(const SkMatrix& matrix, SkPath* dst) const {
SkPathRef::CreateTransformedCopy(&dst->fPathRef, *fPathRef.get(), matrix);
if (this != dst) {
dst->fLastMoveToIndex = fLastMoveToIndex;
dst->fFillType = fFillType;
dst->fConvexity.store(fConvexity);
dst->fIsVolatile = fIsVolatile;