cleanup font purging functions

M    include/core/SkGraphics.h
M    src/core/SkGraphics.cpp



git-svn-id: http://skia.googlecode.com/svn/trunk@2887 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
caryclark@google.com 2011-12-16 17:11:17 +00:00
parent 9245498e40
commit f86ab8472e
2 changed files with 5 additions and 2 deletions

View File

@ -21,6 +21,9 @@ public:
*/
static void Init();
/**
* Call this to release any memory held privately, such as the font cache.
*/
static void Term();
/**

View File

@ -126,8 +126,7 @@ void SkGraphics::Init() {
#include "SkTypefaceCache.h"
void SkGraphics::Term() {
SkGlyphCache::SetCacheUsed(0);
SkTypefaceCache::PurgeAll();
PurgeFontCache();
}
#ifndef SK_DEFAULT_FONT_CACHE_LIMIT
@ -159,6 +158,7 @@ size_t SkGraphics::SetFontCacheLimit(size_t bytes) {
void SkGraphics::PurgeFontCache() {
SkGlyphCache::SetCacheUsed(0);
SkTypefaceCache::PurgeAll();
}
///////////////////////////////////////////////////////////////////////////////