add SkPath::isRRect

Add helper to track when a round rect was added to a path,
and then return the SkRRect specification that describes it.

Move the implementation for SkPath::RawIter to SkPathRef so it can be used there as well.

R=reed@google.com,robertphillips@google.com

Review URL: https://codereview.chromium.org/1461763004
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index a3f5e13..2d4976a 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1072,6 +1072,7 @@
             return;
         }
 
+        bool isRRect = hasOnlyMoveTos();
         const SkRect& bounds = rrect.getBounds();
 
         if (rrect.isRect()) {
@@ -1119,6 +1120,9 @@
             }
             this->close();
 
+            SkPathRef::Editor ed(&fPathRef);
+            ed.setIsRRect(isRRect);
+
             SkASSERT(this->countVerbs() == initialVerbCount + kVerbs);
         }
 
@@ -1861,75 +1865,6 @@
 
 ///////////////////////////////////////////////////////////////////////////////
 
-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[]]
 */