Chromium Code Reviews| Index: src/core/SkPath.cpp |
| diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp |
| index a3f5e13d7fa924f29a639ecc9fd6d10fff64a21c..f3169e01353d10581437eee560b7d852159f6d44 100644 |
| --- a/src/core/SkPath.cpp |
| +++ b/src/core/SkPath.cpp |
| @@ -1072,6 +1072,7 @@ void SkPath::addRRect(const SkRRect &rrect, Direction dir, unsigned startIndex) |
| return; |
| } |
| + bool isRRect = hasOnlyMoveTos(); |
| const SkRect& bounds = rrect.getBounds(); |
| if (rrect.isRect()) { |
| @@ -1122,6 +1123,9 @@ void SkPath::addRRect(const SkRRect &rrect, Direction dir, unsigned startIndex) |
| SkASSERT(this->countVerbs() == initialVerbCount + kVerbs); |
| } |
| + SkPathRef::Editor ed(&fPathRef); |
|
reed1
2015/11/19 19:28:10
Should we move these into the last else case, so w
caryclark
2015/11/19 20:49:05
Done.
|
| + ed.setIsRRect(isRRect); |
| + |
| SkDEBUGCODE(fPathRef->validate();) |
| } |
| @@ -1861,75 +1865,6 @@ SkPath::Verb SkPath::Iter::doNext(SkPoint ptsParam[4]) { |
| /////////////////////////////////////////////////////////////////////////////// |
| -SkPath::RawIter::RawIter() { |
| -#ifdef SK_DEBUG |
| - fPts = nullptr; |
| - fConicWeights = nullptr; |
| -#endif |
| - // need to init enough to make next() harmlessly return kDone_Verb |
| - fVerbs = nullptr; |
| - fVerbStop = nullptr; |
| -} |
| - |
| -SkPath::RawIter::RawIter(const SkPath& path) { |
| - this->setPath(path); |
| -} |
| - |
| -void SkPath::RawIter::setPath(const SkPath& path) { |
| - fPts = path.fPathRef->points(); |
| - fVerbs = path.fPathRef->verbs(); |
| - fVerbStop = path.fPathRef->verbsMemBegin(); |
| - fConicWeights = path.fPathRef->conicWeights() - 1; // begin one behind |
| -} |
| - |
| -SkPath::Verb SkPath::RawIter::next(SkPoint pts[4]) { |
| - SkASSERT(pts); |
| - if (fVerbs == fVerbStop) { |
| - return kDone_Verb; |
| - } |
| - |
| - // fVerbs points one beyond next verb so decrement first. |
| - unsigned verb = *(--fVerbs); |
| - const SkPoint* srcPts = fPts; |
| - |
| - switch (verb) { |
| - case kMove_Verb: |
| - pts[0] = srcPts[0]; |
| - srcPts += 1; |
| - break; |
| - case kLine_Verb: |
| - pts[0] = srcPts[-1]; |
| - pts[1] = srcPts[0]; |
| - srcPts += 1; |
| - break; |
| - case kConic_Verb: |
| - fConicWeights += 1; |
| - // fall-through |
| - case kQuad_Verb: |
| - pts[0] = srcPts[-1]; |
| - pts[1] = srcPts[0]; |
| - pts[2] = srcPts[1]; |
| - srcPts += 2; |
| - break; |
| - case kCubic_Verb: |
| - pts[0] = srcPts[-1]; |
| - pts[1] = srcPts[0]; |
| - pts[2] = srcPts[1]; |
| - pts[3] = srcPts[2]; |
| - srcPts += 3; |
| - break; |
| - case kClose_Verb: |
| - break; |
| - case kDone_Verb: |
| - SkASSERT(fVerbs == fVerbStop); |
| - break; |
| - } |
| - fPts = srcPts; |
| - return (Verb)verb; |
| -} |
| - |
| -/////////////////////////////////////////////////////////////////////////////// |
| - |
| /* |
| Format in compressed buffer: [ptCount, verbCount, pts[], verbs[]] |
| */ |