Flutter Engine
The Flutter Engine
Static Public Member Functions | List of all members
SkMipmapCache Class Reference

#include <SkBitmapCache.h>

Static Public Member Functions

static const SkMipmapFindAndRef (const SkBitmapCacheDesc &, SkResourceCache *localCache=nullptr)
 
static const SkMipmapAddAndRef (const SkImage_Base *, SkResourceCache *localCache=nullptr)
 

Detailed Description

Definition at line 62 of file SkBitmapCache.h.

Member Function Documentation

◆ AddAndRef()

const SkMipmap * SkMipmapCache::AddAndRef ( const SkImage_Base image,
SkResourceCache localCache = nullptr 
)
static

Definition at line 298 of file SkBitmapCache.cpp.

298 {
300 if (!image->getROPixels(nullptr, &src)) {
301 return nullptr;
302 }
303
304 SkMipmap* mipmap = SkMipmap::Build(src, get_fact(localCache));
305 if (mipmap) {
306 MipMapRec* rec = new MipMapRec(SkBitmapCacheDesc::Make(image), mipmap);
307 CHECK_LOCAL(localCache, add, Add, rec);
308 image->notifyAddedToRasterCache();
309 }
310 return mipmap;
311}
#define CHECK_LOCAL(localCache, localName, globalName,...)
static SkResourceCache::DiscardableFactory get_fact(SkResourceCache *localCache)
static SkMipmap * Build(const SkPixmap &src, SkDiscardableFactoryProc, bool computeContents=true)
Definition: SkMipmap.cpp:45
sk_sp< const SkImage > image
Definition: SkRecords.h:269
static SkBitmapCacheDesc Make(const SkImage *)

◆ FindAndRef()

const SkMipmap * SkMipmapCache::FindAndRef ( const SkBitmapCacheDesc desc,
SkResourceCache localCache = nullptr 
)
static

Definition at line 282 of file SkBitmapCache.cpp.

283 {
284 MipMapKey key(desc);
285 const SkMipmap* result;
286
287 if (!CHECK_LOCAL(localCache, find, Find, key, MipMapRec::Finder, &result)) {
288 result = nullptr;
289 }
290 return result;
291}
int find(T *array, int N, T item)
GAsyncResult * result

The documentation for this class was generated from the following files: