Bug 1627296 - Remove the ForceFontUpdate hack from gfxDWriteFonts, the gfxPlatform calls in SystemTextQualityChanged should be sufficient to flush everything. r=jrmuizel
authorJonathan Kew <jkew@mozilla.com>
Fri, 15 May 2020 13:55:11 +0000
changeset 530275 512250f1fb3c8117bbe03620573c033f00f4af66
parent 530274 c66945aba5193e014a0395f270b0368dc5d06b96
child 530276 1cf7f93b442e6f0759814217bde11b3f4c7c672c
push id37420
push usernerli@mozilla.com
push dateFri, 15 May 2020 21:52:36 +0000
treeherdermozilla-central@f340bbb582d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1627296
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1627296 - Remove the ForceFontUpdate hack from gfxDWriteFonts, the gfxPlatform calls in SystemTextQualityChanged should be sufficient to flush everything. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D75351
gfx/thebes/gfxDWriteFonts.cpp
--- a/gfx/thebes/gfxDWriteFonts.cpp
+++ b/gfx/thebes/gfxDWriteFonts.cpp
@@ -90,40 +90,28 @@ gfxDWriteFont::gfxDWriteFont(const RefPt
   mFontFace->QueryInterface(__uuidof(IDWriteFontFace1),
                             (void**)getter_AddRefs(mFontFace1));
 
   ComputeMetrics(anAAOption);
 }
 
 gfxDWriteFont::~gfxDWriteFont() { delete mMetrics; }
 
-static void ForceFontUpdate() {
-  // update device context font cache
-  // Dirty but easiest way:
-  // Changing nsIPrefBranch entry which triggers callbacks
-  // and flows into calling mDeviceContext->FlushFontCache()
-  // to update the font cache in all the instance of Browsers
-  static const char kPrefName[] = "font.internaluseonly.changed";
-  bool fontInternalChange = Preferences::GetBool(kPrefName, false);
-  Preferences::SetBool(kPrefName, !fontInternalChange);
-}
-
 void gfxDWriteFont::UpdateSystemTextQuality() {
   BYTE newQuality = GetSystemTextQuality();
   if (gfxVars::SystemTextQuality() != newQuality) {
     gfxVars::SetSystemTextQuality(newQuality);
   }
 }
 
 void gfxDWriteFont::SystemTextQualityChanged() {
   // If ClearType status has changed, update our value,
+  Factory::SetSystemTextQuality(gfxVars::SystemTextQuality());
   // flush cached stuff that depended on the old setting, and force
   // reflow everywhere to ensure we are using correct glyph metrics.
-  ForceFontUpdate();
-  Factory::SetSystemTextQuality(gfxVars::SystemTextQuality());
   gfxPlatform::FlushFontAndWordCaches();
   gfxPlatform::ForceGlobalReflow();
 }
 
 UniquePtr<gfxFont> gfxDWriteFont::CopyWithAntialiasOption(
     AntialiasOption anAAOption) {
   auto entry = static_cast<gfxDWriteFontEntry*>(mFontEntry.get());
   RefPtr<UnscaledFontDWrite> unscaledFont =