From 9bf188ddc2c50505ce0ca7f38aa0b2ffa2f5c577 Mon Sep 17 00:00:00 2001 From: Kelsey Gilbert Date: Mon, 6 Feb 2023 19:58:55 +0000 Subject: [PATCH] Bug 1799258 - Ask dcomp.h to define IDCompositionFilterEffect. r=gfx-reviewers,bradwerth Differential Revision: https://phabricator.services.mozilla.com/D168325 --- gfx/webrender_bindings/DCLayerTree.cpp | 47 ++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/gfx/webrender_bindings/DCLayerTree.cpp b/gfx/webrender_bindings/DCLayerTree.cpp index 22aec4415087..9be2ce7472ef 100644 --- a/gfx/webrender_bindings/DCLayerTree.cpp +++ b/gfx/webrender_bindings/DCLayerTree.cpp @@ -6,6 +6,39 @@ #include "DCLayerTree.h" +// - + +#if (_WIN32_WINNT < _WIN32_WINNT_WIN10) + +# define XSTR(x) STR(x) +# define STR(x) #x +// clang-format off + +# pragma message "IDCompositionFilterEffect in dcomp.h requires _WIN32_WINNT >= _WIN32_WINNT_WIN10." +// Pedantically, it actually requires _WIN32_WINNT_WINTHRESHOLD, but that's the +// same as _WIN32_WINNT_WIN10. + +# pragma message "Forcing NTDDI_VERSION " XSTR(NTDDI_VERSION) " -> " XSTR(NTDDI_WIN10) +# undef NTDDI_VERSION +# define NTDDI_VERSION NTDDI_WIN10 + +# pragma message "Forcing _WIN32_WINNT " XSTR(_WIN32_WINNT) " -> " XSTR(_WIN32_WINNT_WIN10) +# undef _WIN32_WINNT +# define _WIN32_WINNT _WIN32_WINNT_WIN10 + +// clang-format on +# undef STR +# undef XSTR + +#endif + +#include +#include +#include +#include + +// - + #include "gfxWindowsPlatform.h" #include "GLContext.h" #include "GLContextEGL.h" @@ -24,20 +57,6 @@ #include "nsPrintfCString.h" #include "WinUtils.h" -#undef _WIN32_WINNT -#define _WIN32_WINNT _WIN32_WINNT_WINBLUE -#undef NTDDI_VERSION -#define NTDDI_VERSION NTDDI_WINBLUE - -// We also need this, or dcomp.h won't give us e.g. IDCompositionFilterEffect: -#undef _WIN32_WINNT_WINTHRESHOLD -#define _WIN32_WINNT_WINTHRESHOLD _WIN32_WINNT - -#include -#include -#include -#include - namespace mozilla { namespace wr { -- 2.11.4.GIT