Fixing memory leak in RenderBufferCache

In our devices with higher resolution we have observed a memory
leak in the HWUI code. When there is GC or tree modification
and buffer size is greater than the default size, we make sure
buffer is deleted.

Change-Id: Idf7052ccaf43c8a784ce0e7bdab336dca29bffd8
Signed-off-by: Samsung <aosp@samsung.com>
diff --git a/libs/hwui/RenderBufferCache.cpp b/libs/hwui/RenderBufferCache.cpp
index 830a13a..022820b 100644
--- a/libs/hwui/RenderBufferCache.cpp
+++ b/libs/hwui/RenderBufferCache.cpp
@@ -158,6 +158,11 @@
                 buffer->getWidth(), buffer->getHeight());
 
         return true;
+    } else {
+        RENDER_BUFFER_LOGD("Deleted %s render buffer (%dx%d) Size=%d, MaxSize=%d",
+        RenderBuffer::formatName(buffer->getFormat()),
+                 buffer->getWidth(), buffer->getHeight(), size, mMaxSize);
+        delete buffer;
     }
     return false;
 }