Index: src/core/SkShader.cpp |
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp |
index 8dbe6d7029618796d10346ac87fded59b6943603..ebe1a74cc2e6a7e11c9ec50de104348c79b5e3de 100644 |
--- a/src/core/SkShader.cpp |
+++ b/src/core/SkShader.cpp |
@@ -60,7 +60,7 @@ |
void SkShader::flatten(SkWriteBuffer& buffer) const { |
this->INHERITED::flatten(buffer); |
- bool hasLocalM = !fLocalMatrix.isIdentity(); |
+ bool hasLocalM = this->hasLocalMatrix(); |
buffer.writeBool(hasLocalM); |
if (hasLocalM) { |
buffer.writeMatrix(fLocalMatrix); |
@@ -68,10 +68,13 @@ |
} |
bool SkShader::computeTotalInverse(const ContextRec& rec, SkMatrix* totalInverse) const { |
- SkMatrix total; |
- total.setConcat(*rec.fMatrix, fLocalMatrix); |
- |
- const SkMatrix* m = &total; |
+ const SkMatrix* m = rec.fMatrix; |
+ SkMatrix total; |
+ |
+ if (this->hasLocalMatrix()) { |
+ total.setConcat(*m, this->getLocalMatrix()); |
+ m = &total; |
+ } |
if (rec.fLocalMatrix) { |
total.setConcat(*m, *rec.fLocalMatrix); |
m = &total; |
@@ -232,9 +235,9 @@ |
#ifndef SK_IGNORE_TO_STRING |
void SkShader::toString(SkString* str) const { |
- if (!fLocalMatrix.isIdentity()) { |
+ if (this->hasLocalMatrix()) { |
str->append(" "); |
- fLocalMatrix.toString(str); |
+ this->getLocalMatrix().toString(str); |
} |
} |
#endif |