#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();
void SkLocalMatrixShader::flatten(SkWriteBuffer& buffer) const {
this->INHERITED::flatten(buffer);
- buffer.writeMatrix(fProxyLocalMatrix);
buffer.writeFlattenable(fProxyShader.get());
}
ContextRec newRec(rec);
SkMatrix tmp;
if (rec.fLocalMatrix) {
- tmp.setConcat(fProxyLocalMatrix, *rec.fLocalMatrix);
+ tmp.setConcat(*rec.fLocalMatrix, this->getLocalMatrix());
newRec.fLocalMatrix = &tmp;
} else {
- newRec.fLocalMatrix = &fProxyLocalMatrix;
+ newRec.fLocalMatrix = &this->getLocalMatrix();
}
return fProxyShader->createContext(newRec, storage);
}