Lines Matching refs:entry
114 void SkBitmapHeap::removeFromLRU(SkBitmapHeap::LookupEntry* entry) { in removeFromLRU() argument
115 if (fMostRecentlyUsed == entry) { in removeFromLRU()
116 fMostRecentlyUsed = entry->fLessRecentlyUsed; in removeFromLRU()
118 SkASSERT(fLeastRecentlyUsed == entry); in removeFromLRU()
125 if (fLeastRecentlyUsed == entry) { in removeFromLRU()
126 SkASSERT(entry->fMoreRecentlyUsed != NULL); in removeFromLRU()
127 fLeastRecentlyUsed = entry->fMoreRecentlyUsed; in removeFromLRU()
131 SkASSERT(entry->fMoreRecentlyUsed != NULL); in removeFromLRU()
132 entry->fMoreRecentlyUsed->fLessRecentlyUsed = entry->fLessRecentlyUsed; in removeFromLRU()
134 if (entry->fLessRecentlyUsed != NULL) { in removeFromLRU()
135 SkASSERT(fLeastRecentlyUsed != entry); in removeFromLRU()
136 entry->fLessRecentlyUsed->fMoreRecentlyUsed = entry->fMoreRecentlyUsed; in removeFromLRU()
139 entry->fMoreRecentlyUsed = NULL; in removeFromLRU()
142 void SkBitmapHeap::appendToLRU(SkBitmapHeap::LookupEntry* entry) { in appendToLRU() argument
145 fMostRecentlyUsed->fMoreRecentlyUsed = entry; in appendToLRU()
146 entry->fLessRecentlyUsed = fMostRecentlyUsed; in appendToLRU()
148 fMostRecentlyUsed = entry; in appendToLRU()
150 fLeastRecentlyUsed = entry; in appendToLRU()
224 int SkBitmapHeap::findInLookupTable(const LookupEntry& indexEntry, SkBitmapHeapEntry** entry) { in findInLookupTable() argument
234 } else if (entry != NULL) { in findInLookupTable()
236 *entry = fStorage[fLookupTable[index]->fStorageSlot]; in findInLookupTable()
262 int SkBitmapHeap::removeEntryFromLookupTable(LookupEntry* entry) { in removeEntryFromLookupTable() argument
265 int index = this->findInLookupTable(*entry, NULL); in removeEntryFromLookupTable()
269 fBytesAllocated -= fStorage[entry->fStorageSlot]->fBytesAllocated; in removeEntryFromLookupTable()
276 SkBitmapHeapEntry* entry = NULL; in insert() local
277 int searchIndex = this->findInLookupTable(LookupEntry(originalBitmap), &entry); in insert()
279 if (entry) { in insert()
283 *fDeferredEntries.append() = entry->fSlot; in insert()
285 entry->addReferences(fOwnerCount); in insert()
295 return entry->fSlot; in insert()
304 entry = fStorage[lookupEntry->fStorageSlot]; in insert()
317 if (!entry) { in insert()
321 entry = fStorage[slot]; in insert()
323 entry = SkNEW(SkBitmapHeapEntry); in insert()
324 fStorage.append(1, &entry); in insert()
325 entry->fSlot = fStorage.count() - 1; in insert()
333 copySucceeded = fExternalStorage->insert(originalBitmap, entry->fSlot); in insert()
335 copySucceeded = copyBitmap(originalBitmap, entry->fBitmap); in insert()
344 if (fStorage.count() - 1 == entry->fSlot) { in insert()
346 fStorage.remove(entry->fSlot); in insert()
348 SkDELETE(entry); in insert()
350 fUnusedSlots.push(entry->fSlot); in insert()
356 fLookupTable[searchIndex]->fStorageSlot = entry->fSlot; in insert()
362 entry->fBytesAllocated = originalBitmap.getSize(); in insert()
365 fBytesAllocated += entry->fBytesAllocated; in insert()
369 *fDeferredEntries.append() = entry->fSlot; in insert()
371 entry->addReferences(fOwnerCount); in insert()
377 return entry->fSlot; in insert()