8#ifndef SkCachedData_DEFINED
9#define SkCachedData_DEFINED
25 size_t size()
const {
return fSize; }
26 const void*
data()
const {
return fData; }
30 void ref()
const { this->internalRef(
false); }
31 void unref()
const { this->internalUnref(
false); }
38 return kDiscardableMemory_StorageType == fStorageType ? fStorage.fDM :
nullptr;
49 kDiscardableMemory_StorageType,
60 StorageType fStorageType;
64 void internalRef(
bool fromCache)
const;
65 void internalUnref(
bool fromCache)
const;
67 void inMutexRef(
bool fromCache);
68 bool inMutexUnref(
bool fromCache);
73 void setData(
void* newData) {
74 if (newData != fData) {
81 class AutoMutexWritable;
void detachFromCacheAndUnref() const
int testing_only_getRefCnt() const
SkCachedData(void *mallocData, size_t size)
void attachToCacheAndRef() const
SkDiscardableMemory * fDM
SkDiscardableMemory * diagnostic_only_getDiscardable() const
const void * data() const
virtual void onDataChange(void *oldData, void *newData)
bool testing_only_isInCache() const
bool testing_only_isLocked() const