Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SkGradientBaseShader::DescriptorScope Class Reference

#include <SkGradientBaseShader.h>

Inheritance diagram for SkGradientBaseShader::DescriptorScope:
SkGradientBaseShader::Descriptor

Public Member Functions

 DescriptorScope ()
 
bool unflatten (SkReadBuffer &, SkMatrix *legacyLocalMatrix)
 
- Public Member Functions inherited from SkGradientBaseShader::Descriptor
 Descriptor ()
 
 ~Descriptor ()
 
 Descriptor (const SkColor4f colors[], sk_sp< SkColorSpace > colorSpace, const SkScalar positions[], int colorCount, SkTileMode mode, const Interpolation &interpolation)
 

Additional Inherited Members

- Public Attributes inherited from SkGradientBaseShader::Descriptor
const SkColor4ffColors
 
sk_sp< SkColorSpacefColorSpace
 
const SkScalarfPositions
 
int fColorCount
 
SkTileMode fTileMode
 
Interpolation fInterpolation
 

Detailed Description

Definition at line 58 of file SkGradientBaseShader.h.

Constructor & Destructor Documentation

◆ DescriptorScope()

SkGradientBaseShader::DescriptorScope::DescriptorScope ( )
inline

Definition at line 60 of file SkGradientBaseShader.h.

60{}

Member Function Documentation

◆ unflatten()

bool SkGradientBaseShader::DescriptorScope::unflatten ( SkReadBuffer buffer,
SkMatrix legacyLocalMatrix 
)

Definition at line 130 of file SkGradientBaseShader.cpp.

131 {
132 // New gradient format. Includes floating point color, color space, densely packed flags
133 uint32_t flags = buffer.readUInt();
134
136
142 : Interpolation::InPremul::kNo;
143
144 fColorCount = buffer.getArrayCount();
145
146 if (!(validate_array(buffer, fColorCount, &fColorStorage) &&
147 buffer.readColor4fArray(fColorStorage.begin(), fColorCount))) {
148 return false;
149 }
150 fColors = fColorStorage.begin();
151
153 sk_sp<SkData> data = buffer.readByteArrayAsData();
154 fColorSpace = data ? SkColorSpace::Deserialize(data->data(), data->size()) : nullptr;
155 } else {
156 fColorSpace = nullptr;
157 }
159 if (!(validate_array(buffer, fColorCount, &fPositionStorage) &&
160 buffer.readScalarArray(fPositionStorage.begin(), fColorCount))) {
161 return false;
162 }
163 fPositions = fPositionStorage.begin();
164 } else {
165 fPositions = nullptr;
166 }
169 buffer.readMatrix(legacyLocalMatrix);
170 } else {
171 *legacyLocalMatrix = SkMatrix::I();
172 }
173 return buffer.isValid();
174}
#define SkASSERT(cond)
Definition SkAssert.h:116
@ kHasColorSpace_GSF
@ kTileModeShift_GSF
@ kInterpolationColorSpaceMask_GSF
@ kHasLegacyLocalMatrix_GSF
@ kInterpolationColorSpaceShift_GSF
@ kInterpolationHueMethodShift_GSF
@ kHasPosition_GSF
@ kInterpolationInPremul_GSF
@ kInterpolationHueMethodMask_GSF
@ kTileModeMask_GSF
static bool validate_array(SkReadBuffer &buffer, size_t count, STArray< N, T, MEM_MOVE > *array)
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.
SkTileMode
Definition SkTileMode.h:13
static constexpr bool SkToBool(const T &x)
Definition SkTo.h:35
static sk_sp< SkColorSpace > Deserialize(const void *data, size_t length)
SkGradientShader::Interpolation Interpolation
static const SkMatrix & I()
FlutterSemanticsFlag flags
static const uint8_t buffer[]
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41

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