1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/include/effects/SkTransparentShader.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,37 @@ 1.4 +/* 1.5 + * Copyright 2006 The Android Open Source Project 1.6 + * 1.7 + * Use of this source code is governed by a BSD-style license that can be 1.8 + * found in the LICENSE file. 1.9 + */ 1.10 + 1.11 +#ifndef SkTransparentShader_DEFINED 1.12 +#define SkTransparentShader_DEFINED 1.13 + 1.14 +#include "SkShader.h" 1.15 + 1.16 +class SK_API SkTransparentShader : public SkShader { 1.17 +public: 1.18 + SkTransparentShader() {} 1.19 + 1.20 + virtual uint32_t getFlags() SK_OVERRIDE; 1.21 + virtual bool setContext(const SkBitmap& device, 1.22 + const SkPaint& paint, 1.23 + const SkMatrix& matrix) SK_OVERRIDE; 1.24 + virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE; 1.25 + virtual void shadeSpan16(int x, int y, uint16_t span[], int count) SK_OVERRIDE; 1.26 + 1.27 + SK_TO_STRING_OVERRIDE() 1.28 + SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTransparentShader) 1.29 + 1.30 +private: 1.31 + // these are a cache from the call to setContext() 1.32 + const SkBitmap* fDevice; 1.33 + uint8_t fAlpha; 1.34 + 1.35 + SkTransparentShader(SkReadBuffer& buffer) : INHERITED(buffer) {} 1.36 + 1.37 + typedef SkShader INHERITED; 1.38 +}; 1.39 + 1.40 +#endif