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

Unified Diff: src/core/SkPathRef.cpp

Issue 137863006: Revert of r13379 (Move fLastMoveToIndex from SkPath to SkPathRef) (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 6 years, 10 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 | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPathRef.cpp
===================================================================
--- src/core/SkPathRef.cpp (revision 13420)
+++ src/core/SkPathRef.cpp (working copy)
@@ -154,7 +154,6 @@
void SkPathRef::Rewind(SkAutoTUnref<SkPathRef>* pathRef) {
if ((*pathRef)->unique()) {
SkDEBUGCODE((*pathRef)->validate();)
- (*pathRef)->fLastMoveToIndex = kINITIAL_LASTMOVETOINDEX_VALUE;
(*pathRef)->fBoundsIsDirty = true; // this also invalidates fIsFinite
(*pathRef)->fVerbCnt = 0;
(*pathRef)->fPointCnt = 0;
@@ -277,20 +276,6 @@
SkDEBUGCODE(this->validate();)
}
-void SkPathRef::injectMoveToIfNeeded() {
- if (fLastMoveToIndex < 0) {
- SkScalar x, y;
- if (this->countVerbs() == 0) {
- x = y = 0;
- } else {
- const SkPoint& pt = this->atPoint(~fLastMoveToIndex);
- x = pt.fX;
- y = pt.fY;
- }
- this->growForVerb(SkPath::kMove_Verb, 0)->set(x, y);
- }
-}
-
SkPoint* SkPathRef::growForRepeatedVerb(int /*SkPath::Verb*/ verb,
int numVbs,
SkScalar** weights) {
@@ -299,16 +284,11 @@
// future this will appear to have been a fluke...
static const unsigned int kMIN_COUNT_FOR_MEMSET_TO_BE_FAST = 16;
- if (numVbs <= 0) {
- return NULL;
- }
-
SkDEBUGCODE(this->validate();)
int pCnt;
bool dirtyAfterEdit = true;
switch (verb) {
case SkPath::kMove_Verb:
- fLastMoveToIndex = fPointCnt + numVbs - 1;
pCnt = numVbs;
dirtyAfterEdit = false;
break;
@@ -330,8 +310,6 @@
break;
case SkPath::kClose_Verb:
SkDEBUGFAIL("growForRepeatedVerb called for kClose_Verb");
- // signal that we need a moveTo to follow us (unless we're done)
- fLastMoveToIndex ^= ~fLastMoveToIndex >> (8 * sizeof(fLastMoveToIndex) - 1);
pCnt = 0;
dirtyAfterEdit = false;
break;
@@ -383,8 +361,6 @@
bool dirtyAfterEdit = true;
switch (verb) {
case SkPath::kMove_Verb:
- // remember our index
- fLastMoveToIndex = fPointCnt;
pCnt = 1;
dirtyAfterEdit = false;
break;
@@ -405,8 +381,6 @@
pCnt = 3;
break;
case SkPath::kClose_Verb:
- // signal that we need a moveTo to follow us (unless we're done)
- fLastMoveToIndex ^= ~fLastMoveToIndex >> (8 * sizeof(fLastMoveToIndex) - 1);
pCnt = 0;
dirtyAfterEdit = false;
break;
@@ -486,34 +460,23 @@
#ifdef SK_DEBUG_PATH
uint32_t mask = 0;
- int lastMoveToIndex = kINITIAL_LASTMOVETOINDEX_VALUE;
- int pointCnt = 0;
for (int i = 0; i < fVerbCnt; ++i) {
switch (fVerbs[~i]) {
case SkPath::kMove_Verb:
- lastMoveToIndex = pointCnt;
- ++pointCnt;
break;
case SkPath::kLine_Verb:
mask |= SkPath::kLine_SegmentMask;
- ++pointCnt;
break;
case SkPath::kQuad_Verb:
mask |= SkPath::kQuad_SegmentMask;
- pointCnt += 2;
break;
case SkPath::kConic_Verb:
mask |= SkPath::kConic_SegmentMask;
- pointCnt += 2;
break;
case SkPath::kCubic_Verb:
mask |= SkPath::kCubic_SegmentMask;
- pointCnt += 3;
break;
case SkPath::kClose_Verb:
- if (lastMoveToIndex >= 0) {
- lastMoveToIndex = ~lastMoveToIndex;
- }
break;
case SkPath::kDone_Verb:
SkDEBUGFAIL("Done verb shouldn't be recorded.");
@@ -524,8 +487,6 @@
}
}
SkASSERT(mask == fSegmentMask);
- SkASSERT(lastMoveToIndex == fLastMoveToIndex);
- SkASSERT(pointCnt == fPointCnt);
#endif // SK_DEBUG_PATH
}
#endif
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698