From: reed@google.com Date: Mon, 30 Jul 2012 13:08:01 +0000 (+0000) Subject: land https://codereview.appspot.com/6448046/ X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~15393 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=79a1c34ee45a3eb5edd568fd97626dff1b64a0db;p=platform%2Fupstream%2FlibSkiaSharp.git land https://codereview.appspot.com/6448046/ 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 --- diff --git a/include/core/SkGraphics.h b/include/core/SkGraphics.h index 3247dc2..c7ee07f 100644 --- a/include/core/SkGraphics.h +++ b/include/core/SkGraphics.h @@ -49,6 +49,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 * draws to be recreated, since they will no longer be in the cache. diff --git a/src/core/SkGlyphCache.cpp b/src/core/SkGlyphCache.cpp index 0beec36..9ca07b9 100644 --- a/src/core/SkGlyphCache.cpp +++ b/src/core/SkGlyphCache.cpp @@ -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();