summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontengine.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2013-10-14 15:59:45 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-10-18 23:24:39 +0200
commit22c2d13406394077792c106ce1b60b3203aaf392 (patch)
treedde509b89d3528b6e46b988c40d9b4f7f4c4ed8b /src/gui/text/qfontengine.cpp
parentab17a3c3c40d578397fd9d2d03eda8e13976fcfc (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>
Diffstat (limited to 'src/gui/text/qfontengine.cpp')
-rw-r--r--src/gui/text/qfontengine.cpp10
1 files changed, 10 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);