summaryrefslogtreecommitdiffstats
path: root/gfx
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-09-17 15:28:59 +0000
committerMoonchild <moonchild@palemoon.org>2020-09-21 11:05:03 +0000
commite2e483ac47ae12c9d4151d7936d2f793fbc60620 (patch)
treeafd9024a78030eb8e4680ad453b7d7ced0c5cdd2 /gfx
parent892a2d9655650616c361750a4d1a49f7d7914ad2 (diff)
downloadUXP-e2e483ac47ae12c9d4151d7936d2f793fbc60620.tar
UXP-e2e483ac47ae12c9d4151d7936d2f793fbc60620.tar.gz
UXP-e2e483ac47ae12c9d4151d7936d2f793fbc60620.tar.lz
UXP-e2e483ac47ae12c9d4151d7936d2f793fbc60620.tar.xz
UXP-e2e483ac47ae12c9d4151d7936d2f793fbc60620.zip
Issue #1653 - Part 2: Stop indirectly loading DWM functions through WinUtils.
Diffstat (limited to 'gfx')
-rwxr-xr-xgfx/thebes/gfxWindowsPlatform.cpp18
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();