summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-07-15 08:05:11 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-07-15 08:27:20 (GMT)
commit37f585ece17063a814598221c0cbb874c52d223f (patch)
tree2efb05888c1049847f947c3754083d140cbf92b1
parent0f9fd37ad2d0c9d58570e621666b570f19489be5 (diff)
downloadQt-37f585ece17063a814598221c0cbb874c52d223f.zip
Qt-37f585ece17063a814598221c0cbb874c52d223f.tar.gz
Qt-37f585ece17063a814598221c0cbb874c52d223f.tar.bz2
Support glyphs that are wider than default width in texture glyph cache
We need to reserve space for the widest possible glyph in the font Reviewed-by: Kim
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 29cd82b..376219b 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -127,8 +127,12 @@ void QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
rowHeight += margin * 2 + paddingDoubled;
- if (m_w == 0)
- m_w = QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH;
+ if (m_w == 0) {
+ if (fontEngine->maxCharWidth() <= QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH)
+ m_w = QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH;
+ else
+ m_w = qt_next_power_of_two(fontEngine->maxCharWidth());
+ }
// now actually use the coords and paint the wanted glyps into cache.
QHash<glyph_t, Coord>::iterator iter = listItemCoordinates.begin();