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

Unified Diff: src/core/SkFilterShader.cpp

Issue 264843006: create struct to hold all the params passed around for shader::context (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address review comments Created 6 years, 8 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/SkFilterShader.h ('k') | src/core/SkPictureShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkFilterShader.cpp
diff --git a/src/core/SkFilterShader.cpp b/src/core/SkFilterShader.cpp
index 5c5e8f317c020997ec4ca8b2ba7524fd275b4239..f1cc68d028954abcb9d3f22f82322e75cd234366 100644
--- a/src/core/SkFilterShader.cpp
+++ b/src/core/SkFilterShader.cpp
@@ -55,41 +55,30 @@ uint32_t SkFilterShader::FilterShaderContext::getFlags() const {
return shaderF;
}
-SkShader::Context* SkFilterShader::createContext(const SkBitmap& device,
- const SkPaint& paint,
- const SkMatrix& matrix,
- void* storage) const {
- if (!this->validContext(device, paint, matrix)) {
+SkShader::Context* SkFilterShader::createContext(const ContextRec& rec, void* storage) const {
+ if (!this->validContext(rec, NULL)) {
return NULL;
}
char* shaderContextStorage = (char*)storage + sizeof(FilterShaderContext);
- SkShader::Context* shaderContext = fShader->createContext(device, paint, matrix,
- shaderContextStorage);
+ SkShader::Context* shaderContext = fShader->createContext(rec, shaderContextStorage);
SkASSERT(shaderContext);
- return SkNEW_PLACEMENT_ARGS(storage, FilterShaderContext,
- (*this, shaderContext, device, paint, matrix));
+ return SkNEW_PLACEMENT_ARGS(storage, FilterShaderContext, (*this, shaderContext, rec));
}
size_t SkFilterShader::contextSize() const {
return sizeof(FilterShaderContext) + fShader->contextSize();
}
-bool SkFilterShader::validContext(const SkBitmap& device,
- const SkPaint& paint,
- const SkMatrix& matrix,
- SkMatrix* totalInverse) const {
- return this->INHERITED::validContext(device, paint, matrix, totalInverse) &&
- fShader->validContext(device, paint, matrix);
+bool SkFilterShader::validContext(const ContextRec& rec, SkMatrix* totalInverse) const {
+ return this->INHERITED::validContext(rec, totalInverse) && fShader->validContext(rec);
}
SkFilterShader::FilterShaderContext::FilterShaderContext(const SkFilterShader& filterShader,
SkShader::Context* shaderContext,
- const SkBitmap& device,
- const SkPaint& paint,
- const SkMatrix& matrix)
- : INHERITED(filterShader, device, paint, matrix)
+ const ContextRec& rec)
+ : INHERITED(filterShader, rec)
, fShaderContext(shaderContext) {}
SkFilterShader::FilterShaderContext::~FilterShaderContext() {
« no previous file with comments | « src/core/SkFilterShader.h ('k') | src/core/SkPictureShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698