diff options
author | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-05-23 16:04:21 +0200 |
---|---|---|
committer | Gunnar Sletta <gunnar.sletta@nokia.com> | 2011-05-23 16:04:21 +0200 |
commit | 780097f270c40814691459396661ebed90285ab8 (patch) | |
tree | 0bb09ba85d2e4d594cb8f8995029abdad70720ed /src/declarative | |
parent | f0819b0c3f80fb4f6abad8f00ef94cf52dd6c123 (diff) | |
parent | 7aa14bb332a737490698f2d2381877980cdc25ee (diff) |
Merge branch 'qtquick2' of scm.dev.nokia.troll.no:qt/qtdeclarative-staging into qtquick2
Diffstat (limited to 'src/declarative')
-rw-r--r-- | src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp index a21fccefcf..27da408d65 100644 --- a/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp +++ b/src/declarative/scenegraph/qsgdistancefieldglyphcache.cpp @@ -678,6 +678,15 @@ int QSGDistanceFieldGlyphCache::distanceFieldRadius() const void QSGDistanceFieldGlyphCache::populate(int count, const glyph_t *glyphs) { + // Avoid useless and costly glyph re-generation + if (cacheIsFull() && !m_textureData->unusedGlyphs.isEmpty()) { + for (int i = 0; i < count; ++i) { + glyph_t glyphIndex = glyphs[i]; + if (m_textureData->texCoords.contains(glyphIndex) && m_textureData->unusedGlyphs.contains(glyphIndex)) + m_textureData->unusedGlyphs.remove(glyphIndex); + } + } + for (int i = 0; i < count; ++i) { glyph_t glyphIndex = glyphs[i]; if ((int) glyphIndex >= glyphCount()) { |