16 , fStorageType(kMalloc_StorageType)
20 fStorage.fMalloc =
data;
27 , fStorageType(kDiscardableMemory_StorageType)
35 switch (fStorageType) {
36 case kMalloc_StorageType:
39 case kDiscardableMemory_StorageType:
48 fCD->fMutex.acquire();
53 fCD->fMutex.release();
63void SkCachedData::internalRef(
bool fromCache)
const {
64 AutoMutexWritable(
this)->inMutexRef(fromCache);
67void SkCachedData::internalUnref(
bool fromCache)
const {
68 if (AutoMutexWritable(
this)->inMutexUnref(fromCache)) {
76void SkCachedData::inMutexRef(
bool fromCache) {
77 if ((1 == fRefCnt) && fInCache) {
88bool SkCachedData::inMutexUnref(
bool fromCache) {
93 this->inMutexUnlock();
97 if (fInCache && !fromCache) {
101 this->inMutexUnlock();
117void SkCachedData::inMutexLock() {
123 switch (fStorageType) {
124 case kMalloc_StorageType:
125 this->setData(fStorage.fMalloc);
127 case kDiscardableMemory_StorageType:
128 if (fStorage.fDM->lock()) {
129 void* ptr = fStorage.fDM->data();
133 this->setData(
nullptr);
139void SkCachedData::inMutexUnlock() {
145 switch (fStorageType) {
146 case kMalloc_StorageType:
149 case kDiscardableMemory_StorageType:
151 fStorage.fDM->unlock();
155 this->setData(
nullptr);
163 SkASSERT((fInCache && fRefCnt > 1) || !fInCache);
164 switch (fStorageType) {
165 case kMalloc_StorageType:
166 SkASSERT(fData == fStorage.fMalloc);
168 case kDiscardableMemory_StorageType:
173 SkASSERT((fInCache && 1 == fRefCnt) || (0 == fRefCnt));
SK_API void sk_free(void *)
AutoMutexWritable(const SkCachedData *cd)
SkCachedData * operator->()
SkCachedData(void *mallocData, size_t size)
const void * data() const
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
std::shared_ptr< const fml::Mapping > data