Bug 1891545 - Migrate gfx.downloadable_fonts.disable_cache to StaticPrefList. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D207553
This commit is contained in:
Jonathan Kew 2024-04-16 13:42:20 +00:00
parent 60e0dedaf5
commit 421d1818e1
3 changed files with 9 additions and 7 deletions

View File

@ -1235,7 +1235,7 @@ void gfxUserFontSet::UserFontCache::CacheFont(gfxFontEntry* aFontEntry) {
"caching a font associated with no family yet");
// if caching is disabled, simply return
if (Preferences::GetBool("gfx.downloadable_fonts.disable_cache")) {
if (StaticPrefs::gfx_downloadable_fonts_disable_cache()) {
return;
}
@ -1308,8 +1308,7 @@ void gfxUserFontSet::UserFontCache::ForgetFont(gfxFontEntry* aFontEntry) {
gfxFontEntry* gfxUserFontSet::UserFontCache::GetFont(
const gfxFontFaceSrc& aSrc, const gfxUserFontEntry& aUserFontEntry) {
if (!sUserFonts ||
Preferences::GetBool("gfx.downloadable_fonts.disable_cache")) {
if (!sUserFonts || StaticPrefs::gfx_downloadable_fonts_disable_cache()) {
return nullptr;
}

View File

@ -6057,6 +6057,13 @@
value: 0
mirror: always
# Whether to disable downloadable font cache so that behavior is consistently
# the uncached load behavior across pages (useful for testing reflow problems)
- name: gfx.downloadable_fonts.disable_cache
type: RelaxedAtomicBool
value: false
mirror: always
# Whether to preserve color bitmap tables in fonts (bypassing OTS).
# Currently these are supported only on platforms where we use Freetype
# to render fonts (Linux/Gtk and Android).

View File

@ -415,10 +415,6 @@ pref("gfx.downloadable_fonts.enabled", true);
pref("gfx.downloadable_fonts.fallback_delay", 3000);
pref("gfx.downloadable_fonts.fallback_delay_short", 100);
// disable downloadable font cache so that behavior is consistently
// the uncached load behavior across pages (useful for testing reflow problems)
pref("gfx.downloadable_fonts.disable_cache", false);
#ifdef XP_WIN
pref("gfx.font_rendering.directwrite.use_gdi_table_loading", true);
#endif