diff options
-rw-r--r-- | include/core/SkPath.h | 1 | ||||
-rw-r--r-- | src/core/SkPath.cpp | 27 |
2 files changed, 10 insertions, 18 deletions
diff --git a/include/core/SkPath.h b/include/core/SkPath.h index e5093462f8..4e987c0a20 100644 --- a/include/core/SkPath.h +++ b/include/core/SkPath.h @@ -753,6 +753,7 @@ public: segments have been visited, return kDone_Verb. @param pts The points representing the current verb and/or segment + This must not be NULL. @return The verb for the current segment */ Verb next(SkPoint pts[4]); diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index a9693c2f67..34b0ac9360 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -1632,6 +1632,7 @@ void SkPath::RawIter::setPath(const SkPath& path) { } SkPath::Verb SkPath::RawIter::next(SkPoint pts[4]) { + SkASSERT(NULL != pts); if (fVerbs == fVerbStop) { return kDone_Verb; } @@ -1641,42 +1642,32 @@ SkPath::Verb SkPath::RawIter::next(SkPoint pts[4]) { switch (verb) { case kMove_Verb: - if (pts) { - pts[0] = *srcPts; - } + pts[0] = *srcPts; fMoveTo = srcPts[0]; fLastPt = fMoveTo; srcPts += 1; break; case kLine_Verb: - if (pts) { - pts[0] = fLastPt; - pts[1] = srcPts[0]; - } + pts[0] = fLastPt; + pts[1] = srcPts[0]; fLastPt = srcPts[0]; srcPts += 1; break; case kQuad_Verb: - if (pts) { - pts[0] = fLastPt; - memcpy(&pts[1], srcPts, 2 * sizeof(SkPoint)); - } + pts[0] = fLastPt; + memcpy(&pts[1], srcPts, 2 * sizeof(SkPoint)); fLastPt = srcPts[1]; srcPts += 2; break; case kCubic_Verb: - if (pts) { - pts[0] = fLastPt; - memcpy(&pts[1], srcPts, 3 * sizeof(SkPoint)); - } + pts[0] = fLastPt; + memcpy(&pts[1], srcPts, 3 * sizeof(SkPoint)); fLastPt = srcPts[2]; srcPts += 3; break; case kClose_Verb: fLastPt = fMoveTo; - if (pts) { - pts[0] = fMoveTo; - } + pts[0] = fMoveTo; break; } fPts = srcPts; |