Fix for SkPathRef::CreateTransformedCopy bug

https://codereview.chromium.org/99423004/



git-svn-id: http://skia.googlecode.com/svn/trunk/src@12464 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/core/SkPathRef.cpp b/core/SkPathRef.cpp
index 3ad5ae7..1678fdc 100644
--- a/core/SkPathRef.cpp
+++ b/core/SkPathRef.cpp
@@ -63,14 +63,20 @@
         return;
     }
 
-    bool dstUnique = (*dst)->unique();
-    if (!dstUnique) {
+    if (!(*dst)->unique()) {
         dst->reset(SkNEW(SkPathRef));
+    }
+
+    if (*dst != &src) {
         (*dst)->resetToSize(src.fVerbCnt, src.fPointCnt, src.fConicWeights.count());
         memcpy((*dst)->verbsMemWritable(), src.verbsMemBegin(), src.fVerbCnt * sizeof(uint8_t));
         (*dst)->fConicWeights = src.fConicWeights;
     }
 
+    SkASSERT((*dst)->countPoints() == src.countPoints());
+    SkASSERT((*dst)->countVerbs() == src.countVerbs());
+    SkASSERT((*dst)->fConicWeights.count() == src.fConicWeights.count());
+
     // Need to check this here in case (&src == dst)
     bool canXformBounds = !src.fBoundsIsDirty && matrix.rectStaysRect() && src.countPoints() > 1;