diff options
author | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-09-21 15:08:09 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-09-21 15:19:56 (GMT) |
commit | eb2926a2f9607e985b8bca54346e6fdf91343247 (patch) | |
tree | 3910c0d194d515a5058bd7e839ae453255041a93 /src/gui/painting/qtextureglyphcache_p.h | |
parent | fc7f7d9193f0b9e4bfefa63d739a24005c0140af (diff) | |
download | Qt-eb2926a2f9607e985b8bca54346e6fdf91343247.zip Qt-eb2926a2f9607e985b8bca54346e6fdf91343247.tar.gz Qt-eb2926a2f9607e985b8bca54346e6fdf91343247.tar.bz2 |
Fixed drawing a large number of glyphs with the same font under GL.
Our glyph caching system doesn't take GL texture size limitation into
account, and assumes you can create an infinitely large texture.
On top of that, the cache will never create a cache that is wider
than 256, or QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH, which means we'll
hit the texture size limit even faster. With this patch the entire
texture is utilized. However, to fix in properly we need to support
having multiple texture for each font engine. That will be fixed
shortly (see task QTBUG-13784).
Task-number: QT-3971
Reviewed-by: Eskil
Diffstat (limited to 'src/gui/painting/qtextureglyphcache_p.h')
-rw-r--r-- | src/gui/painting/qtextureglyphcache_p.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/painting/qtextureglyphcache_p.h b/src/gui/painting/qtextureglyphcache_p.h index a818978..e6d2b22 100644 --- a/src/gui/painting/qtextureglyphcache_p.h +++ b/src/gui/painting/qtextureglyphcache_p.h @@ -64,6 +64,10 @@ # undef m_type #endif +#ifndef QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH +#define QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH 256 +#endif + struct glyph_metrics_t; typedef unsigned int glyph_t; @@ -113,6 +117,8 @@ public: QHash<glyph_t, Coord> coords; QImage textureMapForGlyph(glyph_t g) const; + virtual int maxTextureWidth() const { return QT_DEFAULT_TEXTURE_GLYPH_CACHE_WIDTH; } + virtual int maxTextureHeight() const { return 32768; } protected: QFontEngine *m_current_fontengine; |