Home | History | Annotate | Download | only in hwui

Lines Matching refs:resource

27 // Resource cache
34 ALOGD(" ResourceCache: mCache(%d): resource, ref = 0x%p, 0x%p",
59 void ResourceCache::incrementRefcount(void* resource, ResourceType resourceType) {
61 incrementRefcountLocked(resource, resourceType);
92 void ResourceCache::incrementRefcountLocked(void* resource, ResourceType resourceType) {
93 ssize_t index = mCache->indexOfKey(resource);
97 mCache->add(resource, ref);
130 void ResourceCache::decrementRefcount(void* resource) {
132 decrementRefcountLocked(resource);
163 void ResourceCache::decrementRefcountLocked(void* resource) {
164 ssize_t index = mCache->indexOfKey(resource);
172 deleteResourceReferenceLocked(resource, ref);
204 void ResourceCache::destructor(SkPath* resource) {
206 destructorLocked(resource);
209 void ResourceCache::destructorLocked(SkPath* resource) {
210 ssize_t index = mCache->indexOfKey(resource);
213 // If we're not tracking this resource, just delete it
215 Caches::getInstance().pathCache.removeDeferred(resource);
217 delete resource;
222 deleteResourceReferenceLocked(resource, ref);
226 void ResourceCache::destructor(SkBitmap* resource) {
228 destructorLocked(resource);
231 void ResourceCache::destructorLocked(SkBitmap* resource) {
232 ssize_t index = mCache->indexOfKey(resource);
235 // If we're not tracking this resource, just delete it
237 Caches::getInstance().textureCache.removeDeferred(resource);
239 delete resource;
244 deleteResourceReferenceLocked(resource, ref);
248 void ResourceCache::destructor(SkiaShader* resource) {
250 destructorLocked(resource);
253 void ResourceCache::destructorLocked(SkiaShader* resource) {
254 ssize_t index = mCache->indexOfKey(resource);
257 // If we're not tracking this resource, just delete it
258 delete resource;
263 deleteResourceReferenceLocked(resource, ref);
267 void ResourceCache::destructor(SkiaColorFilter* resource) {
269 destructorLocked(resource);
272 void ResourceCache::destructorLocked(SkiaColorFilter* resource) {
273 ssize_t index = mCache->indexOfKey(resource);
276 // If we're not tracking this resource, just delete it
277 delete resource;
282 deleteResourceReferenceLocked(resource, ref);
286 void ResourceCache::destructor(Res_png_9patch* resource) {
288 destructorLocked(resource);
291 void ResourceCache::destructorLocked(Res_png_9patch* resource) {
292 ssize_t index = mCache->indexOfKey(resource);
296 Caches::getInstance().patchCache.removeDeferred(resource);
298 // If we're not tracking this resource, just delete it
301 delete[] (int8_t*) resource;
306 deleteResourceReferenceLocked(resource, ref);
311 * Return value indicates whether resource was actually recycled, which happens when RefCnt
314 bool ResourceCache::recycle(SkBitmap* resource) {
316 return recycleLocked(resource);
320 * Return value indicates whether resource was actually recycled, which happens when RefCnt
323 bool ResourceCache::recycleLocked(SkBitmap* resource) {
324 ssize_t index = mCache->indexOfKey(resource);
326 // not tracking this resource; just recycle the pixel data
327 resource->setPixels(NULL, NULL);
337 deleteResourceReferenceLocked(resource, ref);
340 // Still referring to resource, don't recycle yet
348 void ResourceCache::deleteResourceReferenceLocked(void* resource, ResourceReference* ref) {
350 ((SkBitmap*) resource)->setPixels(NULL, NULL);
355 SkBitmap* bitmap = (SkBitmap*) resource;
363 SkPath* path = (SkPath*) resource;
371 SkiaShader* shader = (SkiaShader*) resource;
376 SkiaColorFilter* filter = (SkiaColorFilter*) resource;
382 Caches::getInstance().patchCache.removeDeferred((Res_png_9patch*) resource);
386 int8_t* patch = (int8_t*) resource;
391 Layer* layer = (Layer*) resource;
397 mCache->removeItem(resource);