From e2e483ac47ae12c9d4151d7936d2f793fbc60620 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 17 Sep 2020 15:28:59 +0000 Subject: Issue #1653 - Part 2: Stop indirectly loading DWM functions through WinUtils. --- gfx/thebes/gfxWindowsPlatform.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'gfx/thebes') diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 82e36efe2..4a94a751b 100755 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -39,8 +39,6 @@ #include "DeviceManagerD3D9.h" #include "mozilla/layers/ReadbackManagerD3D11.h" -#include "WinUtils.h" - #include "gfxDWriteFontList.h" #include "gfxDWriteFonts.h" #include "gfxDWriteCommon.h" @@ -59,6 +57,7 @@ #include "nsMemory.h" +#include #include #include "nsIMemoryReporter.h" @@ -1633,10 +1632,9 @@ gfxWindowsPlatform::InitGPUProcessSupport() bool gfxWindowsPlatform::DwmCompositionEnabled() { - MOZ_ASSERT(WinUtils::dwmIsCompositionEnabledPtr); BOOL dwmEnabled = false; - if (FAILED(WinUtils::dwmIsCompositionEnabledPtr(&dwmEnabled))) { + if (FAILED(DwmIsCompositionEnabled(&dwmEnabled))) { return false; } @@ -1671,7 +1669,7 @@ public: DWM_TIMING_INFO vblankTime; // Make sure to init the cbSize, otherwise GetCompositionTiming will fail vblankTime.cbSize = sizeof(DWM_TIMING_INFO); - HRESULT hr = WinUtils::dwmGetCompositionTimingInfoPtr(0, &vblankTime); + HRESULT hr = DwmGetCompositionTimingInfo(0, &vblankTime); if (SUCCEEDED(hr)) { UNSIGNED_RATIO refreshRate = vblankTime.rateRefresh; // We get the rate in hertz / time, but we want the rate in ms. @@ -1756,7 +1754,7 @@ public: // Make sure to init the cbSize, otherwise // GetCompositionTiming will fail vblankTime.cbSize = sizeof(DWM_TIMING_INFO); - HRESULT hr = WinUtils::dwmGetCompositionTimingInfoPtr(0, &vblankTime); + HRESULT hr = DwmGetCompositionTimingInfo(0, &vblankTime); if (!SUCCEEDED(hr)) { return vsync; } @@ -1838,7 +1836,7 @@ public: // Using WaitForVBlank, the whole system dies because WaitForVBlank // only works if it's run on the same thread as the Present(); - HRESULT hr = WinUtils::dwmFlushProcPtr(); + HRESULT hr = DwmFlush(); if (!SUCCEEDED(hr)) { // DWMFlush isn't working, fallback to software vsync. ScheduleSoftwareVsync(TimeStamp::Now()); @@ -1918,13 +1916,9 @@ already_AddRefed gfxWindowsPlatform::CreateHardwareVsyncSource() { MOZ_RELEASE_ASSERT(NS_IsMainThread(), "GFX: Not in main thread."); - if (!WinUtils::dwmIsCompositionEnabledPtr) { - NS_WARNING("Dwm composition not available, falling back to software vsync"); - return gfxPlatform::CreateHardwareVsyncSource(); - } BOOL dwmEnabled = false; - WinUtils::dwmIsCompositionEnabledPtr(&dwmEnabled); + DwmIsCompositionEnabled(&dwmEnabled); if (!dwmEnabled) { NS_WARNING("DWM not enabled, falling back to software vsync"); return gfxPlatform::CreateHardwareVsyncSource(); -- cgit v1.2.3