19#define CHECK_LOCAL(localCache, localName, globalName, ...) \
20 ((localCache) ? localCache->localName(__VA_ARGS__) : SkResourceCache::globalName(__VA_ARGS__))
23static unsigned gYUVPlanesKeyNamespaceLabel;
31 YUVPlanesKey(uint32_t genID)
46 fValue.fPixmaps = pixmaps;
47 fValue.fData->attachToCacheAndRef();
49 ~YUVPlanesRec()
override {
50 fValue.fData->detachFromCacheAndUnref();
56 const Key& getKey()
const override {
return fKey; }
57 size_t bytesUsed()
const override {
return sizeof(*this) + fValue.fData->size(); }
58 const char* getCategory()
const override {
return "yuv-planes"; }
60 return fValue.fData->diagnostic_only_getDiscardable();
64 const YUVPlanesRec& rec =
static_cast<const YUVPlanesRec&
>(baseRec);
65 YUVValue*
result =
static_cast<YUVValue*
>(contextData);
69 if (
nullptr == tmpData->
data()) {
74 result->fPixmaps = rec.fValue.fPixmaps;
84 YUVPlanesKey
key(genID);
89 *pixmaps =
result.fPixmaps;
95 YUVPlanesKey
key(genID);
uint64_t SkMakeResourceCacheSharedIDForBitmap(uint32_t bitmapGenID)
#define CHECK_LOCAL(localCache, localName, globalName,...)
int find(T *array, int N, T item)
const void * data() const
static void Add(uint32_t genID, SkCachedData *data, const SkYUVAPixmaps &pixmaps, SkResourceCache *localCache=nullptr)
static SkCachedData * FindAndRef(uint32_t genID, SkYUVAPixmaps *pixmaps, SkResourceCache *localCache=nullptr)
Visitor(Ts...) -> Visitor< Ts... >
std::shared_ptr< const fml::Mapping > data