diff options
author | 2014-04-16 10:16:39 +0000 | |
---|---|---|
committer | 2014-04-16 10:16:39 +0000 | |
commit | 001f4ed2fb62ecdc98ce2884d925de11b7516d23 (patch) | |
tree | 1acb3cdef582b7a33a97e6c6631c62320ca39331 /src/core/SkBlitter.h | |
parent | d1061e254af7fa8267dc1a5ed444d1c4b1743b6d (diff) |
Extract most of the mutable state of SkShader into a separate Context object.
SkShader currently stores some state during draw calls via setContext(...).
Move that mutable state into a separate SkShader::Context class that is
constructed on demand for the duration of the draw.
Calls to setContext() are replaced with createContext() which returns a context
corresponding to the shader object or NULL if the parameters to createContext
are invalid.
TEST=out/Debug/dm
BUG=skia:1976
R=scroggo@google.com, skyostil@chromium.org, tomhudson@chromium.org, senorblanco@chromium.org, reed@google.com, bungeman@google.com
Author: dominikg@chromium.org
Review URL: https://codereview.chromium.org/207683004
git-svn-id: http://skia.googlecode.com/svn/trunk@14216 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkBlitter.h')
-rw-r--r-- | src/core/SkBlitter.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/SkBlitter.h b/src/core/SkBlitter.h index d19a34badc..f76839e8b6 100644 --- a/src/core/SkBlitter.h +++ b/src/core/SkBlitter.h @@ -61,6 +61,13 @@ public: */ virtual bool isNullBlitter() const; + /** + * Special methods for SkShaderBlitter. On all other classes this is a no-op. + */ + virtual bool resetShaderContext(const SkBitmap& device, const SkPaint& paint, + const SkMatrix& matrix); + virtual SkShader::Context* getShaderContext() const; + ///@name non-virtual helpers void blitMaskRegion(const SkMask& mask, const SkRegion& clip); void blitRectRegion(const SkIRect& rect, const SkRegion& clip); |