mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
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:
parent
aecbe2330a
commit
0adb330468
@ -126,4 +126,6 @@
|
||||
|
||||
#define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN
|
||||
|
||||
#define SK_DISABLE_TYPEFACE_CACHE
|
||||
|
||||
#endif
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user