diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-07-15 11:07:34 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-08-03 19:06:19 +0200 |
commit | 3ee65daa74f36434b5a3d78b509247511d7867e1 (patch) | |
tree | a85fc15d9bf456948465c10d159f2b990cd6cdb1 /src/gui/CMakeLists.txt | |
parent | 71e3840f3a36eb176fe5896c4fbc888a00968ad3 (diff) |
rhi: d3d: Switch to DirectComposition for semi-transparent windows
A window with alpha > 0 is no longer forced to using a legacy,
non-flip swapchain. Instead, the Win8+ DirectComposition API is used
in that case to get a properly composited semi-transparent window.
The remainings of the non-flip model swapchain support, that was left
after purging Windows 7 in order to support semi-transparent windows,
is now gone completely. Setting QT_D3D_NO_FLIP has no effect from now
on. DXGIFactory2 and flip model swapchains are now always required and
in use.
There is one downside when it comes to the swap effect: for
semi-transparent windows we will be stuck with SCALING_STRETCH as
SCALING_NONE is not supported on this path. Using NONE over STRETCH
was preferable for typical Qt applications because user interfaces
typically look "nicer" during resize without stretching when ending up
with a size-mismatched Present. For normal (non-translucent) windows
this will continue to be the case, but enabling alpha will now move
back to SCALING_STRETCH implicitly.
In addition, it looks like AlphaMode is ignored when using
CreateSwapChainForComposition. Setting DXGI_ALPHA_MODE_STRAIGHT fails
always whereas other values lead to an identical looking (with
transparency) result. Therefore we just set it to
DXGI_ALPHA_MODE_PREMULTIPLIED regaredless of which QRhiSwapChain alpha
flag is set.
Fixes: QTBUG-105271
Change-Id: Ie7a584e1656ccfdb506489ea21c41706f57c4018
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/CMakeLists.txt')
-rw-r--r-- | src/gui/CMakeLists.txt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 8d66feee50..32b69350c1 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -424,6 +424,7 @@ qt_internal_extend_target(Gui CONDITION WIN32 d3d11 dxgi dxguid + dcomp ) #### Keys ignored in scope 7:.:.:gui.pro:WIN32: |