diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 18c0d98a07d..446c877600c 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -3229,6 +3229,7 @@ pref("gfx.direct2d.disabled", false); pref("gfx.direct2d.force-enabled", false); pref("layers.prefer-opengl", false); +pref("layers.use-d3d10", false); #endif #endif diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index 32e21a3713f..938b452c3f2 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -174,6 +174,9 @@ #ifdef MOZ_ENABLE_D3D9_LAYER #include "LayerManagerD3D9.h" #endif +#ifdef MOZ_ENABLE_D3D10_LAYER +#include "LayerManagerD3D10.h" +#endif #include "LayerManagerOGL.h" #endif #include "BasicLayers.h" @@ -3185,6 +3188,7 @@ nsWindow::GetLayerManager() PRBool accelerateByDefault = PR_TRUE; PRBool disableAcceleration = PR_FALSE; PRBool preferOpenGL = PR_FALSE; + PRBool useD3D10 = PR_FALSE; if (prefs) { prefs->GetBoolPref("layers.accelerate-all", &accelerateByDefault); @@ -3192,6 +3196,8 @@ nsWindow::GetLayerManager() &disableAcceleration); prefs->GetBoolPref("layers.prefer-opengl", &preferOpenGL); + prefs->GetBoolPref("layers.use-d3d10", + &useD3D10); } const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED"); @@ -3215,8 +3221,17 @@ nsWindow::GetLayerManager() mUseAcceleratedRendering = PR_TRUE; if (mUseAcceleratedRendering) { +#ifdef MOZ_ENABLE_D3D10_LAYER + if (useD3D10) { + nsRefPtr layerManager = + new mozilla::layers::LayerManagerD3D10(this); + if (layerManager->Initialize()) { + mLayerManager = layerManager; + } + } +#endif #ifdef MOZ_ENABLE_D3D9_LAYER - if (!preferOpenGL) { + if (!preferOpenGL && !mLayerManager) { nsRefPtr layerManager = new mozilla::layers::LayerManagerD3D9(this); if (layerManager->Initialize()) { diff --git a/widget/src/windows/nsWindowGfx.cpp b/widget/src/windows/nsWindowGfx.cpp index 016b44133eb..1417f12d9fa 100644 --- a/widget/src/windows/nsWindowGfx.cpp +++ b/widget/src/windows/nsWindowGfx.cpp @@ -759,6 +759,11 @@ DDRAW_FAILED: } } break; +#endif +#ifdef MOZ_ENABLE_D3D10_LAYER + case LayerManager::LAYERS_D3D10: + result = DispatchWindowEvent(&event, eventStatus); + break; #endif default: NS_ERROR("Unknown layers backend used!");