| Index: include/core/SkEmptyShader.h
|
| diff --git a/include/core/SkEmptyShader.h b/include/core/SkEmptyShader.h
|
| index 3f7dae41a9f4911490c191d4c56463902a4ec4fb..1e54e5f7bfa5bf9e9a02dcf697196e80707baec5 100644
|
| --- a/include/core/SkEmptyShader.h
|
| +++ b/include/core/SkEmptyShader.h
|
| @@ -15,20 +15,23 @@
|
|
|
| /**
|
| * \class SkEmptyShader
|
| - * A Shader that always draws nothing. Its setContext always returns false,
|
| - * so it never expects that its shadeSpan() methods will get called.
|
| + * A Shader that always draws nothing. Its createContext always returns NULL.
|
| */
|
| class SK_API SkEmptyShader : public SkShader {
|
| public:
|
| SkEmptyShader() {}
|
|
|
| - virtual uint32_t getFlags() SK_OVERRIDE;
|
| - virtual uint8_t getSpan16Alpha() const SK_OVERRIDE;
|
| - virtual bool setContext(const SkBitmap&, const SkPaint&,
|
| - const SkMatrix&) SK_OVERRIDE;
|
| - virtual void shadeSpan(int x, int y, SkPMColor span[], int count) SK_OVERRIDE;
|
| - virtual void shadeSpan16(int x, int y, uint16_t span[], int count) SK_OVERRIDE;
|
| - virtual void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) SK_OVERRIDE;
|
| + virtual size_t contextSize() const SK_OVERRIDE {
|
| + // Even though createContext returns NULL we have to return a value of at least
|
| + // sizeof(SkShader::Context) to satisfy SkSmallAllocator.
|
| + return sizeof(SkShader::Context);
|
| + }
|
| +
|
| + virtual SkShader::Context* createContext(const SkBitmap&, const SkPaint&,
|
| + const SkMatrix&, void*) const SK_OVERRIDE {
|
| + // validContext returns false.
|
| + return NULL;
|
| + }
|
|
|
| SK_DEVELOPER_TO_STRING()
|
| SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmptyShader)
|
| @@ -36,6 +39,10 @@ public:
|
| protected:
|
| SkEmptyShader(SkReadBuffer& buffer) : INHERITED(buffer) {}
|
|
|
| + virtual bool validContext(const SkBitmap&, const SkPaint&,
|
| + const SkMatrix&, SkMatrix* totalInverse = NULL) SK_OVERRIDE {
|
| + return false;
|
| + }
|
| private:
|
| typedef SkShader INHERITED;
|
| };
|
|
|