Bug 1457505 - Fix the check for variation-font support in gfxWindowsPlatform: cannot depend on checking mUsingDirectWrite, as the fontlist is not yet set up. r=lsalzman
authorJonathan Kew <jkew@mozilla.com>
Sat, 28 Apr 2018 09:17:47 +0100
changeset 472257 1fb52e3bc8afade91ad9f13b9cbdb06c40fe0697
parent 472256 1bc26646a5888024161278a261c90ce2f744baf4
child 472258 314f5e5e4502bb4621710fb77678a2d4ae2b0d5f
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1457505
milestone61.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 1457505 - Fix the check for variation-font support in gfxWindowsPlatform: cannot depend on checking mUsingDirectWrite, as the fontlist is not yet set up. r=lsalzman
gfx/thebes/gfxWindowsPlatform.cpp
gfx/thebes/gfxWindowsPlatform.h
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -303,17 +303,16 @@ public:
     return NS_OK;
   }
 };
 
 NS_IMPL_ISUPPORTS(D3DSharedTexturesReporter, nsIMemoryReporter)
 
 gfxWindowsPlatform::gfxWindowsPlatform()
   : mRenderMode(RENDER_GDI)
-  , mUsingDirectWrite(false)
 {
   /*
    * Initialize COM
    */
   CoInitialize(nullptr);
 
   RegisterStrongMemoryReporter(new GfxD2DVramReporter());
   RegisterStrongMemoryReporter(new GPUAdapterReporter());
@@ -557,28 +556,30 @@ gfxWindowsPlatform::CreatePlatformFontLi
 {
     gfxPlatformFontList *pfl;
 
     // bug 630201 - older pre-RTM versions of Direct2D/DirectWrite cause odd
     // crashers so blacklist them altogether
     if (IsNotWin7PreRTM() && DWriteEnabled()) {
         pfl = new gfxDWriteFontList();
         if (NS_SUCCEEDED(pfl->InitFontList())) {
-            mUsingDirectWrite = true;
             return pfl;
         }
         // DWrite font initialization failed! Don't know why this would happen,
         // but apparently it can - see bug 594865.
         // So we're going to fall back to GDI fonts & rendering.
         gfxPlatformFontList::Shutdown();
         DisableD2D(FeatureStatus::Failed, "Failed to initialize fonts",
                    NS_LITERAL_CSTRING("FEATURE_FAILURE_FONT_FAIL"));
     }
 
-    mUsingDirectWrite = false;
+    // Ensure this is false, even if the Windows version was recent enough to
+    // permit it, as we're using GDI fonts.
+    mHasVariationFontSupport = false;
+
     pfl = new gfxGDIFontList();
 
     if (NS_SUCCEEDED(pfl->InitFontList())) {
         return pfl;
     }
 
     gfxPlatformFontList::Shutdown();
     return nullptr;
@@ -2065,11 +2066,11 @@ gfxWindowsPlatform::SupportsPluginDirect
     return false;
   }
   return true;
 }
 
 bool
 gfxWindowsPlatform::CheckVariationFontSupport()
 {
-  // Variation font support is only on Fall Creators Update or later
-  return mUsingDirectWrite && IsWin10FallCreatorsUpdateOrLater();
+  // Variation font support is only available on Fall Creators Update or later.
+  return IsWin10FallCreatorsUpdateOrLater();
 }
--- a/gfx/thebes/gfxWindowsPlatform.h
+++ b/gfx/thebes/gfxWindowsPlatform.h
@@ -262,13 +262,11 @@ private:
     void InitializeAdvancedLayersConfig();
 
     RefPtr<IDWriteRenderingParams> mRenderingParams[TEXT_RENDERING_COUNT];
     DWRITE_MEASURING_MODE mMeasuringMode;
 
     RefPtr<mozilla::layers::ReadbackManagerD3D11> mD3D11ReadbackManager;
 
     nsTArray<D3D_FEATURE_LEVEL> mFeatureLevels;
-
-    bool mUsingDirectWrite;
 };
 
 #endif /* GFX_WINDOWS_PLATFORM_H */