michael@0: /* michael@0: * Copyright 2006 The Android Open Source Project 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: #ifndef SkTransparentShader_DEFINED michael@0: #define SkTransparentShader_DEFINED michael@0: michael@0: #include "SkShader.h" michael@0: michael@0: class SK_API SkTransparentShader : public SkShader { michael@0: public: michael@0: SkTransparentShader() {} michael@0: michael@0: virtual uint32_t getFlags() SK_OVERRIDE; michael@0: virtual bool setContext(const SkBitmap& device, michael@0: const SkPaint& paint, michael@0: const SkMatrix& matrix) SK_OVERRIDE; michael@0: virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE; michael@0: virtual void shadeSpan16(int x, int y, uint16_t span[], int count) SK_OVERRIDE; michael@0: michael@0: SK_TO_STRING_OVERRIDE() michael@0: SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTransparentShader) michael@0: michael@0: private: michael@0: // these are a cache from the call to setContext() michael@0: const SkBitmap* fDevice; michael@0: uint8_t fAlpha; michael@0: michael@0: SkTransparentShader(SkReadBuffer& buffer) : INHERITED(buffer) {} michael@0: michael@0: typedef SkShader INHERITED; michael@0: }; michael@0: michael@0: #endif