Flutter Engine
The Flutter Engine
Classes | Macros | Functions
SkBitmapCache.cpp File Reference
#include "src/core/SkBitmapCache.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkPixelRef.h"
#include "include/core/SkPixmap.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkMalloc.h"
#include "include/private/base/SkMutex.h"
#include "include/private/chromium/SkDiscardableMemory.h"
#include "src/core/SkMipmap.h"
#include "src/core/SkNextID.h"
#include "src/core/SkResourceCache.h"
#include "src/image/SkImage_Base.h"
#include <cstddef>
#include <utility>

Go to the source code of this file.

Classes

class  SkBitmapCache::Rec
 

Macros

#define CHECK_LOCAL(localCache, localName, globalName, ...)    ((localCache) ? localCache->localName(__VA_ARGS__) : SkResourceCache::globalName(__VA_ARGS__))
 

Functions

uint64_t SkMakeResourceCacheSharedIDForBitmap (uint32_t bitmapGenID)
 
void SkNotifyBitmapGenIDIsStale (uint32_t bitmapGenID)
 
void SkBitmapCache_setImmutableWithID (SkPixelRef *pr, uint32_t id)
 
static SkResourceCache::DiscardableFactory get_fact (SkResourceCache *localCache)
 

Macro Definition Documentation

◆ CHECK_LOCAL

#define CHECK_LOCAL (   localCache,
  localName,
  globalName,
  ... 
)     ((localCache) ? localCache->localName(__VA_ARGS__) : SkResourceCache::globalName(__VA_ARGS__))

Definition at line 227 of file SkBitmapCache.cpp.

Function Documentation

◆ get_fact()

static SkResourceCache::DiscardableFactory get_fact ( SkResourceCache localCache)
static

Definition at line 293 of file SkBitmapCache.cpp.

293 {
294 return localCache ? localCache->discardableFactory()
296}
DiscardableFactory discardableFactory() const
static DiscardableFactory GetDiscardableFactory()

◆ SkBitmapCache_setImmutableWithID()

void SkBitmapCache_setImmutableWithID ( SkPixelRef pr,
uint32_t  id 
)

Definition at line 70 of file SkBitmapCache.cpp.

70 {
71 pr->setImmutableWithID(id);
72}

◆ SkMakeResourceCacheSharedIDForBitmap()

uint64_t SkMakeResourceCacheSharedIDForBitmap ( uint32_t  bitmapGenID)

Use this for bitmapcache and mipmapcache entries.

Definition at line 32 of file SkBitmapCache.cpp.

32 {
33 uint64_t sharedID = SkSetFourByteTag('b', 'm', 'a', 'p');
34 return (sharedID << 32) | bitmapGenID;
35}
static constexpr SkFourByteTag SkSetFourByteTag(char a, char b, char c, char d)
Definition: SkTypes.h:167

◆ SkNotifyBitmapGenIDIsStale()

void SkNotifyBitmapGenIDIsStale ( uint32_t  bitmapGenID)

Definition at line 37 of file SkBitmapCache.cpp.

37 {
39}
uint64_t SkMakeResourceCacheSharedIDForBitmap(uint32_t bitmapGenID)
static void PostPurgeSharedID(uint64_t sharedID)