summaryrefslogtreecommitdiffstats
path: root/gfx/thebes/DeviceManagerDx.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /gfx/thebes/DeviceManagerDx.h
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/thebes/DeviceManagerDx.h')
-rw-r--r--gfx/thebes/DeviceManagerDx.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/gfx/thebes/DeviceManagerDx.h b/gfx/thebes/DeviceManagerDx.h
index c6860c7ffa..1e4182ddec 100644
--- a/gfx/thebes/DeviceManagerDx.h
+++ b/gfx/thebes/DeviceManagerDx.h
@@ -6,6 +6,7 @@
#ifndef mozilla_gfx_thebes_DeviceManagerDx_h
#define mozilla_gfx_thebes_DeviceManagerDx_h
+#include <set>
#include <vector>
#include "gfxPlatform.h"
@@ -58,13 +59,18 @@ class DeviceManagerDx final {
static DeviceManagerDx* Get() { return sInstance; }
+ enum class DeviceFlag {
+ isHardwareWebRenderInUse,
+ disableDeviceReuse,
+ };
+ using DeviceFlagSet = EnumSet<DeviceFlag, uint8_t>;
RefPtr<ID3D11Device> GetCompositorDevice();
RefPtr<ID3D11Device> GetContentDevice();
RefPtr<ID3D11Device> GetCanvasDevice();
RefPtr<ID3D11Device> GetImageDevice();
RefPtr<IDCompositionDevice2> GetDirectCompositionDevice();
RefPtr<ID3D11Device> GetVRDevice();
- RefPtr<ID3D11Device> CreateDecoderDevice(bool aHardwareWebRender);
+ RefPtr<ID3D11Device> CreateDecoderDevice(DeviceFlagSet aFlags);
RefPtr<ID3D11Device> CreateMediaEngineDevice();
IDirectDraw7* GetDirectDraw();
@@ -91,7 +97,10 @@ class DeviceManagerDx final {
bool GetOutputFromMonitor(HMONITOR monitor, RefPtr<IDXGIOutput>* aOutOutput);
void PostUpdateMonitorInfo();
+ void UpdateMonitorInfo();
bool SystemHDREnabled();
+ bool WindowHDREnabled(HWND aWindow);
+ bool MonitorHDREnabled(HMONITOR aMonitor);
// Check if the current adapter supports hardware stretching
void CheckHardwareStretchingSupport(HwStretchingSupport& aRv);
@@ -177,7 +186,6 @@ class DeviceManagerDx final {
bool GetAnyDeviceRemovedReason(DeviceResetReason* aOutReason)
MOZ_REQUIRES(mDeviceLock);
- void UpdateMonitorInfo();
std::vector<DXGI_OUTPUT_DESC1> GetOutputDescs();
private:
@@ -193,6 +201,7 @@ class DeviceManagerDx final {
mutable mozilla::Mutex mDeviceLock;
nsTArray<D3D_FEATURE_LEVEL> mFeatureLevels MOZ_GUARDED_BY(mDeviceLock);
RefPtr<IDXGIAdapter1> mAdapter MOZ_GUARDED_BY(mDeviceLock);
+ RefPtr<IDXGIFactory1> mFactory MOZ_GUARDED_BY(mDeviceLock);
RefPtr<ID3D11Device> mCompositorDevice MOZ_GUARDED_BY(mDeviceLock);
RefPtr<ID3D11Device> mContentDevice MOZ_GUARDED_BY(mDeviceLock);
RefPtr<ID3D11Device> mCanvasDevice MOZ_GUARDED_BY(mDeviceLock);
@@ -208,6 +217,7 @@ class DeviceManagerDx final {
Maybe<DeviceResetReason> mDeviceResetReason MOZ_GUARDED_BY(mDeviceLock);
RefPtr<Runnable> mUpdateMonitorInfoRunnable MOZ_GUARDED_BY(mDeviceLock);
Maybe<bool> mSystemHdrEnabled MOZ_GUARDED_BY(mDeviceLock);
+ std::set<HMONITOR> mHdrMonitors MOZ_GUARDED_BY(mDeviceLock);
nsModuleHandle mDirectDrawDLL;
RefPtr<IDirectDraw7> mDirectDraw;