Bug 1316524 - Use 'media.wmf.skip-blacklist' to set some gfxVars - r=mattwoodrow
authorGerald Squelart <gsquelart@mozilla.com>
Fri, 11 Nov 2016 11:25:52 +1100
changeset 438315 680467d99ed63d1b3a37e5c61d3c4302f5181418
parent 438314 bba6abab045cd8cf8dacf9be49c95e3feab5794b
child 438316 2b174353e76a8c7b7595f29b21a797f8f84af72c
push id35679
push userbmo:timdream@gmail.com
push dateMon, 14 Nov 2016 09:29:38 +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;