Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
GradRec Struct Reference

Public Member Functions

void gradCheck (skiatest::Reporter *reporter, const sk_sp< SkShader > &shader, SkShaderBase::GradientInfo *info, SkShaderBase::GradientType gt, const SkMatrix &localMatrix=SkMatrix::I()) const
 

Public Attributes

int fColorCount
 
const SkColorfColors
 
const SkScalarfPos
 
const SkPointfPoint
 
const SkScalarfRadius
 
SkTileMode fTileMode
 

Detailed Description

Definition at line 81 of file GradientTest.cpp.

Member Function Documentation

◆ gradCheck()

void GradRec::gradCheck ( skiatest::Reporter reporter,
const sk_sp< SkShader > &  shader,
SkShaderBase::GradientInfo info,
SkShaderBase::GradientType  gt,
const SkMatrix localMatrix = SkMatrix::I() 
) const
inline

Definition at line 89 of file GradientTest.cpp.

93 {
96
97 info->fColorCount = fColorCount;
98 info->fColors = colorStorage;
99 info->fColorOffsets = posStorage.get();
100 SkMatrix shaderLocalMatrix;
101 REPORTER_ASSERT(reporter, as_SB(shader)->asGradient(info, &shaderLocalMatrix) == gt);
102 REPORTER_ASSERT(reporter, shaderLocalMatrix == localMatrix);
103
104 REPORTER_ASSERT(reporter, info->fColorCount == fColorCount);
106 !memcmp(info->fColors, fColors, fColorCount * sizeof(SkColor)));
108 !memcmp(info->fColorOffsets, fPos, fColorCount * sizeof(SkScalar)));
110 }
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
reporter
Definition: FontMgrTest.cpp:39
uint32_t SkColor
Definition: SkColor.h:37
SkShaderBase * as_SB(SkShader *shader)
Definition: SkShaderBase.h:412
SkTileMode
Definition: SkTileMode.h:13
#define REPORTER_ASSERT(r, cond,...)
Definition: Test.h:286
float SkScalar
Definition: extension.cpp:12
const SkColor * fColors
int fColorCount
const SkScalar * fPos
SkTileMode fTileMode

Member Data Documentation

◆ fColorCount

int GradRec::fColorCount

Definition at line 82 of file GradientTest.cpp.

◆ fColors

const SkColor* GradRec::fColors

Definition at line 83 of file GradientTest.cpp.

◆ fPoint

const SkPoint* GradRec::fPoint

Definition at line 85 of file GradientTest.cpp.

◆ fPos

const SkScalar* GradRec::fPos

Definition at line 84 of file GradientTest.cpp.

◆ fRadius

const SkScalar* GradRec::fRadius

Definition at line 86 of file GradientTest.cpp.

◆ fTileMode

SkTileMode GradRec::fTileMode

Definition at line 87 of file GradientTest.cpp.


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