56 fBase = fCurr = (
const char*)
data;
61void SkReadBuffer::setInvalid() {
72 const void*
addr = fCurr;
73 this->
validate(IsPtrAlign4(
addr) && this->isAvailable(inc));
103 const size_t inc =
sizeof(int32_t);
104 if (!this->
validate(IsPtrAlign4(fCurr) && this->isAvailable(inc))) {
107 int32_t
value = *((
const int32_t*)fCurr);
113 const size_t inc =
sizeof(
SkScalar);
114 if (!this->
validate(IsPtrAlign4(fCurr) && this->isAvailable(inc))) {
135 return *((
const uint8_t*)fCurr);
139 if (
const void*
src = this->
skip(bytes)) {
152 const char* c_str = this->skipT<char>(*
len+1);
154 if (this->
validate(c_str && c_str[*
len] ==
'\0')) {
162 if (
const char* c_str = this->
readString(&len)) {
163 string->set(c_str,
len);
171 *
color = {0, 0, 0, 0};
186 if (
const float*
m = (
const float*)this->
skip(
sizeof(
float) * 16)) {
204 (void)this->
skip(size);
229 int maxAniso = this->
readInt();
253 (void)this->
skip(size);
264 (void)this->
skip(size);
275 (void)this->
skip(size);
278bool SkReadBuffer::readArray(
void*
value,
size_t size,
size_t elementSize) {
285 return this->readArray(
value,
size,
sizeof(uint8_t));
297 return this->readArray(
values,
size,
sizeof(int32_t));
310 const void* buf = this->
skip(count);
319 if (!this->
validate(this->isAvailable(numBytes))) {
331 const size_t inc =
sizeof(uint32_t);
332 if (!this->
validate(IsPtrAlign4(fCurr) && this->isAvailable(inc))) {
335 return *((
const uint32_t*)fCurr);
339 std::optional<SkAlphaType> alphaType) {
344#if !defined(SK_LEGACY_DESERIAL_IMAGE_PROC)
353#if !defined(SK_DISABLE_LEGACY_IMAGE_READBUFFER)
359 SkDEBUGFAIL(
"Need to set image proc in SkDeserialProcs");
405 return rasterWithMips;
414 std::optional<SkAlphaType> alphaType = std::nullopt;
456 int32_t index = this->
read32();
459 }
else if (index > 0) {
460 if (!this->
validate(index <= fTFCount)) {
463 return fTFArray[index - 1];
466 const void*
data = this->
skip(size);
477 if (fFactoryCount > 0) {
478 int32_t index = this->
read32();
479 if (0 == index || !this->
isValid()) {
487 if ((
unsigned)index >= (
unsigned)fFactoryCount) {
491 factory = fFactoryArray[index];
495 size_t ignored_length;
498 fFlattenableDict.
set(fFlattenableDict.
count() + 1, factory);
503 uint32_t index = this->
readUInt() >> 8;
513 if (!this->
validate(factory !=
nullptr)) {
521 uint32_t sizeRecorded = this->
read32();
524 obj = (*factory)(*this);
527 if (sizeRecorded != sizeRead) {
533 this->
skip(sizeRecorded);
556 if (value < min || value >
max) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static const int points[]
static constexpr T SkAlign4(T x)
#define SkDEBUGFAIL(message)
static void * sk_careful_memcpy(void *dst, const void *src, size_t len)
static size_t sk_negate_to_size_t(int32_t value)
static sk_sp< SkImage > add_mipmaps(sk_sp< SkImage > img, sk_sp< SkData > data, SkDeserialProcs dProcs, std::optional< SkAlphaType > alphaType)
static sk_sp< SkImage > deserialize_image(sk_sp< SkData > data, SkDeserialProcs dProcs, std::optional< SkAlphaType > alphaType)
@ kNone_SkLegacyFQ
nearest-neighbor; fastest but lowest quality
static sk_sp< SkData > MakeWithoutCopy(const void *data, size_t length)
static sk_sp< SkData > MakeFromMalloc(const void *data, size_t length)
sk_sp< SkFlattenable >(* Factory)(SkReadBuffer &)
virtual Type getFlattenableType() const =0
static Factory NameToFactory(const char name[])
sk_sp< SkImage > makeRasterImage(GrDirectContext *, CachingHint cachingHint=kDisallow_CachingHint) const
const SkImageInfo & imageInfo() const
SkISize dimensions() const
bool readPixels(GrDirectContext *context, const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY, CachingHint cachingHint=kAllow_CachingHint) const
virtual sk_sp< SkImage > makeSubset(GrDirectContext *direct, const SkIRect &subset) const =0
static SkM44 ColMajor(const SkScalar c[16])
static size_t ReadFromMemory(SkMatrix *matrix, const void *buffer, size_t length)
SkISize dimensions() const
size_t readFromMemory(const void *buffer, size_t length)
bool readColor4fArray(SkColor4f *colors, size_t size)
void readColor4f(SkColor4f *color)
SkLegacyFQ checkFilterQuality()
SkFlattenable * readRawFlattenable()
const void * skipByteArray(size_t *size)
void readMatrix(SkMatrix *matrix)
void setMemory(const void *, size_t)
bool readByteArray(void *value, size_t size)
bool validate(bool isValid)
bool readIntArray(int32_t *values, size_t size)
const void * skip(size_t size)
sk_sp< SkData > readByteArrayAsData()
void readIRect(SkIRect *rect)
void setAllowSkSL(bool allow)
void setDeserialProcs(const SkDeserialProcs &procs)
SkSamplingOptions readSampling()
bool readPointArray(SkPoint *points, size_t size)
sk_sp< SkTypeface > readTypeface()
void readString(SkString *string)
bool readColorArray(SkColor *colors, size_t size)
bool readPad32(void *buffer, size_t bytes)
int32_t checkInt(int min, int max)
sk_sp< T > readFlattenable()
bool readScalarArray(SkScalar *values, size_t size)
void readPoint3(SkPoint3 *point)
sk_sp< SkImage > readImage()
void readRRect(SkRRect *rrect)
void readRegion(SkRegion *region)
void readPath(SkPath *path)
bool isVersionLT(SkPicturePriv::Version targetVersion) const
size_t readFromMemory(const void *buffer, size_t length)
static size_t Mul(size_t x, size_t y)
V * find(const K &key) const
FlutterSemanticsFlag flags
static float max(float r, float g, float b)
static float min(float r, float g, float b)
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
SK_API sk_sp< SkImage > DeferredFromGenerator(std::unique_ptr< SkImageGenerator > imageGenerator)
unsigned useCenter Optional< SkMatrix > matrix
sk_sp< const SkImage > image
ClipOpAndAA opAA SkRegion region
sk_sp< SkBlender > blender SkRect rect
PODArray< SkColor > colors
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
DEF_SWITCHES_START aot vmservice shared library name
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
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
SkSamplingOptions(SkFilterMode::kLinear))
SkDeserialTypefaceProc fTypefaceProc
SkDeserialImageProc fImageProc
SkDeserialImageFromDataProc fImageDataProc
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkSamplingOptions Aniso(int maxAniso)
std::shared_ptr< const fml::Mapping > data