diff options
author | Torne (Richard Coles) <torne@google.com> | 2014-05-14 12:13:15 +0100 |
---|---|---|
committer | Torne (Richard Coles) <torne@google.com> | 2014-05-14 12:13:15 +0100 |
commit | 6b0bad3aba066dc8d7d47a5f6738ebf773ffc2e9 (patch) | |
tree | ad988be7ad87928b7b98c44f2def4cce7d3330b6 /core/SkPictureShader.h | |
parent | 27ab20dffff01006f5d20fdb2b3f4ea503d69114 (diff) | |
parent | d60f7edf0fa7eb2eb7c99de486abfe61ad3dcd69 (diff) | |
download | src-6b0bad3aba066dc8d7d47a5f6738ebf773ffc2e9.tar.gz |
This commit was generated by merge_to_master.py.
Change-Id: I9d3335dcb08fc53d18bec993b89047b409bd7eb1
Diffstat (limited to 'core/SkPictureShader.h')
-rw-r--r-- | core/SkPictureShader.h | 59 |
1 files changed, 27 insertions, 32 deletions
diff --git a/core/SkPictureShader.h b/core/SkPictureShader.h index d1be0591..27fb674b 100644 --- a/core/SkPictureShader.h +++ b/core/SkPictureShader.h @@ -21,37 +21,11 @@ class SkPicture; */ class SkPictureShader : public SkShader { public: - static SkPictureShader* Create(SkPicture*, TileMode, TileMode); + static SkPictureShader* Create(SkPicture*, TileMode, TileMode, const SkMatrix* = NULL); virtual ~SkPictureShader(); - virtual bool validContext(const SkBitmap&, const SkPaint&, - const SkMatrix&, SkMatrix* totalInverse = NULL) const SK_OVERRIDE; - virtual SkShader::Context* createContext(const SkBitmap& device, const SkPaint& paint, - const SkMatrix& matrix, void* storage) const - SK_OVERRIDE; virtual size_t contextSize() const SK_OVERRIDE; - class PictureShaderContext : public SkShader::Context { - public: - PictureShaderContext(const SkPictureShader& shader, const SkBitmap& device, - const SkPaint& paint, const SkMatrix& matrix, - SkShader* bitmapShader); - virtual ~PictureShaderContext(); - - virtual uint32_t getFlags() const SK_OVERRIDE; - - virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE; - virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRIDE; - virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRIDE; - - private: - SkAutoTUnref<SkShader> fBitmapShader; - SkShader::Context* fBitmapShaderContext; - void* fBitmapShaderContextStorage; - - typedef SkShader::Context INHERITED; - }; - SK_TO_STRING_OVERRIDE() SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPictureShader) @@ -62,14 +36,12 @@ public: protected: SkPictureShader(SkReadBuffer&); virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; + virtual Context* onCreateContext(const ContextRec&, void* storage) const SK_OVERRIDE; private: - SkPictureShader(SkPicture*, TileMode, TileMode); + SkPictureShader(SkPicture*, TileMode, TileMode, const SkMatrix* = NULL); - SkShader* validInternal(const SkBitmap& device, const SkPaint& paint, - const SkMatrix& matrix, SkMatrix* totalInverse) const; - - SkShader* refBitmapShader(const SkMatrix&) const; + SkShader* refBitmapShader(const SkMatrix&, const SkMatrix* localMatrix) const; SkPicture* fPicture; TileMode fTmx, fTmy; @@ -79,6 +51,29 @@ private: mutable SkSize fCachedTileScale; mutable SkMatrix fCachedLocalMatrix; + class PictureShaderContext : public SkShader::Context { + public: + static Context* Create(void* storage, const SkPictureShader&, const ContextRec&, + SkShader* bitmapShader); + + virtual ~PictureShaderContext(); + + virtual uint32_t getFlags() const SK_OVERRIDE; + + virtual ShadeProc asAShadeProc(void** ctx) SK_OVERRIDE; + virtual void shadeSpan(int x, int y, SkPMColor dstC[], int count) SK_OVERRIDE; + virtual void shadeSpan16(int x, int y, uint16_t dstC[], int count) SK_OVERRIDE; + + private: + PictureShaderContext(const SkPictureShader&, const ContextRec&, SkShader* bitmapShader); + + SkAutoTUnref<SkShader> fBitmapShader; + SkShader::Context* fBitmapShaderContext; + void* fBitmapShaderContextStorage; + + typedef SkShader::Context INHERITED; + }; + typedef SkShader INHERITED; }; |