From 85310221f0512bf1aeefc49ead8a1e11bda55990 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 05:01:59 +0200 Subject: Adding upstream version 126.0.1. Signed-off-by: Daniel Baumann --- gfx/thebes/DeviceManagerDx.cpp | 46 ++++++++++++++++++++---------------------- gfx/thebes/DeviceManagerDx.h | 1 - 2 files changed, 22 insertions(+), 25 deletions(-) (limited to 'gfx') diff --git a/gfx/thebes/DeviceManagerDx.cpp b/gfx/thebes/DeviceManagerDx.cpp index 7d00e5ac1d..3a531e92ae 100644 --- a/gfx/thebes/DeviceManagerDx.cpp +++ b/gfx/thebes/DeviceManagerDx.cpp @@ -1106,33 +1106,31 @@ RefPtr DeviceManagerDx::CreateDecoderDevice( bool isAMD = mDeviceStatus->adapter().VendorId == 0x1002; bool reuseDevice = false; - if (!aFlags.contains(DeviceFlag::disableDeviceReuse)) { - if (gfxVars::ReuseDecoderDevice()) { - reuseDevice = true; - } else if (isAMD) { - reuseDevice = true; - gfxCriticalNoteOnce << "Always have to reuse decoder device on AMD"; - } + if (gfxVars::ReuseDecoderDevice()) { + reuseDevice = true; + } else if (isAMD) { + reuseDevice = true; + gfxCriticalNoteOnce << "Always have to reuse decoder device on AMD"; + } - if (reuseDevice) { - // Use mCompositorDevice for decoder device only for hardware WebRender. - if (aFlags.contains(DeviceFlag::isHardwareWebRenderInUse) && - mCompositorDevice && mCompositorDeviceSupportsVideo && - !mDecoderDevice) { - mDecoderDevice = mCompositorDevice; - - RefPtr multi; - mDecoderDevice->QueryInterface(__uuidof(ID3D10Multithread), - getter_AddRefs(multi)); - if (multi) { - MOZ_ASSERT(multi->GetMultithreadProtected()); - } + if (reuseDevice) { + // Use mCompositorDevice for decoder device only for hardware WebRender. + if (aFlags.contains(DeviceFlag::isHardwareWebRenderInUse) && + mCompositorDevice && mCompositorDeviceSupportsVideo && + !mDecoderDevice) { + mDecoderDevice = mCompositorDevice; + + RefPtr multi; + mDecoderDevice->QueryInterface(__uuidof(ID3D10Multithread), + getter_AddRefs(multi)); + if (multi) { + MOZ_ASSERT(multi->GetMultithreadProtected()); } + } - if (mDecoderDevice) { - RefPtr dev = mDecoderDevice; - return dev.forget(); - } + if (mDecoderDevice) { + RefPtr dev = mDecoderDevice; + return dev.forget(); } } diff --git a/gfx/thebes/DeviceManagerDx.h b/gfx/thebes/DeviceManagerDx.h index 1e4182ddec..ee44447d23 100644 --- a/gfx/thebes/DeviceManagerDx.h +++ b/gfx/thebes/DeviceManagerDx.h @@ -61,7 +61,6 @@ class DeviceManagerDx final { enum class DeviceFlag { isHardwareWebRenderInUse, - disableDeviceReuse, }; using DeviceFlagSet = EnumSet; RefPtr GetCompositorDevice(); -- cgit v1.2.3