Definition at line 74 of file SkBitmapCache.cpp.
◆ Rec()
Definition at line 76 of file SkBitmapCache.cpp.
79 , fDM(std::move(dm))
80 , fMalloc(block)
82 , fRowBytes(rowBytes)
83 {
85
86
87
89 }
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static uint32_t ImageID()
◆ ~Rec()
SkBitmapCache::Rec::~Rec |
( |
| ) |
|
|
inlineoverridevirtual |
◆ bytesUsed()
size_t SkBitmapCache::Rec::bytesUsed |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ canBePurged()
bool SkBitmapCache::Rec::canBePurged |
( |
| ) |
|
|
inlineoverridevirtual |
◆ diagnostic_only_getDiscardable()
◆ Finder()
static bool SkBitmapCache::Rec::Finder |
( |
const SkResourceCache::Rec & |
baseRec, |
|
|
void * |
contextBitmap |
|
) |
| |
|
inlinestatic |
◆ getCategory()
const char * SkBitmapCache::Rec::getCategory |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ getKey()
const Key & SkBitmapCache::Rec::getKey |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ install()
bool SkBitmapCache::Rec::install |
( |
SkBitmap * |
bitmap | ) |
|
|
inline |
Definition at line 134 of file SkBitmapCache.cpp.
134 {
136
137 if (!fDM && !fMalloc) {
138 return false;
139 }
140
141 if (fDM) {
142 if (!fDiscardableIsLocked) {
144 if (!fDM->lock()) {
145 fDM.reset(nullptr);
146 return false;
147 }
148 fDiscardableIsLocked = true;
149 }
151 }
152
153 bitmap->installPixels(fInfo, fDM ? fDM->data() : fMalloc, fRowBytes,
ReleaseProc,
this);
155 fExternalCounter++;
156
157 return true;
158 }
void SkBitmapCache_setImmutableWithID(SkPixelRef *pr, uint32_t id)
static void ReleaseProc(void *addr, void *ctx)
◆ postAddInstall()
void SkBitmapCache::Rec::postAddInstall |
( |
void * |
payload | ) |
|
|
inlineoverridevirtual |
Reimplemented from SkResourceCache::Rec.
Definition at line 108 of file SkBitmapCache.cpp.
108 {
110 }
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
bool install(SkBitmap *bitmap)
◆ ReleaseProc()
static void SkBitmapCache::Rec::ReleaseProc |
( |
void * |
addr, |
|
|
void * |
ctx |
|
) |
| |
|
inlinestatic |
Definition at line 117 of file SkBitmapCache.cpp.
117 {
118 Rec* rec =
static_cast<Rec*
>(ctx);
120
121 SkASSERT(rec->fExternalCounter > 0);
122 rec->fExternalCounter -= 1;
123 if (rec->fDM) {
125 if (rec->fExternalCounter == 0) {
126 rec->fDM->unlock();
127 rec->fDiscardableIsLocked = false;
128 }
129 } else {
131 }
132 }
The documentation for this class was generated from the following file: