summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine_ft.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-07-29 09:51:57 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-08-16 11:50:34 +0000
commit5def42f7832b599d5359d7d31218f0488673d4b9 (patch)
tree84f6a2494e88097aafa4a73babcd3d83f91922ca /src/gui/text/qfontengine_ft.cpp
parentb23fb2f07fa9b8aac3524507aa6748bf9ccac08b (diff)
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 <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui/text/qfontengine_ft.cpp')
-rw-r--r--src/gui/text/qfontengine_ft.cpp8
1 files changed, 3 insertions, 5 deletions
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: