From 2170a46ceef158eab6ccb7ecbeb26ae3053e6544 Mon Sep 17 00:00:00 2001 From: Yoann Lopes Date: Tue, 16 Apr 2013 16:29:21 +0200 Subject: [PATCH] Fixed alpha blending for native text. Change-Id: I3effd31849b21a9497fadfb22c959562bff7951b Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index 419062d..3df1153 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -95,7 +95,8 @@ const char *QSGTextMaskMaterialData::fragmentShader() const { "uniform sampler2D texture; \n" "uniform lowp vec4 color; \n" "void main() { \n" - " gl_FragColor = vec4(texture2D(texture, sampleCoord).rgb * color.a, 1.0); \n" + " lowp vec4 glyph = texture2D(texture, sampleCoord); \n" + " gl_FragColor = vec4(glyph.rgb * color.a, glyph.a); \n" "}"; } @@ -162,7 +163,7 @@ void QSGTextMaskMaterialData::updateState(const RenderState &state, QSGMaterial state.context()->functions()->glBlendColor(c.redF(), c.greenF(), c.blueF(), - 1.0f); + c.alphaF()); } } -- 2.7.4