diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-09-11 09:50:57 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-09-12 10:40:02 +0000 |
commit | d39d1a9e67affb3fd44fdd9ec71a50282a6fed1f (patch) | |
tree | 4390bde6be2b29c96a9aab2af4d30095069fd339 /src/gui/rhi | |
parent | 6f592ea300dfc69343aef1e79c7df5579909d3e9 (diff) |
rhi: Clarify the swapchain alpha flag docs
Change-Id: Iff0edf0ae40b830af0209403d899def922e6088c
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src/gui/rhi')
-rw-r--r-- | src/gui/rhi/qrhi.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index 65cfaf5123..5ad433cf23 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -3458,10 +3458,18 @@ QRhiResource::Type QRhiGraphicsPipeline::resourceType() const Flag values to describe swapchain properties \value SurfaceHasPreMulAlpha Indicates that the target surface has - transparency with premultiplied alpha. + transparency with premultiplied alpha. For example, this is what Qt Quick + uses when the alpha channel is enabled on the target QWindow, because the + scenegraph rendrerer always outputs fragments with alpha multiplied into + the red, green, and blue values. To ensure identical behavior across + platforms, always set QSurfaceFormat::alphaBufferSize() to a non-zero value + on the target QWindow whenever this flag is set on the swapchain. \value SurfaceHasNonPreMulAlpha Indicates the target surface has - transparencyt with non-premultiplied alpha. + transparency with non-premultiplied alpha. Be aware that this may not be + supported on some systems, if the system compositor always expects content + with premultiplied alpha. In that case the behavior with this flag set is + expected to be equivalent to SurfaceHasPreMulAlpha. \value sRGB Requests to pick an sRGB format for the swapchain and/or its render target views, where applicable. Note that this implies that sRGB |