diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-29 22:37:09 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-29 22:37:09 (GMT) |
commit | 3fa715ef374d9f9064abb421fae6534f745ea9f8 (patch) | |
tree | 4256d33f0c8e81df96716f84dee3acb8a7820cef /src/gui/text/qfontengine_qws.cpp | |
parent | 8c3bf71e6fcbcfb21b9574e25cfdb00614a0c68d (diff) | |
download | Qt-3fa715ef374d9f9064abb421fae6534f745ea9f8.zip Qt-3fa715ef374d9f9064abb421fae6534f745ea9f8.tar.gz Qt-3fa715ef374d9f9064abb421fae6534f745ea9f8.tar.bz2 |
Make QPF's implementation of alphaMapForGlyph() consistent.
The QPF implementation of alphaMapForGlyph() was returning
color values of RGBA = (a, a, a, 255) instead of (0, 0, 0, a),
which was inconsistent with all the other font engines.
This inconsistency caused some QPF-specific workarounds in the
OpenGL and OpenVG paint engines. This change removes the workarounds
and makes QPF generate the right colors from the start. Paint
engines that ignore the color table or which don't use the
alphaMapForGlyph() function (e.g. raster) are not affected.
Reviewed-by: Paul
Diffstat (limited to 'src/gui/text/qfontengine_qws.cpp')
-rw-r--r-- | src/gui/text/qfontengine_qws.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_qws.cpp b/src/gui/text/qfontengine_qws.cpp index 888e1be..de8028c 100644 --- a/src/gui/text/qfontengine_qws.cpp +++ b/src/gui/text/qfontengine_qws.cpp @@ -528,10 +528,12 @@ QImage QFontEngineQPF1::alphaMapForGlyph(glyph_t g) QImage image; if (mono) { image = QImage((glyph->metrics->width+7)&~7, glyph->metrics->height, QImage::Format_Mono); + image.setColor(0, qRgba(0, 0, 0, 0)); + image.setColor(1, qRgba(0, 0, 0, 255)); } else { image = QImage(glyph->metrics->width, glyph->metrics->height, QImage::Format_Indexed8); for (int j=0; j<256; ++j) - image.setColor(j, 0xff000000 | j | (j<<8) | (j<<16)); + image.setColor(j, qRgba(0, 0, 0, j)); } for (int i=0; i<glyph->metrics->height; ++i) { memcpy(image.scanLine(i), bits, glyph->metrics->linestep); |