Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(165)

Unified Diff: src/core/SkLocalMatrixShader.cpp

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkLocalMatrixShader.cpp
diff --git a/src/core/SkLocalMatrixShader.cpp b/src/core/SkLocalMatrixShader.cpp
index c77f38d6d68bcf53d6a230bce164d3f8a32a6ce3..13623207712f8d7a697f72515cd9fff70517aafb 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());
}

Powered by Google App Engine
This is Rietveld 408576698