Revert "Deleting objects on the wrong thread is a silly idea Bug #7195815"
This reverts commit 8a1374946a928fcba7495c87ff6adda327fdfb9f
Change-Id: I53564a6c531d334afcc1fce0bea1e57ae266aa78
diff --git a/libs/hwui/Layer.cpp b/libs/hwui/Layer.cpp
index cd2e571..fb525ee 100644
--- a/libs/hwui/Layer.cpp
+++ b/libs/hwui/Layer.cpp
@@ -19,7 +19,6 @@
#include <utils/Log.h>
#include "Layer.h"
-#include "LayerRenderer.h"
#include "OpenGLRenderer.h"
#include "Caches.h"
@@ -47,14 +46,17 @@
if (mesh) delete mesh;
if (meshIndices) delete meshIndices;
if (colorFilter) Caches::getInstance().resourceCache.decrementRefcount(colorFilter);
- if (fbo) {
- LayerRenderer::flushLayer(this);
- Caches::getInstance().fboCache.put(fbo);
- fbo = 0;
- }
+ if (fbo) Caches::getInstance().fboCache.put(fbo);
deleteTexture();
}
+void Layer::freeResourcesLocked() {
+ if (colorFilter) {
+ Caches::getInstance().resourceCache.decrementRefcountLocked(colorFilter);
+ colorFilter = NULL;
+ }
+}
+
void Layer::setPaint(SkPaint* paint) {
OpenGLRenderer::getAlphaAndModeDirect(paint, &alpha, &mode);
}
@@ -69,5 +71,7 @@
}
}
+
+
}; // namespace uirenderer
}; // namespace android