diff options
author | Moonchild <moonchild@palemoon.org> | 2020-09-17 15:28:59 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-09-17 15:28:59 +0000 |
commit | a0cdf328774e553eec1df9276604362d7a3679cd (patch) | |
tree | f0cc09abc8f4dae8cb27b53a2c5421ce329f45db /gfx/thebes | |
parent | 8151bb2b05f71c7fac9aefc94b97d7b703c8d803 (diff) | |
download | uxp-a0cdf328774e553eec1df9276604362d7a3679cd.tar.gz |
Issue #1653 - Part 2: Stop indirectly loading DWM functions through WinUtils.
Diffstat (limited to 'gfx/thebes')
-rwxr-xr-x | gfx/thebes/gfxWindowsPlatform.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 82e36efe28..4a94a751b3 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 <dwmapi.h> #include <d3d11.h> #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<mozilla::gfx::VsyncSource> 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(); |