Bug 1611467 - disable Skia typeface cache to prevent it from leaking fonts. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D68131

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Lee Salzman 2020-03-25 00:58:41 +00:00
parent aecbe2330a
commit 0adb330468
2 changed files with 10 additions and 0 deletions

View File

@ -126,4 +126,6 @@
#define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN
#define SK_DISABLE_TYPEFACE_CACHE
#endif

View File

@ -68,18 +68,26 @@ static SkMutex& typeface_cache_mutex() {
}
void SkTypefaceCache::Add(sk_sp<SkTypeface> face) {
#ifndef SK_DISABLE_TYPEFACE_CACHE
SkAutoMutexExclusive ama(typeface_cache_mutex());
Get().add(std::move(face));
#endif
}
sk_sp<SkTypeface> SkTypefaceCache::FindByProcAndRef(FindProc proc, void* ctx) {
#ifndef SK_DISABLE_TYPEFACE_CACHE
SkAutoMutexExclusive ama(typeface_cache_mutex());
return Get().findByProcAndRef(proc, ctx);
#else
return nullptr;
#endif
}
void SkTypefaceCache::PurgeAll() {
#ifndef SK_DISABLE_TYPEFACE_CACHE
SkAutoMutexExclusive ama(typeface_cache_mutex());
Get().purgeAll();
#endif
}
///////////////////////////////////////////////////////////////////////////////