aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2022-06-15 15:45:12 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-06-16 23:27:48 +0000
commitdcb79d952139c98ff93b3612e81dc9d5a4f52d18 (patch)
treea2cb0a0898e2cbaf2af31387a4a31ffdd178ce3a /src/quick
parentfa8dc8c40b2950e1697f3221c8179a427f160bd1 (diff)
Fix alpha with native text rendering
The immediate problem with incorrect semi-transparent Text with NativeRendering is a porting error from 5.14 times, comparing with https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp?h=5.15#n292 shows that the constant color used for blending does not have alpha premultiplied into the color in 5.15. In the rhi-based code updateUniformData does the premultiplication when setting the data for the uniform, like in Qt 5, but then in upgradeGraphicsPipelineState it also multiplies whereas Qt 5 did not. In fact that there's a Q_UNUSED(state) at the top of the function shows that accessing state.opacity() was not meant to be there in the first place and got added later for reasons unknown. Fixes: QTBUG-100820 Change-Id: I3acb839676c00e7aa1e2ff2f93eefcaa87b7d0de Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 08e2a90f9afd0a7852f4f594029fa21d2fc1478e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/scenegraph/qsgdefaultglyphnode_p.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
index 44e9639f6a..a87fdc29c0 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
@@ -274,7 +274,8 @@ bool QSG24BitTextMaskRhiShader::updateGraphicsPipelineState(RenderState &state,
ps->srcColor = GraphicsPipelineState::ConstantColor;
ps->dstColor = GraphicsPipelineState::OneMinusSrcColor;
- QVector4D color = qsg_premultiply(mat->color(), state.opacity());
+ QVector4D color = mat->color();
+
// if (useSRGB())
// color = qt_sRGB_to_linear_RGB(color);