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/FontRenderer.h b/libs/hwui/FontRenderer.h
index e102a2f..504dce8 100644
--- a/libs/hwui/FontRenderer.h
+++ b/libs/hwui/FontRenderer.h
@@ -21,6 +21,9 @@
 #include "font/CacheTexture.h"
 #include "font/CachedGlyphInfo.h"
 #include "font/Font.h"
+#ifdef BUGREPORT_FONT_CACHE_USAGE
+#include "font/FontCacheHistoryTracker.h"
+#endif
 
 #include <utils/LruCache.h>
 #include <utils/String8.h>
@@ -136,6 +139,10 @@
     uint32_t getSize() const;
     void dumpMemoryUsage(String8& log) const;
 
+#ifdef BUGREPORT_FONT_CACHE_USAGE
+    FontCacheHistoryTracker& historyTracker() { return mHistoryTracker; }
+#endif
+
 private:
     friend class Font;
 
@@ -205,6 +212,10 @@
 
     bool mLinearFiltering;
 
+#ifdef BUGREPORT_FONT_CACHE_USAGE
+    FontCacheHistoryTracker mHistoryTracker;
+#endif
+
 #ifdef ANDROID_ENABLE_RENDERSCRIPT
     // RS constructs
     RSC::sp<RSC::RS> mRs;