michael@0: michael@0: /* michael@0: * Copyright 2011 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: michael@0: michael@0: #ifndef SkEmptyShader_DEFINED michael@0: #define SkEmptyShader_DEFINED michael@0: michael@0: #include "SkShader.h" michael@0: michael@0: /** michael@0: * \class SkEmptyShader michael@0: * A Shader that always draws nothing. Its setContext always returns false, michael@0: * so it never expects that its shadeSpan() methods will get called. michael@0: */ michael@0: class SK_API SkEmptyShader : public SkShader { michael@0: public: michael@0: SkEmptyShader() {} michael@0: michael@0: virtual uint32_t getFlags() SK_OVERRIDE; michael@0: virtual uint8_t getSpan16Alpha() const SK_OVERRIDE; michael@0: virtual bool setContext(const SkBitmap&, const SkPaint&, michael@0: const SkMatrix&) SK_OVERRIDE; michael@0: virtual void shadeSpan(int x, int y, SkPMColor span[], int count) SK_OVERRIDE; michael@0: virtual void shadeSpan16(int x, int y, uint16_t span[], int count) SK_OVERRIDE; michael@0: virtual void shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) SK_OVERRIDE; michael@0: michael@0: SK_TO_STRING_OVERRIDE() michael@0: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkEmptyShader) michael@0: michael@0: protected: michael@0: SkEmptyShader(SkReadBuffer& buffer) : INHERITED(buffer) {} michael@0: michael@0: private: michael@0: typedef SkShader INHERITED; michael@0: }; michael@0: michael@0: #endif