From: Yoann Lopes Date: Tue, 16 Apr 2013 14:29:21 +0000 (+0200) Subject: Fixed alpha blending for native text. X-Git-Tag: upstream/5.2.1~803^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2170a46ceef158eab6ccb7ecbeb26ae3053e6544;p=platform%2Fupstream%2Fqtdeclarative.git Fixed alpha blending for native text. Change-Id: I3effd31849b21a9497fadfb22c959562bff7951b Reviewed-by: Eskil Abrahamsen Blomfeldt --- 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()); } }