diff options
author | 2016-09-16 07:21:28 -0700 | |
---|---|---|
committer | 2016-09-16 07:21:28 -0700 | |
commit | 6c3baa66fa38349917783dde1ff2ee21684619fb (patch) | |
tree | d952c6437fb95ef1f296467577e133a20be1cdfc /src | |
parent | 40efbe85525a4dceefb1ce46c036c01813492602 (diff) |
Make Sk2DPathEffect thread safe.
SkPathEffects must be thread safe, but SkMatrix is only thread safe if
the type mask has already been computed. The constructor for
Sk2DPathEffect is currently making the call to 'invert' which sets the
type mask, but it is being called with the passed matrix as opposed to
the local copy.
BUG=skia:5765
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2340133004
Review-Url: https://codereview.chromium.org/2340133004
Diffstat (limited to 'src')
-rw-r--r-- | src/effects/Sk2DPathEffect.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/effects/Sk2DPathEffect.cpp b/src/effects/Sk2DPathEffect.cpp index 52e3fa5e1c..e7ef54b6f7 100644 --- a/src/effects/Sk2DPathEffect.cpp +++ b/src/effects/Sk2DPathEffect.cpp @@ -14,7 +14,8 @@ #include "SkStrokeRec.h" Sk2DPathEffect::Sk2DPathEffect(const SkMatrix& mat) : fMatrix(mat) { - fMatrixIsInvertible = mat.invert(&fInverse); + // Calling invert will set the type mask on both matrices, making them thread safe. + fMatrixIsInvertible = fMatrix.invert(&fInverse); } bool Sk2DPathEffect::filterPath(SkPath* dst, const SkPath& src, |