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

Unified Diff: src/core/SkLocalMatrixShader.cpp

Issue 386693003: Use SkShader's localMat for SkLocalMatrixShader. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Refine comment. 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
« no previous file with comments | « src/core/SkLocalMatrixShader.h ('k') | no next file » | 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 53580e6ac953f48cc983a59116b6996953f221c1..c77f38d6d68bcf53d6a230bce164d3f8a32a6ce3 100644
--- a/src/core/SkLocalMatrixShader.cpp
+++ b/src/core/SkLocalMatrixShader.cpp
@@ -8,7 +8,9 @@
#include "SkLocalMatrixShader.h"
SkLocalMatrixShader::SkLocalMatrixShader(SkReadBuffer& buffer) : INHERITED(buffer) {
- buffer.readMatrix(&fProxyLocalMatrix);
+ if (buffer.isVersionLT(SkReadBuffer::kSimplifyLocalMatrix_Version)) {
+ buffer.readMatrix(&(INHERITED::fLocalMatrix));
+ }
fProxyShader.reset(buffer.readShader());
if (NULL == fProxyShader.get()) {
sk_throw();
@@ -17,7 +19,6 @@ SkLocalMatrixShader::SkLocalMatrixShader(SkReadBuffer& buffer) : INHERITED(buffe
void SkLocalMatrixShader::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
- buffer.writeMatrix(fProxyLocalMatrix);
buffer.writeFlattenable(fProxyShader.get());
}
@@ -26,10 +27,10 @@ SkShader::Context* SkLocalMatrixShader::onCreateContext(const ContextRec& rec,
ContextRec newRec(rec);
SkMatrix tmp;
if (rec.fLocalMatrix) {
- tmp.setConcat(fProxyLocalMatrix, *rec.fLocalMatrix);
+ tmp.setConcat(this->getLocalMatrix(), *rec.fLocalMatrix);
newRec.fLocalMatrix = &tmp;
} else {
- newRec.fLocalMatrix = &fProxyLocalMatrix;
+ newRec.fLocalMatrix = &this->getLocalMatrix();
}
return fProxyShader->createContext(newRec, storage);
}
« no previous file with comments | « src/core/SkLocalMatrixShader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698