diff options
author | Moonchild <moonchild@palemoon.org> | 2020-09-23 23:45:46 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-09-23 23:45:46 +0000 |
commit | 9f5c27ba479c54d4ebb1bd59b61fbf793f6df93f (patch) | |
tree | 831e0ae1649d6135429def03688bc93ff7c86b03 /gfx/thebes/gfxWindowsPlatform.cpp | |
parent | 42f895f27f239e973c9c06241f7a58da7381353c (diff) | |
parent | f624bd1375655dea196cdcb70a9860bc5817df49 (diff) | |
download | UXP-f265788b02973b1ff9c27d63855076dc6185e0a7.tar UXP-f265788b02973b1ff9c27d63855076dc6185e0a7.tar.gz UXP-f265788b02973b1ff9c27d63855076dc6185e0a7.tar.lz UXP-f265788b02973b1ff9c27d63855076dc6185e0a7.tar.xz UXP-f265788b02973b1ff9c27d63855076dc6185e0a7.zip |
Merge branch 'redwood' into releaseRELBASE_20200929RC_20200924
Diffstat (limited to 'gfx/thebes/gfxWindowsPlatform.cpp')
-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 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 <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(); |