Lines Matching full:resource
25 // Resource cache
32 LOGD(" ResourceCache: mCache(%d): resource, ref = 0x%p, 0x%p",
49 void ResourceCache::incrementRefcount(void* resource, ResourceType resourceType) {
51 ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
54 mCache->add(resource, ref);
79 void ResourceCache::decrementRefcount(void* resource) {
81 ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
88 deleteResourceReference(resource, ref);
112 void ResourceCache::recycle(SkBitmap* resource) {
114 if (mCache->indexOfKey(resource) < 0) {
115 // not tracking this resource; just recycle the pixel data
116 resource->setPixels(NULL, NULL);
119 ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
126 deleteResourceReference(resource, ref);
130 void ResourceCache::destructor(SkPath* resource) {
132 ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
134 // If we're not tracking this resource, just delete it
136 Caches::getInstance().pathCache.removeDeferred(resource);
138 delete resource;
143 deleteResourceReference(resource, ref);
147 void ResourceCache::destructor(SkBitmap* resource) {
149 ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
151 // If we're not tracking this resource, just delete it
153 Caches::getInstance().textureCache.removeDeferred(resource);
155 delete resource;
160 deleteResourceReference(resource, ref);
164 void ResourceCache::destructor(SkiaShader* resource) {
166 ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
168 // If we're not tracking this resource, just delete it
169 delete resource;
174 deleteResourceReference(resource, ref);
178 void ResourceCache::destructor(SkiaColorFilter* resource) {
180 ResourceReference* ref = mCache->indexOfKey(resource) >= 0 ? mCache->valueFor(resource) : NULL;
182 // If we're not tracking this resource, just delete it
183 delete resource;
188 deleteResourceReference(resource, ref);
196 void ResourceCache::deleteResourceReference(void* resource, ResourceReference* ref) {
198 ((SkBitmap*) resource)->setPixels(NULL, NULL);
203 SkBitmap* bitmap = (SkBitmap*) resource;
211 SkPath* path = (SkPath*) resource;
219 SkiaShader* shader = (SkiaShader*) resource;
224 SkiaColorFilter* filter = (SkiaColorFilter*) resource;
230 mCache->removeItem(resource);