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>
This commit is contained in:
parent
b23fb2f07f
commit
5def42f783
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user