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
This commit is contained in:
reed@google.com 2012-07-30 13:08:01 +00:00
parent ada448040f
commit 79a1c34ee4
2 changed files with 9 additions and 0 deletions

View File

@ -48,6 +48,11 @@ public:
*/
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

View File

@ -717,6 +717,10 @@ size_t SkGraphics::SetFontCacheLimit(size_t bytes) {
return getSharedGlobals().setFontCacheLimit(bytes);
}
size_t SkGraphics::GetFontCacheUsed() {
return getSharedGlobals().fTotalMemoryUsed;
}
void SkGraphics::PurgeFontCache() {
getSharedGlobals().purgeAll();
SkTypefaceCache::PurgeAll();