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

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: rebase Created 6 years, 4 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
« no previous file with comments | « src/core/SkLocalMatrixShader.h ('k') | src/core/SkPathEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « src/core/SkLocalMatrixShader.h ('k') | src/core/SkPathEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698