Skip to content

Commit

Permalink
Bug 1561792 - Handle dynamic changes of gfx.font_ahem_antialias_none …
Browse files Browse the repository at this point in the history
…(and make FlushFontAndWordCaches stronger for other callers) and fix a few test failures/intermittents using it. r=jfkthame

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

--HG--
extra : moz-landing-system : lando
  • Loading branch information
dbaron committed Aug 7, 2019
1 parent 30218bf commit 7f14d88
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions gfx/thebes/gfxPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ SRGBOverrideObserver::Observe(nsISupports* aSubject, const char* aTopic,

static const char* kObservedPrefs[] = {"gfx.downloadable_fonts.",
"gfx.font_rendering.", BIDI_NUMERAL_PREF,
nullptr};
"gfx.font_ahem_antialias_none", nullptr};

static void FontPrefChanged(const char* aPref, void* aData) {
MOZ_ASSERT(aPref);
Expand Down Expand Up @@ -2237,8 +2237,7 @@ int32_t gfxPlatform::GetBidiNumeralOption() {
void gfxPlatform::FlushFontAndWordCaches() {
gfxFontCache* fontCache = gfxFontCache::GetCache();
if (fontCache) {
fontCache->AgeAllGenerations();
fontCache->FlushShapedWordCaches();
fontCache->Flush();
}

gfxPlatform::PurgeSkiaFontCache();
Expand Down Expand Up @@ -2278,10 +2277,12 @@ void gfxPlatform::FontsPrefsChanged(const char* aPref) {
} else if (!strcmp(GFX_PREF_GRAPHITE_SHAPING, aPref)) {
mGraphiteShapingEnabled = UNINITIALIZED_VALUE;
FlushFontAndWordCaches();
} else if (
#if defined(XP_MACOSX)
} else if (!strcmp(GFX_PREF_CORETEXT_SHAPING, aPref)) {
FlushFontAndWordCaches();
!strcmp(GFX_PREF_CORETEXT_SHAPING, aPref) ||
#endif
!strcmp("gfx.font_ahem_antialias_none", aPref)) {
FlushFontAndWordCaches();
} else if (!strcmp(BIDI_NUMERAL_PREF, aPref)) {
mBidiNumeralOption = UNINITIALIZED_VALUE;
} else if (!strcmp(GFX_PREF_OPENTYPE_SVG, aPref)) {
Expand Down
6 changes: 3 additions & 3 deletions layout/reftests/w3c-css/submitted/variables/reftest.list
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
== variable-declaration-59.html support/color-green-ref.html
== variable-declaration-60.html support/color-green-ref.html
== variable-external-declaration-01.html support/color-green-ref.html
pref(gfx.font_ahem_antialias_none,false) fuzzy-if(OSX,48-49,622-622) fuzzy-if(winWidget,88-113,992-1726) fuzzy-if(geckoview,52-52,768-768) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&isDebugBuild) == variable-external-font-face-01.html variable-external-font-face-01-ref.html
ref-pref(gfx.font_ahem_antialias_none,false) == variable-external-font-face-01.html variable-external-font-face-01-ref.html
== variable-external-reference-01.html support/color-green-ref.html
== variable-external-supports-01.html support/color-green-ref.html
fuzzy-if(OSX,48-49,622-622) fuzzy-if(winWidget,88-113,992-1726) fuzzy-if(geckoview,52-52,768-768) == variable-font-face-01.html variable-font-face-01-ref.html
fuzzy-if(OSX,48-49,622-622) fuzzy-if(winWidget,88-113,992-1726) fuzzy-if(geckoview,52-52,768-768) == variable-font-face-02.html variable-font-face-02-ref.html
ref-pref(gfx.font_ahem_antialias_none,false) == variable-font-face-01.html variable-font-face-01-ref.html
ref-pref(gfx.font_ahem_antialias_none,false) == variable-font-face-02.html variable-font-face-02-ref.html
== variable-reference-01.html support/color-green-ref.html
== variable-reference-02.html support/color-green-ref.html
== variable-reference-03.html support/color-green-ref.html
Expand Down

0 comments on commit 7f14d88

Please sign in to comment.