diff options
author | Trond Kjernaasen <trond@trolltech.com> | 2009-05-26 12:20:34 (GMT) |
---|---|---|
committer | Trond Kjernaasen <trond@trolltech.com> | 2009-05-26 12:25:38 (GMT) |
commit | 871b730da203cef773e159960532888522f16a0b (patch) | |
tree | cfedefb69328589aef74dcb9801099b964a7d37e /src/gui/painting | |
parent | 8a2ca9b0d8ed23cec44e40f61c0f4983fbc55282 (diff) | |
download | Qt-871b730da203cef773e159960532888522f16a0b.zip Qt-871b730da203cef773e159960532888522f16a0b.tar.gz Qt-871b730da203cef773e159960532888522f16a0b.tar.bz2 |
BT: Fixed GL textdrawing in the Boxes demo.
Reworked the 85f98acaa3a38079071bea711e43c9a86edec1f6 fix, since
it broke glyph positioning in the GL engine under Windows.
Instead of changing the glyph cache margin, which impacts where
the glyph is positioned, we just make the image the glyph is drawn
into 4 pixels bigger in width/heigth.
The margin in QImageTextureGlyphCache needs to be reworked..
Task-number: 254450
Reviewed-by: Eskil
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qtextureglyphcache.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 3fd1ffb..89df869 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -92,8 +92,8 @@ void QTextureGlyphCache::populate(const QTextItemInt &ti, int glyph_height = metrics.height.ceil().toInt(); if (glyph_height == 0 || glyph_width == 0) continue; - glyph_width += margin * 2 + 2; - glyph_height += margin * 2 + 2; + glyph_width += margin * 2 + 4; + glyph_height += margin * 2 + 4; // align to 8-bit boundary if (m_type == QFontEngineGlyphCache::Raster_Mono) glyph_width = (glyph_width+7)&~7; @@ -189,7 +189,11 @@ void QImageTextureGlyphCache::createTextureData(int width, int height) int QImageTextureGlyphCache::glyphMargin() const { +#ifdef Q_WS_MAC return 2; +#else + return m_type == QFontEngineGlyphCache::Raster_RGBMask ? 2 : 0; +#endif } void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g) |