aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2012-03-05 17:25:50 +0100
committerQt by Nokia <qt-info@nokia.com>2012-03-06 10:52:06 +0100
commit7efdf7ae39703afd96212bbbca8bb94f69f39dd4 (patch)
treee722201ebe251fdf771f1d0397651c05890d486e /src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h
parenta951b83c186f2d8d92a58387d692342cf9ad80f7 (diff)
Fix missing glyphs when using shared distance-field cache
When using a shared distance field cache, signals such as itemsMissing() and itemsUpdated() can be triggered in the server process by external requests. This, in turn, can lead to unnecessary storeGlyphs() calls (performance hit) and, even worse, calls to setGlyphPositions() for glyphs which have not previously been requested through populate(). The latter could cause missing glyphs when the same characters were requested later, as they would then be stored in the cache with the bounding rect of a default constructed QPainterPath (in setGlyphPositions()). To fix this, we ignore all glyphs which have no been requested in this process, thus filtering out all events for glyphs which have only been used externally so far. I've also added an assert to the setGlyphPositions() to help us catch this case early if it should return. Change-Id: Ief333f612e4affea768d9c60409d43ce29fe3f60 Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h')
-rw-r--r--src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h
index 3052f20813..4a91b4473a 100644
--- a/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h
+++ b/src/quick/scenegraph/qsgshareddistancefieldglyphcache_p.h
@@ -87,6 +87,7 @@ private:
void saveTexture(GLuint textureId, int width, int height);
QSet<quint32> m_requestedGlyphsThatHaveNotBeenReturned;
+ QSet<quint32> m_requestedGlyphs;
QWaitCondition m_pendingGlyphsCondition;
QByteArray m_cacheId;
QPlatformSharedGraphicsCache *m_sharedGraphicsCache;