Bug 1316524 - Use 'media.wmf.skip-blacklist' to set some gfxVars - r?mattwoodrow draft
authorGerald Squelart <gsquelart@mozilla.com>
Fri, 11 Nov 2016 11:25:52 +1100
changeset 437485 f17b928eee56b17cff9cfc810dfb88226ed83042
parent 437246 d38d06f85ef59c5dbb5d4a1a8d895957a78714de
child 536653 2547707894da5155157b97efa6da542f7f743402
push id35428
push usergsquelart@mozilla.com
push dateFri, 11 Nov 2016 00:28:46 +0000
reviewersmattwoodrow
bugs1316524, 1313343
milestone52.0a1
Bug 1316524 - Use 'media.wmf.skip-blacklist' to set some gfxVars - r?mattwoodrow Reversing bug 1313343, as MediaPrefs are not available from the UI process. Instead media.wmf.skip-blacklist is used when setting D3D-blacklisting gfxVars, leaving them empty if we want to skip these blacklists. MozReview-Commit-ID: JYED4ovC0jq
dom/media/platforms/wmf/WMFVideoMFTManager.cpp
gfx/thebes/gfxPlatform.cpp
--- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
+++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp
@@ -13,17 +13,16 @@
 #include "ImageContainer.h"
 #include "VideoUtils.h"
 #include "DXVA2Manager.h"
 #include "nsThreadUtils.h"
 #include "Layers.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/layers/LayersTypes.h"
 #include "MediaInfo.h"
-#include "MediaPrefs.h"
 #include "mozilla/Logging.h"
 #include "nsWindowsHelpers.h"
 #include "gfx2DGlue.h"
 #include "gfxWindowsPlatform.h"
 #include "IMFYCbCrImage.h"
 #include "mozilla/WindowsVersion.h"
 #include "mozilla/Telemetry.h"
 #include "nsPrintfCString.h"
@@ -176,18 +175,18 @@ FindDXVABlacklistedDLL(StaticAutoPtr<D3D
 
   if (!aDLLBlacklistingCache) {
     // First time here, create persistent data that will be reused in all
     // D3D11-blacklisting checks.
     aDLLBlacklistingCache = new D3DDLLBlacklistingCache();
     ClearOnShutdown(&aDLLBlacklistingCache);
   }
 
-  if (aBlacklist.IsEmpty() || MediaPrefs::PDMWMFSkipBlacklist()) {
-    // Empty blacklist, or "media.wmf.skip-blacklist"=true -> No blacklisting.
+  if (aBlacklist.IsEmpty()) {
+    // Empty blacklist -> No blacklisting.
     aDLLBlacklistingCache->mBlacklistPref.SetLength(0);
     aDLLBlacklistingCache->mBlacklistedDLL.SetLength(0);
     return aDLLBlacklistingCache->mBlacklistedDLL;
   }
 
   // Detect changes in pref.
   if (aDLLBlacklistingCache->mBlacklistPref.Equals(aBlacklist)) {
     // Same blacklist -> Return same result (i.e., don't check DLLs again).
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -612,18 +612,23 @@ gfxPlatform::Init()
     MediaPrefs::GetSingleton();
     gfxVars::Initialize();
 
     gfxConfig::Init();
 
     if (XRE_IsParentProcess()) {
       GPUProcessManager::Initialize();
 
-      gfxVars::SetPDMWMFDisableD3D11Dlls(Preferences::GetCString("media.wmf.disable-d3d11-for-dlls"));
-      gfxVars::SetPDMWMFDisableD3D9Dlls(Preferences::GetCString("media.wmf.disable-d3d9-for-dlls"));
+      if (Preferences::GetBool("media.wmf.skip-blacklist")) {
+        gfxVars::SetPDMWMFDisableD3D11Dlls(nsCString());
+        gfxVars::SetPDMWMFDisableD3D9Dlls(nsCString());
+      } else {
+        gfxVars::SetPDMWMFDisableD3D11Dlls(Preferences::GetCString("media.wmf.disable-d3d11-for-dlls"));
+        gfxVars::SetPDMWMFDisableD3D9Dlls(Preferences::GetCString("media.wmf.disable-d3d9-for-dlls"));
+      }
     }
 
     // Drop a note in the crash report if we end up forcing an option that could
     // destabilize things.  New items should be appended at the end (of an existing
     // or in a new section), so that we don't have to know the version to interpret
     // these cryptic strings.
     {
       nsAutoCString forcedPrefs;