Make OpenGL texture glyph cache use the right freetype glyphs
The freetype font engine would fall back to rasterizing glyphs via QPainterPath in QFontEngine::alphaMapForGlyph() which has a rather unfortunate implementation. Change-Id: Ic0b4095b6f17ab33f0602139f0a8fb441dfba0ee Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
parent
6d45bf683e
commit
f78661b03c
@ -303,7 +303,17 @@ void QOpenGLTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed
|
||||
return;
|
||||
}
|
||||
|
||||
QImage mask = textureMapForGlyph(glyph, subPixelPosition);
|
||||
QImage mask;
|
||||
|
||||
if (m_current_fontengine->hasInternalCaching()) {
|
||||
QImage *alphaMap = m_current_fontengine->lockedAlphaMapForGlyph(glyph, subPixelPosition, QFontEngine::Format_None);
|
||||
if (!alphaMap || alphaMap->isNull())
|
||||
return;
|
||||
mask = alphaMap->copy();
|
||||
m_current_fontengine->unlockAlphaMapForGlyph();
|
||||
} else {
|
||||
mask = textureMapForGlyph(glyph, subPixelPosition);
|
||||
}
|
||||
const int maskWidth = mask.width();
|
||||
const int maskHeight = mask.height();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user