aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-01-26 16:23:06 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-26 22:13:17 +0000
commitbbeb5730e7365d0952d3dbb5846001708b9517a3 (patch)
treed8206e1a4d2dfa81edcf8459732445d8df5f8bab /src/core
parent690dd5e3747cf36b42d37fcd460b357c8e2c6f92 (diff)
Simplify SkShader::ContextRec::fLocalMatrix handling
Minor cleanup. R=robertphillips@google.com,reed@google.com Change-Id: I1a27af61e3e3bb5e895c9a3265da6b0408234165 Reviewed-on: https://skia-review.googlesource.com/7632 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkNormalMapSource.cpp11
-rw-r--r--src/core/SkShader.cpp11
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 {