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

Unified Diff: src/core/SkDraw.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/SkComposeShader.cpp ('k') | src/core/SkFilterShader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index f9e06e52326cb2d4ddb4d2ca7457f8cad21cb551..c4f5f74eefb93ea0ca539e28b079d4e4125c4149 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -2353,14 +2353,12 @@ class SkTriColorShader : public SkShader {
public:
SkTriColorShader() {}
- virtual SkShader::Context* createContext(
- const SkBitmap&, const SkPaint&, const SkMatrix&, void*) const SK_OVERRIDE;
+ virtual SkShader::Context* createContext(const ContextRec&, void*) const SK_OVERRIDE;
virtual size_t contextSize() const SK_OVERRIDE;
class TriColorShaderContext : public SkShader::Context {
public:
- TriColorShaderContext(const SkTriColorShader& shader, const SkBitmap& device,
- const SkPaint& paint, const SkMatrix& matrix);
+ TriColorShaderContext(const SkTriColorShader& shader, const ContextRec&);
virtual ~TriColorShaderContext();
bool setup(const SkPoint pts[], const SkColor colors[], int, int, int);
@@ -2384,13 +2382,12 @@ private:
typedef SkShader INHERITED;
};
-SkShader::Context* SkTriColorShader::createContext(const SkBitmap& device, const SkPaint& paint,
- const SkMatrix& matrix, void* storage) const {
- if (!this->validContext(device, paint, matrix)) {
+SkShader::Context* SkTriColorShader::createContext(const ContextRec& rec, void* storage) const {
+ if (!this->validContext(rec)) {
return NULL;
}
- return SkNEW_PLACEMENT_ARGS(storage, TriColorShaderContext, (*this, device, paint, matrix));
+ return SkNEW_PLACEMENT_ARGS(storage, TriColorShaderContext, (*this, rec));
}
bool SkTriColorShader::TriColorShaderContext::setup(const SkPoint pts[], const SkColor colors[],
@@ -2430,10 +2427,9 @@ static int ScalarTo256(SkScalar v) {
}
-SkTriColorShader::TriColorShaderContext::TriColorShaderContext(
- const SkTriColorShader& shader, const SkBitmap& device,
- const SkPaint& paint, const SkMatrix& matrix)
- : INHERITED(shader, device, paint, matrix) {}
+SkTriColorShader::TriColorShaderContext::TriColorShaderContext(const SkTriColorShader& shader,
+ const ContextRec& rec)
+ : INHERITED(shader, rec) {}
SkTriColorShader::TriColorShaderContext::~TriColorShaderContext() {}
« no previous file with comments | « src/core/SkComposeShader.cpp ('k') | src/core/SkFilterShader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698