Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkShader::Context Class Referenceabstract
Inheritance diagram for SkShader::Context:
SkPerlinNoiseShader::PerlinNoiseShaderContext

Classes

struct  BlitState
 

Public Types

typedef void(* BlitBW )(BlitState *, int x, int y, const SkPixmap &, int count)
 
typedef void(* BlitAA )(BlitState *, int x, int y, const SkPixmap &, int count, const SkAlpha[])
 
typedef void(* ShadeProc )(const void *ctx, int x, int y, SkPMColor[], int count)
 The const void* ctx is only const because all the implementations are const. More...
 

Public Member Functions

 Context (const SkShader &shader, const ContextRec &)
 
virtual uint32_t getFlags () const
 Called sometimes before drawing with this shader. More...
 
virtual void shadeSpan (int x, int y, SkPMColor[], int count)=0
 Called for each span of the object being drawn. More...
 
virtual void shadeSpan4f (int x, int y, SkPM4f[], int count)
 
bool chooseBlitProcs (const SkImageInfo &info, BlitState *state)
 
virtual ShadeProc asAShadeProc (void **ctx)
 
virtual void shadeSpanAlpha (int x, int y, uint8_t alpha[], int count)
 Similar to shadeSpan, but only returns the alpha-channel for a span. More...
 
virtual void set3DMask (const SkMask *)
 

Protected Types

enum  MatrixClass { kLinear_MatrixClass, kFixedStepInX_MatrixClass, kPerspective_MatrixClass }
 

Protected Member Functions

uint8_t getPaintAlpha () const
 
const SkMatrixgetTotalInverse () const
 
MatrixClass getInverseClass () const
 
const SkMatrixgetCTM () const
 
virtual bool onChooseBlitProcs (const SkImageInfo &, BlitState *)
 

Static Protected Member Functions

static MatrixClass ComputeMatrixClass (const SkMatrix &)
 

Protected Attributes

const SkShaderfShader
 

Private Types

typedef SkNoncopyable INHERITED
 

Private Attributes

SkMatrix fCTM
 
SkMatrix fTotalInverse
 
uint8_t fPaintAlpha
 
uint8_t fTotalInverseClass
 

Member Typedef Documentation

typedef void(* SkShader::Context::ShadeProc)(const void *ctx, int x, int y, SkPMColor[], int count)

The const void* ctx is only const because all the implementations are const.

This can be changed to non-const if a new shade proc needs to change the ctx.

Member Function Documentation

virtual uint32_t SkShader::Context::getFlags ( ) const
inlinevirtual

Called sometimes before drawing with this shader.

Return the type of alpha your shader will return. The default implementation returns 0. Your subclass should override if it can (even sometimes) report a non-zero value, since that will enable various blitters to perform faster.

virtual void SkShader::Context::shadeSpan ( int  x,
int  y,
SkPMColor  [],
int  count 
)
pure virtual

Called for each span of the object being drawn.

Your subclass should set the appropriate colors (with premultiplied alpha) that correspond to the specified device coordinates.

Implemented in SkPerlinNoiseShader::PerlinNoiseShaderContext.

virtual void SkShader::Context::shadeSpanAlpha ( int  x,
int  y,
uint8_t  alpha[],
int  count 
)
virtual

Similar to shadeSpan, but only returns the alpha-channel for a span.

The default implementation calls shadeSpan() and then extracts the alpha values from the returned colors.


The documentation for this class was generated from the following file: