Index: src/core/SkLocalMatrixShader.cpp |
diff --git a/src/core/SkLocalMatrixShader.cpp b/src/core/SkLocalMatrixShader.cpp |
index e5d92484700bbf593ab4e1f7119bc15045e72b98..62840dd3af63e51a7c5b269fe645488492fd2b43 100644 |
--- a/src/core/SkLocalMatrixShader.cpp |
+++ b/src/core/SkLocalMatrixShader.cpp |
@@ -7,6 +7,7 @@ |
#include "SkLocalMatrixShader.h" |
+#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING |
SkLocalMatrixShader::SkLocalMatrixShader(SkReadBuffer& buffer) : INHERITED(buffer) { |
if (buffer.isVersionLT(SkReadBuffer::kSimplifyLocalMatrix_Version)) { |
buffer.readMatrix(&(INHERITED::fLocalMatrix)); |
@@ -16,9 +17,20 @@ SkLocalMatrixShader::SkLocalMatrixShader(SkReadBuffer& buffer) : INHERITED(buffe |
sk_throw(); |
} |
} |
+#endif |
+ |
+SkFlattenable* SkLocalMatrixShader::CreateProc(SkReadBuffer& buffer) { |
+ SkMatrix lm; |
+ buffer.readMatrix(&lm); |
+ SkAutoTUnref<SkShader> shader(buffer.readShader()); |
+ if (!shader.get()) { |
+ return NULL; |
+ } |
+ return SkShader::CreateLocalMatrixShader(shader, lm); |
+} |
void SkLocalMatrixShader::flatten(SkWriteBuffer& buffer) const { |
- this->INHERITED::flatten(buffer); |
+ buffer.writeMatrix(this->getLocalMatrix()); |
buffer.writeFlattenable(fProxyShader.get()); |
} |