19#define LOG_MEMORY_CACHE 0
26 static constexpr size_t kMaxLength = 60;
27 static constexpr char kTail[] =
"...";
28 static const size_t kTailLen = strlen(kTail);
29 bool overlength = encodeLength > kMaxLength;
41 if (
result == fMap.end()) {
52 result->second.fHitCount++;
53 return result->second.fData;
70 for (
auto it = fMap.begin(); it != fMap.end(); ++it) {
72 size_t bytesToHash = it->first.fKey->size();
80 SkASSERT(bytesToHash >=
sizeof(vkKeyType));
81 bytesToHash -=
sizeof(vkKeyType);
82 memcpy(&vkKeyType, it->first.fKey->bytes() + bytesToHash,
sizeof(vkKeyType));
88 hash.write(it->first.fKey->bytes(), bytesToHash);
95 const SkString& description = it->second.fDescription;
119 const char*
ext =
"key";
static SkMD5::Digest md5(const SkBitmap &bm)
static const int kGrShaderTypeCount
static SkString data_to_str(const SkData &data)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static uint32_t hash(const SkShaderBase::GradientInfo &v)
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
@ kShader_PersistentCacheKeyType
const char * data() const
void append(const char text[])
const char * c_str() const
void writeShadersToDisk(const char *path, GrBackendApi backend)
void store(const SkData &key, const SkData &data, const SkString &description) override
sk_sp< SkData > load(const SkData &key) override
bool UnpackCachedShaders(SkReadBuffer *reader, std::string shaders[], SkSL::Program::Interface interfaces[], int numInterfaces, ShaderMetadata *meta)
SkFourByteTag GetType(SkReadBuffer *reader)
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
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
static size_t EncodedSize(size_t srcDataLength)
static size_t Encode(const void *src, size_t length, void *dst, const char *encode=nullptr)
SkString toLowercaseHexString() const
std::shared_ptr< const fml::Mapping > data