Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Attributes | List of all members
SkShaderBase::GradientInfo Struct Reference

#include <SkShaderBase.h>

Public Attributes

int fColorCount = 0
 In-out parameter, specifies passed size.
 
SkColorfColors = nullptr
 The colors in the gradient.
 
SkScalarfColorOffsets = nullptr
 The unit offset for color transitions.
 
SkPoint fPoint [2]
 Type specific, see above.
 
SkScalar fRadius [2]
 Type specific, see above.
 
SkTileMode fTileMode
 
uint32_t fGradientFlags = 0
 see SkGradientShader::Flags
 

Detailed Description

If the shader subclass can be represented as a gradient, asGradient returns the matching GradientType enum (or GradientType::kNone if it cannot). Also, if info is not null, asGradient populates info with the relevant (see below) parameters for the gradient. fColorCount is both an input and output parameter. On input, it indicates how many entries in fColors and fColorOffsets can be used, if they are non-NULL. After asGradient has run, fColorCount indicates how many color-offset pairs there are in the gradient. If there is insufficient space to store all of the color-offset pairs, fColors and fColorOffsets will not be altered. fColorOffsets specifies where on the range of 0 to 1 to transition to the given color. The meaning of fPoint and fRadius is dependent on the type of gradient.

None: info is ignored. Color: fColorOffsets[0] is meaningless. Linear: fPoint[0] and fPoint[1] are the end-points of the gradient Radial: fPoint[0] and fRadius[0] are the center and radius Conical: fPoint[0] and fRadius[0] are the center and radius of the 1st circle fPoint[1] and fRadius[1] are the center and radius of the 2nd circle Sweep: fPoint[0] is the center of the sweep.

Definition at line 242 of file SkShaderBase.h.

Member Data Documentation

◆ fColorCount

int SkShaderBase::GradientInfo::fColorCount = 0

In-out parameter, specifies passed size.

Definition at line 243 of file SkShaderBase.h.

◆ fColorOffsets

SkScalar* SkShaderBase::GradientInfo::fColorOffsets = nullptr

The unit offset for color transitions.

Definition at line 248 of file SkShaderBase.h.

◆ fColors

SkColor* SkShaderBase::GradientInfo::fColors = nullptr

The colors in the gradient.

Definition at line 247 of file SkShaderBase.h.

◆ fGradientFlags

uint32_t SkShaderBase::GradientInfo::fGradientFlags = 0

see SkGradientShader::Flags

Definition at line 252 of file SkShaderBase.h.

◆ fPoint

SkPoint SkShaderBase::GradientInfo::fPoint[2]

Type specific, see above.

Definition at line 249 of file SkShaderBase.h.

◆ fRadius

SkScalar SkShaderBase::GradientInfo::fRadius[2]

Type specific, see above.

Definition at line 250 of file SkShaderBase.h.

◆ fTileMode

SkTileMode SkShaderBase::GradientInfo::fTileMode

Definition at line 251 of file SkShaderBase.h.


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