Cleanup implementation of hardware layers.

The new implementation relies on OpenGLRenderer's existing layer
code instead of duplicating it. The new code is much cleaner, with
simpler and better APIs and allows tracking of drawn regions inside
layers. Region tracking is not yet enabled but this will be done
in a future CL.

Change-Id: Ie826121a2227de8252c77b992a61218defea5143
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h
index 34f48c9..a11b6bc 100644
--- a/libs/hwui/Caches.h
+++ b/libs/hwui/Caches.h
@@ -91,8 +91,7 @@
     GLuint mRegionMeshIndices;
 
     mutable Mutex mGarbageLock;
-    Vector<GLuint> mFboGarbage;
-    Vector<GLuint> mTextureGarbage;
+    Vector<Layer*> mLayerGarbage;
 
 public:
     /**
@@ -110,14 +109,9 @@
     void clearGarbage();
 
     /**
-     * Can be used to delete an FBO from a non EGL thread.
+     * Can be used to delete a layer 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);
+    void deleteLayerDeferred(Layer* layer);
 
     /**
      * Binds the VBO used to render simple textured quads.