summaryrefslogtreecommitdiff
path: root/libs/hwui/ResourceCache.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2010-11-11 15:36:56 -0800
committer Romain Guy <romainguy@google.com> 2010-11-11 15:36:56 -0800
commitfe48f65922d4a3cc4aefe058cee5acec51504a20 (patch)
tree97ea23ae71dade1ef7bf783523bea9cda31dd042 /libs/hwui/ResourceCache.cpp
parent50c5e4c36e494d092576d42cf2b406abab20510a (diff)
Free resources only from the GL context thread.
Bug #3179882 Resources were freed following garbage collections on a worker thread. This worker thread had no EGL context, which would cause the renderer to incorrectly assume that the memory was liberated. Change-Id: Ifdb51f94ddf42641e8654522787bfac532976c7c
Diffstat (limited to 'libs/hwui/ResourceCache.cpp')
-rw-r--r--libs/hwui/ResourceCache.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/hwui/ResourceCache.cpp b/libs/hwui/ResourceCache.cpp
index 47c5d489b3e8..9f189482941e 100644
--- a/libs/hwui/ResourceCache.cpp
+++ b/libs/hwui/ResourceCache.cpp
@@ -126,7 +126,7 @@ void ResourceCache::destructor(SkBitmap* resource) {
if (ref == NULL) {
// If we're not tracking this resource, just delete it
if (Caches::hasInstance()) {
- Caches::getInstance().textureCache.remove(resource);
+ Caches::getInstance().textureCache.removeDeferred(resource);
}
delete resource;
return;
@@ -143,7 +143,7 @@ void ResourceCache::destructor(SkiaShader* resource) {
if (ref == NULL) {
// If we're not tracking this resource, just delete it
if (Caches::hasInstance()) {
- Caches::getInstance().gradientCache.remove(resource->getSkShader());
+ Caches::getInstance().gradientCache.removeDeferred(resource->getSkShader());
}
delete resource;
return;
@@ -179,7 +179,7 @@ void ResourceCache::deleteResourceReference(void* resource, ResourceReference* r
{
SkBitmap* bitmap = (SkBitmap*)resource;
if (Caches::hasInstance()) {
- Caches::getInstance().textureCache.remove(bitmap);
+ Caches::getInstance().textureCache.removeDeferred(bitmap);
}
delete bitmap;
}
@@ -188,7 +188,7 @@ void ResourceCache::deleteResourceReference(void* resource, ResourceReference* r
{
SkiaShader* shader = (SkiaShader*)resource;
if (Caches::hasInstance()) {
- Caches::getInstance().gradientCache.remove(shader->getSkShader());
+ Caches::getInstance().gradientCache.removeDeferred(shader->getSkShader());
}
delete shader;
}