diff options
author | Romain Guy <romainguy@google.com> | 2012-09-04 10:27:48 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2012-09-04 10:27:48 -0700 |
commit | ebb0af8e21433525397cefdec3a8903e3da966b0 (patch) | |
tree | 9c69b05d023f6dd5e9331dec57060a192b51d7c3 | |
parent | efda4cbdca717675caf2459172a42c6f4fa43cf6 (diff) | |
download | external_skia-ebb0af8e21433525397cefdec3a8903e3da966b0.zip external_skia-ebb0af8e21433525397cefdec3a8903e3da966b0.tar.gz external_skia-ebb0af8e21433525397cefdec3a8903e3da966b0.tar.bz2 |
Increment SkPath's generation id when transform() is called
Change-Id: I2f164c30342620e1c0663e133ba671b4a3869b70
-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 7f58ae3..3436996 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();) } } |