diff options
author | Romain Guy <romainguy@google.com> | 2012-09-04 10:38:06 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-09-04 10:38:06 -0700 |
commit | 469152828df90903d40f5da59269ed493d69e3aa (patch) | |
tree | 9c69b05d023f6dd5e9331dec57060a192b51d7c3 | |
parent | 9c22695ba576d6ff9b4ad94fbd61a02d3792b2e1 (diff) | |
parent | ebb0af8e21433525397cefdec3a8903e3da966b0 (diff) | |
download | skia-469152828df90903d40f5da59269ed493d69e3aa.tar.gz |
am ebb0af8e: Increment SkPath\'s generation id when transform() is called
* commit 'ebb0af8e21433525397cefdec3a8903e3da966b0':
Increment SkPath's generation id when transform() is called
-rw-r--r-- | src/core/SkPath.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp index 7f58ae347e..34369967d3 100644 --- a/src/core/SkPath.cpp +++ b/src/core/SkPath.cpp @@ -1208,6 +1208,7 @@ void SkPath::transform(const SkMatrix& matrix, SkPath* dst) const { } } + // swap() will increment the gen id if needed dst->swap(tmp); matrix.mapPoints(dst->fPts.begin(), dst->fPts.count()); } else { @@ -1218,7 +1219,6 @@ void SkPath::transform(const SkMatrix& matrix, SkPath* dst) const { matrix.mapRect(&dst->fBounds, fBounds); dst->fBoundsIsDirty = false; } else { - GEN_ID_PTR_INC(dst); dst->fBoundsIsDirty = true; } @@ -1229,7 +1229,12 @@ void SkPath::transform(const SkMatrix& matrix, SkPath* dst) const { dst->fSegmentMask = fSegmentMask; dst->fConvexity = fConvexity; } + + if (!matrix.isIdentity()) { + GEN_ID_PTR_INC(dst); + } matrix.mapPoints(dst->fPts.begin(), fPts.begin(), fPts.count()); + SkDEBUGCODE(dst->validate();) } } |