Bug 1089413 - Only test resource sharing on d3d feature level >= 10. r=jmuizelaar, a=sledru
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 27 Oct 2014 10:36:00 -0400
changeset 212467 14ec535fd1c0f29950fb1a9084f8cd3e49e7994f
parent 212466 5f2a4049b9e96ce39384025f52e50f9e97a5a5a0
child 212468 2aaea7a57734ed92cdf851cfbb08e973e81c2e72
push id50982
push userryanvm@gmail.com
push dateMon, 27 Oct 2014 20:52:13 +0000
treeherdermozilla-inbound@14ec535fd1c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar, sledru
bugs1089413
milestone36.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 1089413 - Only test resource sharing on d3d feature level >= 10. r=jmuizelaar, a=sledru
gfx/thebes/gfxWindowsPlatform.cpp
widget/windows/nsWindow.cpp
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -387,17 +387,19 @@ gfxWindowsPlatform::UpdateRenderMode()
 
     // Do not ever try if d2d is explicitly disabled,
     // or if we're not using DWrite fonts.
     if (d2dDisabled || mUsingGDIFonts) {
         tryD2D = false;
     }
 
     ID3D11Device *device = GetD3D11Device();
-    if (isVistaOrHigher && !safeMode && tryD2D && device &&
+    if (isVistaOrHigher && !safeMode && tryD2D &&
+        device &&
+        device->GetFeatureLevel() >= D3D_FEATURE_LEVEL_10_0 &&
         DoesD3D11DeviceSupportResourceSharing(device)) {
 
         VerifyD2DDevice(d2dForceEnabled);
         if (mD2DDevice) {
             mRenderMode = RENDER_DIRECT2D;
             mUseDirectWrite = true;
         }
     } else {
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -175,16 +175,18 @@
 
 #include "nsIContent.h"
 
 #include "mozilla/HangMonitor.h"
 #include "WinIMEHandler.h"
 
 #include "npapi.h"
 
+#include <d3d11.h>
+
 #if !defined(SM_CONVERTIBLESLATEMODE)
 #define SM_CONVERTIBLESLATEMODE 0x2003
 #endif
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::gfx;
 using namespace mozilla::layers;
@@ -6730,17 +6732,19 @@ nsWindow::GetPreferredCompositorBackends
   // want to support this case. See bug 593471
   if (!(prefs.mDisableAcceleration ||
         mTransparencyMode == eTransparencyTransparent)) {
     if (prefs.mPreferOpenGL) {
       aHints.AppendElement(LayersBackend::LAYERS_OPENGL);
     }
 
     ID3D11Device* device = gfxWindowsPlatform::GetPlatform()->GetD3D11Device();
-    if (device && !DoesD3D11DeviceSupportResourceSharing(device)) {
+    if (device &&
+        device->GetFeatureLevel() >= D3D_FEATURE_LEVEL_10_0 &&
+        !DoesD3D11DeviceSupportResourceSharing(device)) {
       // bug 1083071 - bad things - fall back to basic layers
       // This should not happen aside from driver bugs, and in particular
       // should not happen on our test machines, so let's NS_ERROR to ensure
       // that we would catch it as a test failure.
       NS_ERROR("Can't use Direct3D 11 because of a driver bug "
         "causing resource sharing to fail");
     } else {
       if (!prefs.mPreferD3D9) {