Improve layers debugging

Change-Id: Ia4950dd5f0e0a224ecb69c581d33aa4f32260a7c
diff --git a/libs/hwui/LayerCache.cpp b/libs/hwui/LayerCache.cpp
index 58c0fac..89c35da 100644
--- a/libs/hwui/LayerCache.cpp
+++ b/libs/hwui/LayerCache.cpp
@@ -112,17 +112,21 @@
         glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
 
 #if DEBUG_LAYERS
-        size_t size = mCache.size();
-        for (size_t i = 0; i < size; i++) {
-            const LayerEntry& entry = mCache.itemAt(i);
-            LAYER_LOGD("  Layer size %dx%d", entry.mWidth, entry.mHeight);
-        }
+        dump();
 #endif
     }
 
     return layer;
 }
 
+void LayerCache::dump() {
+    size_t size = mCache.size();
+    for (size_t i = 0; i < size; i++) {
+        const LayerEntry& entry = mCache.itemAt(i);
+        LAYER_LOGD("  Layer size %dx%d", entry.mWidth, entry.mHeight);
+    }
+}
+
 bool LayerCache::resize(Layer* layer, const uint32_t width, const uint32_t height) {
     // TODO: We should be smarter and see if we have a texture of the appropriate
     //       size already in the cache, and reuse it instead of creating a new one