Bug 1089413 - Only test resource sharing on d3d feature level >= 10. r=jmuizelaar, a=sledru GECKO330_2014101104_RELBRANCH FIREFOX_33_0_2_BUILD2 FIREFOX_33_0_2_RELEASE
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 27 Oct 2014 10:36:00 -0400
branchGECKO330_2014101104_RELBRANCH
changeset 218121 7dc4a9d1b3e6
parent 218119 a7c5bb677eff
child 218123 c3c26fa52d79
push id551
push userryanvm@gmail.com
push date2014-10-27 20:58 +0000
treeherdermozilla-release@9a8dc41a653e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar, sledru
bugs1089413
milestone33.0.2
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
@@ -381,17 +381,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 && GetD3D11Device()) {
             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;
@@ -6737,17 +6739,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) {