Make it possible to clear glyph caches from the font engine.

Change-Id: Iea62bc1727269ed3893d8b4dbcefa583f1b85d7f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
Gunnar Sletta 2013-10-14 15:59:45 +02:00 committed by The Qt Project
parent ab17a3c3c4
commit 22c2d13406
2 changed files with 11 additions and 0 deletions

View File

@ -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);

View File

@ -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;