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

Unified Diff: src/core/SkFilterShader.h

Issue 207683004: Extract most of the mutable state of SkShader into a separate Context object. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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/SkDraw.cpp ('k') | src/core/SkFilterShader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkFilterShader.h
diff --git a/src/core/SkFilterShader.h b/src/core/SkFilterShader.h
index 11add0cf17c6304da59e9baf0289bfe04ad5a98c..4ef45772482bf0cf6d7e06730bd9dc0378ac8fc0 100644
--- a/src/core/SkFilterShader.h
+++ b/src/core/SkFilterShader.h
@@ -17,12 +17,29 @@ public:
SkFilterShader(SkShader* shader, SkColorFilter* filter);
virtual ~SkFilterShader();
- virtual uint32_t getFlags() SK_OVERRIDE;
- virtual bool setContext(const SkBitmap&, const SkPaint&,
- const SkMatrix&) SK_OVERRIDE;
- virtual void endContext() SK_OVERRIDE;
- virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE;
- virtual void shadeSpan16(int x, int y, uint16_t[], int count) SK_OVERRIDE;
+ virtual bool validContext(const SkBitmap&, const SkPaint&,
+ const SkMatrix&, SkMatrix* totalInverse = NULL) const SK_OVERRIDE;
+ virtual SkShader::Context* createContext(const SkBitmap&, const SkPaint&,
+ const SkMatrix&, void* storage) const SK_OVERRIDE;
+ virtual size_t contextSize() const SK_OVERRIDE;
+
+ class FilterShaderContext : public SkShader::Context {
+ public:
+ // Takes ownership of shaderContext and calls its destructor.
+ FilterShaderContext(const SkFilterShader& filterShader, SkShader::Context* shaderContext,
+ const SkBitmap& device, const SkPaint& paint, const SkMatrix& matrix);
+ virtual ~FilterShaderContext();
+
+ virtual uint32_t getFlags() const SK_OVERRIDE;
+
+ virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE;
+ virtual void shadeSpan16(int x, int y, uint16_t[], int count) SK_OVERRIDE;
+
+ private:
+ SkShader::Context* fShaderContext;
+
+ typedef SkShader::Context INHERITED;
+ };
SK_TO_STRING_OVERRIDE()
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkFilterShader)
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkFilterShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698