summaryrefslogtreecommitdiff
path: root/libs/hwui/Caches.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2011-02-02 20:28:09 -0800
committer Romain Guy <romainguy@google.com> 2011-02-02 20:28:09 -0800
commit09b7c91de73b59aa3f679b3ae3ba299f82ec9f8a (patch)
tree9eb49f2fedb60e6df37b54216ed20f054a6f55fd /libs/hwui/Caches.cpp
parent62687ec12cb8e0b1d4044a235b1387b9a8c3b4b4 (diff)
Allocate layers from the layers pool.
Bug #3413433 This change will be beneficial to Launcher to avoid hiccups when swiping pages of icons. When a layer is discarded, it is kept in the layers pool instead of being destroyed right away. This favors memory reuse over allocations. Change-Id: Ifb6944ba83d6ceb67c331527c0827b26ce648eb1
Diffstat (limited to 'libs/hwui/Caches.cpp')
-rw-r--r--libs/hwui/Caches.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index bffab958378f..ebf7aa0a3d04 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -20,6 +20,7 @@
#include "Caches.h"
#include "Properties.h"
+#include "LayerRenderer.h"
namespace android {
@@ -116,12 +117,7 @@ void Caches::clearGarbage() {
size_t count = mLayerGarbage.size();
for (size_t i = 0; i < count; i++) {
Layer* layer = mLayerGarbage.itemAt(i);
- if (layer) {
- if (layer->fbo) glDeleteFramebuffers(1, &layer->fbo);
- if (layer->texture) glDeleteTextures(1, &layer->texture);
-
- delete layer;
- }
+ LayerRenderer::destroyLayer(layer);
}
mLayerGarbage.clear();
}