diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkNormalMapSource.cpp | 11 | ||||
-rw-r--r-- | src/core/SkShader.cpp | 11 |
2 files changed, 8 insertions, 14 deletions
diff --git a/src/core/SkNormalMapSource.cpp b/src/core/SkNormalMapSource.cpp index 5da9467ff7..71e5565ac8 100644 --- a/src/core/SkNormalMapSource.cpp +++ b/src/core/SkNormalMapSource.cpp @@ -174,15 +174,12 @@ size_t SkNormalMapSourceImpl::providerSize(const SkShader::ContextRec& rec) cons bool SkNormalMapSourceImpl::computeNormTotalInverse(const SkShader::ContextRec& rec, SkMatrix* normTotalInverse) const { - SkMatrix total; - total.setConcat(*rec.fMatrix, fMapShader->getLocalMatrix()); - - const SkMatrix* m = &total; + SkMatrix total = SkMatrix::Concat(*rec.fMatrix, fMapShader->getLocalMatrix()); if (rec.fLocalMatrix) { - total.setConcat(*m, *rec.fLocalMatrix); - m = &total; + total.preConcat(*rec.fLocalMatrix); } - return m->invert(normTotalInverse); + + return total.invert(normTotalInverse); } #define BUFFER_MAX 16 diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp index 3a2ec7b912..cbe2f5dc89 100644 --- a/src/core/SkShader.cpp +++ b/src/core/SkShader.cpp @@ -66,15 +66,12 @@ void SkShader::flatten(SkWriteBuffer& buffer) const { } bool SkShader::computeTotalInverse(const ContextRec& rec, SkMatrix* totalInverse) const { - SkMatrix total; - total.setConcat(*rec.fMatrix, fLocalMatrix); - - const SkMatrix* m = &total; + SkMatrix total = SkMatrix::Concat(*rec.fMatrix, fLocalMatrix); if (rec.fLocalMatrix) { - total.setConcat(*m, *rec.fLocalMatrix); - m = &total; + total.preConcat(*rec.fLocalMatrix); } - return m->invert(totalInverse); + + return total.invert(totalInverse); } bool SkShader::asLuminanceColor(SkColor* colorPtr) const { |