From 5def42f7832b599d5359d7d31218f0488673d4b9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 29 Jul 2016 09:51:57 +0200 Subject: Fix alpha from qfontengine_ft to fit qdrawhelper expectations The short-cuts in qdrawhelper's qt_alphargbblit_argb32 expects the alpha value of the A32 glyphs to be 0xff. Since the alpha value is not otherwise used, set it to that. The reported image format is also changed to RGB32, matching coretext and windows fontengines, and expected by the OpenGL paintengine. Change-Id: I0873156d716566f7f1634249155b6c9983a3d0de Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontengine_ft.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/gui/text/qfontengine_ft.cpp') diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index b79fa6e9db..db2f88f79a 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -586,8 +586,7 @@ static void convertRGBToARGB_helper(const uchar *src, uint *dst, int width, int uchar green = src[x + 1]; uchar blue = src[x + 1 + offs]; LcdFilter::filterPixel(red, green, blue); - // alpha = green - *dd++ = (green << 24) | (red << 16) | (green << 8) | blue; + *dd++ = (0xFF << 24) | (red << 16) | (green << 8) | blue; } dst += width; src += src_pitch; @@ -612,8 +611,7 @@ static void convertRGBToARGB_V_helper(const uchar *src, uint *dst, int width, in uchar green = src[x + src_pitch]; uchar blue = src[x + src_pitch + offs]; LcdFilter::filterPixel(red, green, blue); - // alpha = green - *dst++ = (green << 24) | (red << 16) | (green << 8) | blue; + *dst++ = (0XFF << 24) | (red << 16) | (green << 8) | blue; } src += 3*src_pitch; } @@ -1855,7 +1853,7 @@ static inline QImage alphaMapFromGlyphData(QFontEngineFT::Glyph *glyph, QFontEng bytesPerLine = (glyph->width + 3) & ~3; break; case QFontEngine::Format_A32: - format = QImage::Format_ARGB32; + format = QImage::Format_RGB32; bytesPerLine = glyph->width * 4; break; default: -- cgit v1.2.3