diff --git a/config/autoconf.mk.in b/config/autoconf.mk.in index ea4f8f58ca7..cf27ca1470d 100644 --- a/config/autoconf.mk.in +++ b/config/autoconf.mk.in @@ -512,6 +512,7 @@ MOZ_ENABLE_PHOTON = @MOZ_ENABLE_PHOTON@ MOZ_ENABLE_XREMOTE = @MOZ_ENABLE_XREMOTE@ MOZ_ENABLE_DWRITE_FONT = @MOZ_ENABLE_DWRITE_FONT@ MOZ_ENABLE_D2D_SURFACE = @MOZ_ENABLE_D2D_SURFACE@ +MOZ_ENABLE_D3D9_LAYER = @MOZ_ENABLE_D3D9_LAYER@ MOZ_GTK2_CFLAGS = @MOZ_GTK2_CFLAGS@ MOZ_GTK2_LIBS = @MOZ_GTK2_LIBS@ diff --git a/configure.in b/configure.in index ee054463443..fbcc5e5c84b 100644 --- a/configure.in +++ b/configure.in @@ -8200,6 +8200,8 @@ if test "$MOZ_TREE_CAIRO"; then WIN32_D2D_SURFACE_FEATURE= fi + AC_CHECK_HEADER(d3d9.h, MOZ_ENABLE_D3D9_LAYER=1) + AC_TRY_COMPILE([#include ], [int foo = DDLOCK_WAITNOTBUSY;], HAS_DDRAW=1, HAS_DDRAW=) if test -z "$HAS_DDRAW"; then AC_MSG_WARN([DirectDraw ddraw.h header not found or it's missing DDLOCK_WAITNOTBUSY, disabling DirectDraw surface. If you have an older SDK (such as the CE5 SDK), try copying in ddraw.lib and ddraw.h from the WM6 SDK.]) @@ -8247,6 +8249,7 @@ if test "$MOZ_TREE_CAIRO"; then AC_SUBST(MOZ_ENABLE_CAIRO_FT) AC_SUBST(MOZ_ENABLE_DWRITE_FONT) AC_SUBST(MOZ_ENABLE_D2D_SURFACE) + AC_SUBST(MOZ_ENABLE_D3D9_LAYER) AC_SUBST(CAIRO_FT_CFLAGS) AC_SUBST(HAS_OGLES) diff --git a/gfx/layers/Makefile.in b/gfx/layers/Makefile.in index 7ae1d05184e..a8733db2cb1 100644 --- a/gfx/layers/Makefile.in +++ b/gfx/layers/Makefile.in @@ -77,7 +77,7 @@ CPPSRCS = \ $(NULL) ifeq ($(MOZ_WIDGET_TOOLKIT),windows) -ifndef WINCE +ifdef MOZ_ENABLE_D3D9_LAYER EXPORTS += LayerManagerD3D9.h CPPSRCS += \ diff --git a/gfx/thebes/src/Makefile.in b/gfx/thebes/src/Makefile.in index 7dc49fbf9bf..0c9f793ab3a 100644 --- a/gfx/thebes/src/Makefile.in +++ b/gfx/thebes/src/Makefile.in @@ -109,6 +109,10 @@ _OS_LIBS += uuid endif OS_LIBS += $(call EXPAND_LIBNAME,$(_OS_LIBS)) +ifdef MOZ_ENABLE_D3D9_LAYER +DEFINES += -DMOZ_ENABLE_D3D9_LAYER +endif + ACDEFINES += -UWIN32_LEAN_AND_MEAN endif diff --git a/gfx/thebes/src/gfxDllDeps.cpp b/gfx/thebes/src/gfxDllDeps.cpp index 9756f653b67..6b3ceaf2efa 100644 --- a/gfx/thebes/src/gfxDllDeps.cpp +++ b/gfx/thebes/src/gfxDllDeps.cpp @@ -2,7 +2,7 @@ #include "LayerManagerOGL.h" #include "BasicLayers.h" #include "ImageLayers.h" -#if defined(XP_WIN) && !defined(WINCE) +#ifdef MOZ_ENABLE_D3D9_LAYER #include "LayerManagerD3D9.h" #endif @@ -13,7 +13,7 @@ void XXXNeverCalled_Layers() { BasicLayerManager(nsnull); LayerManagerOGL(nsnull); -#if defined(XP_WIN) && !defined(WINCE) +#ifdef MOZ_ENABLE_D3D9_LAYER LayerManagerD3D9(nsnull); #endif } diff --git a/widget/src/windows/Makefile.in b/widget/src/windows/Makefile.in index 5a6066d4cb1..958a3ed2c83 100644 --- a/widget/src/windows/Makefile.in +++ b/widget/src/windows/Makefile.in @@ -108,6 +108,10 @@ endif DEFINES += -D_IMPL_NS_WIDGET -DMOZ_UNICODE +ifdef MOZ_ENABLE_D3D9_LAYER +DEFINES += -DMOZ_ENABLE_D3D9_LAYER +endif + ifdef BUILD_STATIC_LIBS DEFINES += -DMOZ_STATIC_COMPONENT_LIBS endif # BUILD_STATIC_LIBS diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index 46ca2c2b535..a5ae2782201 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -169,7 +169,9 @@ #include "gfxWindowsPlatform.h" #include "Layers.h" #ifndef WINCE +#ifdef MOZ_ENABLE_D3D9_LAYER #include "LayerManagerD3D9.h" +#endif #include "LayerManagerOGL.h" #endif @@ -2944,16 +2946,18 @@ nsWindow::GetLayerManager() } if (allowAcceleration) { - if (preferOpenGL) { - nsRefPtr layerManager = - new mozilla::layers::LayerManagerOGL(this); +#ifdef MOZ_ENABLE_D3D9_LAYER + if (!preferOpenGL) { + nsRefPtr layerManager = + new mozilla::layers::LayerManagerD3D9(this); if (layerManager->Initialize()) { mLayerManager = layerManager; } } +#endif if (!mLayerManager) { - nsRefPtr layerManager = - new mozilla::layers::LayerManagerD3D9(this); + nsRefPtr layerManager = + new mozilla::layers::LayerManagerOGL(this); if (layerManager->Initialize()) { mLayerManager = layerManager; } diff --git a/widget/src/windows/nsWindowGfx.cpp b/widget/src/windows/nsWindowGfx.cpp index c5130ac618d..35467c5a641 100644 --- a/widget/src/windows/nsWindowGfx.cpp +++ b/widget/src/windows/nsWindowGfx.cpp @@ -71,7 +71,7 @@ using mozilla::plugins::PluginInstanceParent; #include "prmem.h" #include "LayerManagerOGL.h" -#ifndef WINCE +#ifdef MOZ_ENABLE_D3D9_LAYER #include "LayerManagerD3D9.h" #endif @@ -680,7 +680,7 @@ DDRAW_FAILED: SetClippingRegion(event.region); result = DispatchWindowEvent(&event, eventStatus); break; -#ifndef WINCE +#ifdef MOZ_ENABLE_D3D9_LAYER case LayerManager::LAYERS_D3D9: static_cast(GetLayerManager())-> SetClippingRegion(event.region);