Flutter Engine
The Flutter Engine
Classes | Enumerations | Functions
skresources Namespace Reference

Classes

class  CachingResourceProvider
 
class  DataURIResourceProviderProxy
 
class  ExternalTrackAsset
 
class  FileResourceProvider
 
class  ImageAsset
 
class  MultiFrameImageAsset
 
class  ResourceProvider
 
class  ResourceProviderProxyBase
 

Enumerations

enum class  ImageDecodeStrategy { kLazyDecode , kPreDecode }
 

Functions

static sk_sp< SkDatadecode_datauri (const char prefix[], const char uri[])
 

Enumeration Type Documentation

◆ ImageDecodeStrategy

Enumerator
kLazyDecode 
kPreDecode 

Definition at line 91 of file SkResources.h.

91 {
92 // Images are decoded on-the-fly, at rasterization time.
93 // Large images may cause jank as decoding is expensive (and can thrash internal caches).
95 // Force-decode all images upfront, at the cost of potentially more RAM and slower
96 // animation build times.
98};

Function Documentation

◆ decode_datauri()

static sk_sp< SkData > skresources::decode_datauri ( const char  prefix[],
const char  uri[] 
)
static

Definition at line 284 of file SkResources.cpp.

284 {
285 // We only handle B64 encoded image dataURIs: data:image/<type>;base64,<data>
286 // (https://en.wikipedia.org/wiki/Data_URI_scheme)
287 static constexpr char kDataURIEncodingStr[] = ";base64,";
288
289 const size_t prefixLen = strlen(prefix);
290 if (strncmp(uri, prefix, prefixLen) != 0) {
291 return nullptr;
292 }
293
294 const char* encoding = strstr(uri + prefixLen, kDataURIEncodingStr);
295 if (!encoding) {
296 return nullptr;
297 }
298
299 const char* b64Data = encoding + std::size(kDataURIEncodingStr) - 1;
300 size_t b64DataLen = strlen(b64Data);
301 size_t dataLen;
302 if (SkBase64::Decode(b64Data, b64DataLen, nullptr, &dataLen) != SkBase64::kNoError) {
303 return nullptr;
304 }
305
307 void* rawData = data->writable_data();
308 if (SkBase64::Decode(b64Data, b64DataLen, rawData, &dataLen) != SkBase64::kNoError) {
309 return nullptr;
310 }
311
312 return data;
313}
static sk_sp< SkData > MakeUninitialized(size_t length)
Definition: SkData.cpp:116
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
Definition: switches.h:259
static Error Decode(const void *src, size_t srcLength, void *dst, size_t *dstLength)
Definition: SkBase64.cpp:37
@ kNoError
Definition: SkBase64.h:16
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63