aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders/SkShader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shaders/SkShader.cpp')
-rw-r--r--src/shaders/SkShader.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/shaders/SkShader.cpp b/src/shaders/SkShader.cpp
index f3ffd26ef4..265f22beaa 100644
--- a/src/shaders/SkShader.cpp
+++ b/src/shaders/SkShader.cpp
@@ -67,26 +67,15 @@ void SkShaderBase::flatten(SkWriteBuffer& buffer) const {
}
}
-SkTCopyOnFirstWrite<SkMatrix>
-SkShaderBase::totalLocalMatrix(const SkMatrix* preLocalMatrix,
- const SkMatrix* postLocalMatrix) const {
- SkTCopyOnFirstWrite<SkMatrix> m(fLocalMatrix);
-
- if (preLocalMatrix) {
- m.writable()->preConcat(*preLocalMatrix);
- }
-
- if (postLocalMatrix) {
- m.writable()->postConcat(*postLocalMatrix);
- }
-
- return m;
-}
-
bool SkShaderBase::computeTotalInverse(const SkMatrix& ctm,
const SkMatrix* outerLocalMatrix,
SkMatrix* totalInverse) const {
- return SkMatrix::Concat(ctm, *this->totalLocalMatrix(outerLocalMatrix)).invert(totalInverse);
+ SkMatrix total = SkMatrix::Concat(ctm, fLocalMatrix);
+ if (outerLocalMatrix) {
+ total.preConcat(*outerLocalMatrix);
+ }
+
+ return total.invert(totalInverse);
}
bool SkShaderBase::asLuminanceColor(SkColor* colorPtr) const {