Add a method reporting used font cache size to the SkGraphics API
git-svn-id: http://skia.googlecode.com/svn/trunk@4825
2bbb7eff-a529-9590-31e7-
b0007b416f81
static size_t SetFontCacheLimit(size_t bytes);
/**
+ * Return the number of bytes currently used by the font cache.
+ */
+ static size_t GetFontCacheUsed();
+
+ /**
* For debugging purposes, this will attempt to purge the font cache. It
* does not change the limit, but will cause subsequent font measures and
* draws to be recreated, since they will no longer be in the cache.
return getSharedGlobals().setFontCacheLimit(bytes);
}
+size_t SkGraphics::GetFontCacheUsed() {
+ return getSharedGlobals().fTotalMemoryUsed;
+}
+
void SkGraphics::PurgeFontCache() {
getSharedGlobals().purgeAll();
SkTypefaceCache::PurgeAll();