Upstream android changes.
reviewed by: reed
git-svn-id: http://skia.googlecode.com/svn/trunk@1134 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 6aed669..5ddc31d 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -97,11 +97,18 @@
SkPath::SkPath() : fBoundsIsDirty(true), fFillType(kWinding_FillType) {
fIsConvex = false; // really should be kUnknown
+#ifdef ANDROID
+ fGenerationID = 0;
+#endif
}
SkPath::SkPath(const SkPath& src) {
SkDEBUGCODE(src.validate();)
*this = src;
+#ifdef ANDROID
+ // the assignment operator above increments the ID so correct for that here
+ fGenerationID--;
+#endif
}
SkPath::~SkPath() {
@@ -118,6 +125,7 @@
fFillType = src.fFillType;
fBoundsIsDirty = src.fBoundsIsDirty;
fIsConvex = src.fIsConvex;
+ GEN_ID_INC;
}
SkDEBUGCODE(this->validate();)
return *this;
@@ -140,14 +148,22 @@
SkTSwap<uint8_t>(fFillType, other.fFillType);
SkTSwap<uint8_t>(fBoundsIsDirty, other.fBoundsIsDirty);
SkTSwap<uint8_t>(fIsConvex, other.fIsConvex);
+ GEN_ID_INC;
}
}
+#ifdef ANDROID
+uint32_t SkPath::getGenerationID() const {
+ return fGenerationID;
+}
+#endif
+
void SkPath::reset() {
SkDEBUGCODE(this->validate();)
fPts.reset();
fVerbs.reset();
+ GEN_ID_INC;
fBoundsIsDirty = true;
fIsConvex = false; // really should be kUnknown
}
@@ -157,6 +173,7 @@
fPts.rewind();
fVerbs.rewind();
+ GEN_ID_INC;
fBoundsIsDirty = true;
fIsConvex = false; // really should be kUnknown
}
@@ -214,6 +231,7 @@
this->moveTo(x, y);
} else {
fPts[count - 1].set(x, y);
+ GEN_ID_INC;
}
}
@@ -251,6 +269,7 @@
}
pt->set(x, y);
+ GEN_ID_INC;
fBoundsIsDirty = true;
}
@@ -270,6 +289,7 @@
fPts.append()->set(x, y);
*fVerbs.append() = kLine_Verb;
+ GEN_ID_INC;
fBoundsIsDirty = true;
}
@@ -292,6 +312,7 @@
pts[1].set(x2, y2);
*fVerbs.append() = kQuad_Verb;
+ GEN_ID_INC;
fBoundsIsDirty = true;
}
@@ -315,6 +336,7 @@
pts[2].set(x3, y3);
*fVerbs.append() = kCubic_Verb;
+ GEN_ID_INC;
fBoundsIsDirty = true;
}
@@ -336,6 +358,7 @@
case kQuad_Verb:
case kCubic_Verb:
*fVerbs.append() = kClose_Verb;
+ GEN_ID_INC;
break;
default:
// don't add a close if the prev wasn't a primitive
@@ -953,6 +976,7 @@
matrix.mapRect(&dst->fBounds, fBounds);
dst->fBoundsIsDirty = false;
} else {
+ GEN_ID_PTR_INC(dst);
dst->fBoundsIsDirty = true;
}
@@ -1260,6 +1284,7 @@
buffer.read(fPts.begin(), sizeof(SkPoint) * fPts.count());
buffer.read(fVerbs.begin(), fVerbs.count());
+ GEN_ID_INC;
fBoundsIsDirty = true;
SkDEBUGCODE(this->validate();)