Optimize FBO cache.

This change introduces a new generational cache called GenerationMultiCache
that can store several values with the same key. This can be used to use
multiple layers of the same size at the same time, without recreating them
over and over again.

Change-Id: I425466a20908b862c5f464a0f9e582ec18cbd7ac
diff --git a/libs/hwui/LayerCache.cpp b/libs/hwui/LayerCache.cpp
index 0d3214d..7d85e7b 100644
--- a/libs/hwui/LayerCache.cpp
+++ b/libs/hwui/LayerCache.cpp
@@ -28,13 +28,12 @@
 ///////////////////////////////////////////////////////////////////////////////
 
 LayerCache::LayerCache(uint32_t maxByteSize):
-        mCache(GenerationCache<LayerSize, Layer*>::kUnlimitedCapacity),
+        mCache(GenerationMultiCache<LayerSize, Layer*>::kUnlimitedCapacity),
         mSize(0), mMaxSize(maxByteSize) {
 }
 
 LayerCache::~LayerCache() {
-    mCache.setOnEntryRemovedListener(this);
-    mCache.clear();
+    clear();
 }
 
 ///////////////////////////////////////////////////////////////////////////////