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

Unified Diff: src/core/SkShader.cpp

Issue 263293005: add local-matrix to shader::context (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add/fix comments Created 6 years, 7 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/SkPictureShader.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkShader.cpp
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index 8e6112ae7d988add767dd95298a1fe80d05572d3..0c954f869b359522263c77804b9fe25e74159da9 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -53,6 +53,10 @@ bool SkShader::computeTotalInverse(const ContextRec& rec, SkMatrix* totalInverse
total.setConcat(*m, this->getLocalMatrix());
m = &total;
}
+ if (rec.fLocalMatrix) {
+ total.setConcat(*m, *rec.fLocalMatrix);
+ m = &total;
+ }
return m->invert(totalInverse);
}
@@ -63,7 +67,7 @@ SkShader::Context* SkShader::createContext(const ContextRec& rec, void* storage)
return this->onCreateContext(rec, storage);
}
-SkShader::Context* SkShader::onCreateContext(const ContextRec&, void*) const {
+SkShader::Context* SkShader::onCreateContext(const ContextRec& rec, void*) const {
return NULL;
}
@@ -72,7 +76,7 @@ size_t SkShader::contextSize() const {
}
SkShader::Context::Context(const SkShader& shader, const ContextRec& rec)
- : fShader(shader)
+ : fShader(shader), fCTM(*rec.fMatrix)
{
// Because the context parameters must be valid at this point, we know that the matrix is
// invertible.
« no previous file with comments | « src/core/SkPictureShader.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698