Index: include/effects/SkTransparentShader.h |
diff --git a/include/effects/SkTransparentShader.h b/include/effects/SkTransparentShader.h |
index 790e5ae9fd2549c4bc650a333c38492cab13ba50..7428d442e3f67b666019af5a7f4d22ee4888a30b 100644 |
--- a/include/effects/SkTransparentShader.h |
+++ b/include/effects/SkTransparentShader.h |
@@ -14,31 +14,21 @@ |
public: |
SkTransparentShader() {} |
- 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 TransparentShaderContext : public SkShader::Context { |
- public: |
- TransparentShaderContext(const SkTransparentShader& shader, const SkBitmap& device, |
- const SkPaint& paint, const SkMatrix& matrix); |
- virtual ~TransparentShaderContext(); |
- |
- 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 span[], int count) SK_OVERRIDE; |
- |
- private: |
- const SkBitmap* fDevice; |
- |
- typedef SkShader::Context INHERITED; |
- }; |
+ virtual uint32_t getFlags() SK_OVERRIDE; |
+ virtual bool setContext(const SkBitmap& device, |
+ const SkPaint& paint, |
+ const SkMatrix& matrix) SK_OVERRIDE; |
+ virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE; |
+ virtual void shadeSpan16(int x, int y, uint16_t span[], int count) SK_OVERRIDE; |
SK_TO_STRING_OVERRIDE() |
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTransparentShader) |
private: |
+ // these are a cache from the call to setContext() |
+ const SkBitmap* fDevice; |
+ uint8_t fAlpha; |
+ |
SkTransparentShader(SkReadBuffer& buffer) : INHERITED(buffer) {} |
typedef SkShader INHERITED; |