2008-12-17 15:59:43 +00:00
|
|
|
/*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Copyright 2006 The Android Open Source Project
|
2008-12-17 15:59:43 +00:00
|
|
|
*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
2008-12-17 15:59:43 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SkTransparentShader_DEFINED
|
|
|
|
#define SkTransparentShader_DEFINED
|
|
|
|
|
|
|
|
#include "SkShader.h"
|
|
|
|
|
2012-10-12 14:41:39 +00:00
|
|
|
class SK_API SkTransparentShader : public SkShader {
|
2008-12-17 15:59:43 +00:00
|
|
|
public:
|
|
|
|
SkTransparentShader() {}
|
2011-12-07 15:17:50 +00:00
|
|
|
|
|
|
|
virtual uint32_t getFlags() SK_OVERRIDE;
|
2012-10-12 14:41:39 +00:00
|
|
|
virtual bool setContext(const SkBitmap& device,
|
|
|
|
const SkPaint& paint,
|
|
|
|
const SkMatrix& matrix) SK_OVERRIDE;
|
2011-12-07 15:17:50 +00:00
|
|
|
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;
|
2008-12-17 15:59:43 +00:00
|
|
|
|
2013-01-15 20:17:47 +00:00
|
|
|
SK_DEVELOPER_TO_STRING()
|
2012-03-26 17:57:35 +00:00
|
|
|
SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkTransparentShader)
|
2011-12-07 15:17:50 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
private:
|
|
|
|
// these are a cache from the call to setContext()
|
|
|
|
const SkBitmap* fDevice;
|
|
|
|
uint8_t fAlpha;
|
|
|
|
|
|
|
|
SkTransparentShader(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {}
|
2012-08-23 18:09:54 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
typedef SkShader INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|