Cleanup GL objects on the correct thread.
Change-Id: Iddfea6e08a6591a4fab147151098ef27005f373d
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index 318c120..34f48c9 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -90,6 +90,10 @@
TextureVertex* mRegionMesh;
GLuint mRegionMeshIndices;
+ mutable Mutex mGarbageLock;
+ Vector<GLuint> mFboGarbage;
+ Vector<GLuint> mTextureGarbage;
+
public:
/**
* Indicates whether the renderer is in debug mode.
@@ -106,6 +110,16 @@
void clearGarbage();
/**
+ * Can be used to delete an FBO from a non EGL thread.
+ */
+ void deleteFboDeferred(GLuint fbo);
+
+ /**
+ * Can be used to delete a texture from a non EGL thread.
+ */
+ void deleteTextureDeferred(GLuint texture);
+
+ /**
* Binds the VBO used to render simple textured quads.
*/
void bindMeshBuffer();