Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SkShaderBase::ContextRec Struct Reference

#include <SkShaderBase.h>

Public Member Functions

 ContextRec (SkAlpha paintAlpha, const SkShaders::MatrixRec &matrixRec, SkColorType dstColorType, SkColorSpace *dstColorSpace, const SkSurfaceProps &props)
 
bool isLegacyCompatible (SkColorSpace *shadersColorSpace) const
 

Static Public Member Functions

static ContextRec Concat (const ContextRec &parentRec, const SkMatrix &localM)
 

Public Attributes

const SkShaders::MatrixRec fMatrixRec
 
SkColorType fDstColorType
 
SkColorSpacefDstColorSpace
 
SkSurfaceProps fProps
 
SkAlpha fPaintAlpha
 

Detailed Description

ContextRec acts as a parameter bundle for creating Contexts.

Definition at line 268 of file SkShaderBase.h.

Constructor & Destructor Documentation

◆ ContextRec()

SkShaderBase::ContextRec::ContextRec ( SkAlpha  paintAlpha,
const SkShaders::MatrixRec matrixRec,
SkColorType  dstColorType,
SkColorSpace dstColorSpace,
const SkSurfaceProps props 
)
inline

Definition at line 269 of file SkShaderBase.h.

274 : fMatrixRec(matrixRec)
275 , fDstColorType(dstColorType)
276 , fDstColorSpace(dstColorSpace)
277 , fProps(props)
278 , fPaintAlpha(paintAlpha) {}
const SkShaders::MatrixRec fMatrixRec
Definition: SkShaderBase.h:288
SkColorSpace * fDstColorSpace
Definition: SkShaderBase.h:290

Member Function Documentation

◆ Concat()

static ContextRec SkShaderBase::ContextRec::Concat ( const ContextRec parentRec,
const SkMatrix localM 
)
inlinestatic

Definition at line 280 of file SkShaderBase.h.

280 {
281 return {parentRec.fPaintAlpha,
282 parentRec.fMatrixRec.concat(localM),
283 parentRec.fDstColorType,
284 parentRec.fDstColorSpace,
285 parentRec.fProps};
286 }

◆ isLegacyCompatible()

bool SkShaderBase::ContextRec::isLegacyCompatible ( SkColorSpace shadersColorSpace) const

Definition at line 122 of file SkShaderBase.cpp.

122 {
123 // In legacy pipelines, shaders always produce premul (or opaque) and the destination is also
124 // always premul (or opaque). (And those "or opaque" caveats won't make any difference here.)
126 return 0 ==
127 SkColorSpaceXformSteps{shaderColorSpace, shaderAT, fDstColorSpace, dstAT}.flags.mask();
128}
SkAlphaType
Definition: SkAlphaType.h:26
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29

Member Data Documentation

◆ fDstColorSpace

SkColorSpace* SkShaderBase::ContextRec::fDstColorSpace

Definition at line 290 of file SkShaderBase.h.

◆ fDstColorType

SkColorType SkShaderBase::ContextRec::fDstColorType

Definition at line 289 of file SkShaderBase.h.

◆ fMatrixRec

const SkShaders::MatrixRec SkShaderBase::ContextRec::fMatrixRec

Definition at line 288 of file SkShaderBase.h.

◆ fPaintAlpha

SkAlpha SkShaderBase::ContextRec::fPaintAlpha

Definition at line 292 of file SkShaderBase.h.

◆ fProps

SkSurfaceProps SkShaderBase::ContextRec::fProps

Definition at line 291 of file SkShaderBase.h.


The documentation for this struct was generated from the following files: