diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-09-09 15:48:09 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-09-12 16:28:42 +0200 |
commit | 3d7207414b07104c1ea03ef341301a7390d7b0ad (patch) | |
tree | 840f5eaaf8b789c8e0f1b3d2a3ecb54b1f3cb0cb /src | |
parent | ef78a2e8f9bade867e43c75892353e38d48c595c (diff) |
rhi: metal: Configure the layer's opaque property as appropriate
Task-number: QTBUG-78089
Change-Id: I6cd95e24d38562cf1931c107bb6b719e340583a8
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/rhi/qrhimetal.mm | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm index 770786db98..2d85c86bf0 100644 --- a/src/gui/rhi/qrhimetal.mm +++ b/src/gui/rhi/qrhimetal.mm @@ -3596,6 +3596,18 @@ bool QMetalSwapChain::buildOrResize() } #endif + if (m_flags.testFlag(SurfaceHasPreMulAlpha)) { + d->layer.opaque = NO; + } else if (m_flags.testFlag(SurfaceHasNonPreMulAlpha)) { + // The CoreAnimation compositor is said to expect premultiplied alpha, + // so this is then wrong when it comes to the blending operations but + // there's nothing we can do. Fortunately Qt Quick always outputs + // premultiplied alpha so it is not a problem there. + d->layer.opaque = NO; + } else { + d->layer.opaque = YES; + } + m_currentPixelSize = surfacePixelSize(); pixelSize = m_currentPixelSize; |