HWUI: track upload & recent usage in font cache

FontCacheHistoryTracker should be turned off before shipping: b/31438876

bug:30427106
Change-Id: Ic26b25e790d4ee69e484ca0cb23dc9cc522b2ed3
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 6d28c52..a8ced9b 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -21,6 +21,9 @@
 #include "Properties.h"
 #include "renderstate/RenderState.h"
 #include "ShadowTessellator.h"
+#ifdef BUGREPORT_FONT_CACHE_USAGE
+#include "font/FontCacheHistoryTracker.h"
+#endif
 #include "utils/GLUtils.h"
 
 #include <cutils/properties.h>
@@ -212,6 +215,10 @@
 
     log.appendFormat("Total memory usage:\n");
     log.appendFormat("  %d bytes, %.2f MB\n", total, total / 1024.0f / 1024.0f);
+
+#ifdef BUGREPORT_FONT_CACHE_USAGE
+    fontRenderer.getFontRenderer().historyTracker().dump(log);
+#endif
 }
 
 ///////////////////////////////////////////////////////////////////////////////