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

Unified Diff: src/core/SkPath.cpp

Issue 22471002: Restore SkPath(const SkPath&) to copy the generation ID on Android. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: uppercase Created 7 years, 4 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 875be9801e4d2910c2a757652abbb1c4a32395d3..b119e88f939527a1fee1d1d24a6d3f8f7e5053b4 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -185,11 +185,7 @@ void SkPath::resetFields() {
}
SkPath::SkPath(const SkPath& that)
- : fPathRef(SkRef(that.fPathRef.get()))
-#ifdef SK_BUILD_FOR_ANDROID
- , fGenerationID(0)
-#endif
-{
+ : fPathRef(SkRef(that.fPathRef.get())) {
this->copyFields(that);
SkDEBUGCODE(that.validate();)
}
@@ -221,8 +217,8 @@ void SkPath::copyFields(const SkPath& that) {
fIsFinite = that.fIsFinite;
fIsOval = that.fIsOval;
#ifdef SK_BUILD_FOR_ANDROID
- GEN_ID_INC;
- fSourcePath = NULL;
+ fGenerationID = that.fGenerationID;
bungeman-skia 2013/08/06 20:09:48 Similar situation to swap. Can't this make this ob
mtklein 2013/08/06 20:23:35 Done.
+ fSourcePath = NULL; // TODO(mtklein): follow up with Android: do we want to copy this too?
#endif
}
@@ -253,8 +249,13 @@ void SkPath::swap(SkPath& that) {
SkTSwap<uint8_t>(fDirection, that.fDirection);
SkTSwap<SkBool8>(fIsFinite, that.fIsFinite);
SkTSwap<SkBool8>(fIsOval, that.fIsOval);
+#ifdef SK_BUILD_FOR_ANDROID
+ // It doesn't really make sense to swap the generation IDs here, because they might go
+ // backwards. To be safe we increment both to mark them both as changed.
GEN_ID_INC;
GEN_ID_PTR_INC(&that);
+ SkTSwap<SkPath*>(fSourcePath, that.fSourcePath);
+#endif
}
}
« 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