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 |
} |
} |