From 0990f073953a499b1413b049c1909d09fec5a815 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 20 Jun 2011 14:18:46 +0200 Subject: [PATCH] Start out with a distance field cache that fits more characters --- .../scenegraph/qsgdistancefieldglyphcache.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp index e216dd4..c63ff9d 100644 --- a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp +++ b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp @@ -912,8 +912,9 @@ void QSGDistanceFieldGlyphCache::updateCache() if (m_textureData->pendingGlyphs.isEmpty()) return; - int requiredWidth = m_textureData->currY == 0 ? m_textureData->currX : maxTextureSize(); - int requiredHeight = qMin(maxTextureSize(), m_textureData->currY + QT_DISTANCEFIELD_TILESIZE); + int requiredWidth = maxTextureSize(); + int rows = 128 / (requiredWidth / QT_DISTANCEFIELD_TILESIZE); // Enough rows to fill the latin1 set by default.. + int requiredHeight = qMin(maxTextureSize(), qMax(m_textureData->currY + QT_DISTANCEFIELD_TILESIZE, QT_DISTANCEFIELD_TILESIZE * rows)); resizeTexture((requiredWidth), (requiredHeight)); glBindTexture(GL_TEXTURE_2D, m_textureData->texture); -- 1.7.2.5