Make texture glyph cache more robust against missing glyphs

This fixes failing assertions in the CI system. All the callers of
lockedAlphaMapForGlyph always check the return value for being null as well as
the image itself, so we need to do the same here as well before calling
unlockAlphaMapForGlyph.

This is proposed to stable because commit
f9399d69ad also landed in stable.

Change-Id: I0a4f4fbb1727e5b4ad497b08177d14c81abd2dd0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
bb10
Simon Hausmann 2014-01-03 12:18:19 +01:00 committed by The Qt Project
parent 753b472cb8
commit aff3e3c4a2
1 changed files with 1 additions and 1 deletions

View File

@ -160,7 +160,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
// proper metrics will be cached and used later.
if (fontEngine->hasInternalCaching()) {
QImage *locked = fontEngine->lockedAlphaMapForGlyph(glyph, subPixelPosition, format);
if (locked)
if (locked && !locked->isNull())
fontEngine->unlockAlphaMapForGlyph();
}