diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-10-14 15:59:45 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-18 23:24:39 +0200 |
commit | 22c2d13406394077792c106ce1b60b3203aaf392 (patch) | |
tree | dde509b89d3528b6e46b988c40d9b4f7f4c4ed8b | |
parent | ab17a3c3c40d578397fd9d2d03eda8e13976fcfc (diff) |
Make it possible to clear glyph caches from the font engine.
Change-Id: Iea62bc1727269ed3893d8b4dbcefa583f1b85d7f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
-rw-r--r-- | src/gui/text/qfontengine.cpp | 10 | ||||
-rw-r--r-- | src/gui/text/qfontengine_p.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index b3889a02a4..303c85ce75 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -891,6 +891,16 @@ QByteArray QFontEngine::getSfntTable(uint tag) const return table; } +void QFontEngine::clearGlyphCache(const void *key) +{ + for (QLinkedList<GlyphCacheEntry>::iterator it = m_glyphCaches.begin(), end = m_glyphCaches.end(); it != end; ) { + if (it->context == key) + it = m_glyphCaches.erase(it); + else + ++it; + } +} + void QFontEngine::setGlyphCache(const void *key, QFontEngineGlyphCache *data) { Q_ASSERT(data); diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h index d3faef93bb..c181d61d73 100644 --- a/src/gui/text/qfontengine_p.h +++ b/src/gui/text/qfontengine_p.h @@ -256,6 +256,7 @@ public: virtual int getPointInOutline(glyph_t glyph, int flags, quint32 point, QFixed *xpos, QFixed *ypos, quint32 *nPoints); + void clearGlyphCache(const void *key); void setGlyphCache(const void *key, QFontEngineGlyphCache *data); QFontEngineGlyphCache *glyphCache(const void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const; |