Flutter Engine
The Flutter Engine
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
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 }
168 SkASSERT(buffer.isVersionLT(SkPicturePriv::Version::kNoShaderLocalMatrix));
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)
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)
static const SkMatrix & I()
Definition: SkMatrix.cpp:1544
FlutterSemanticsFlag flags
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

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