Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: src/core/SkPath.cpp

Issue 1156893003: simplify RawIter - don't return a pt in kClose (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPath.h ('k') | tests/PathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPath.cpp
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 967fbe59ccdcbbe10b097709bc01b59a627bdde5..c9bcb8fce287539750c62bfa97a6ef496a2709b2 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1777,7 +1777,6 @@ SkPath::RawIter::RawIter() {
#ifdef SK_DEBUG
fPts = NULL;
fConicWeights = NULL;
- fMoveTo.fX = fMoveTo.fY = 0;
#endif
// need to init enough to make next() harmlessly return kDone_Verb
fVerbs = NULL;
@@ -1793,7 +1792,6 @@ void SkPath::RawIter::setPath(const SkPath& path) {
fVerbs = path.fPathRef->verbs();
fVerbStop = path.fPathRef->verbsMemBegin();
fConicWeights = path.fPathRef->conicWeights() - 1; // begin one behind
- fMoveTo.fX = fMoveTo.fY = 0;
}
SkPath::Verb SkPath::RawIter::next(SkPoint pts[4]) {
@@ -1808,7 +1806,7 @@ SkPath::Verb SkPath::RawIter::next(SkPoint pts[4]) {
switch (verb) {
case kMove_Verb:
- fMoveTo = pts[0] = srcPts[0];
+ pts[0] = srcPts[0];
srcPts += 1;
break;
case kLine_Verb:
@@ -1833,7 +1831,9 @@ SkPath::Verb SkPath::RawIter::next(SkPoint pts[4]) {
srcPts += 3;
break;
case kClose_Verb:
- pts[0] = fMoveTo;
+ break;
+ case kDone_Verb:
+ SkASSERT(fVerbs == fVerbStop);
break;
}
fPts = srcPts;
« no previous file with comments | « include/core/SkPath.h ('k') | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698