REG: Fix crash when mixing projected/unprojected text painting

Due to a refactoring done in Qt 5.1, we would try to do projected
text painting using the glyph cache in the raster engine (the logic
to avoid this was removed when refactoring). If you only did the
projected text drawing, then you would get unprojected text with
projected glyph positions and it would look wrong.

What's worse: If you first drew unprojected text with the same
font engine, so that the font engine already had a glyph cache
stored, we would hit an assert in qtransform_equals_no_translate
which assumes cached drawing is never used for projected painters.

This puts back the logic that we never cache projected text in
the glyph cache.

Task-number: QTBUG-32193
Change-Id: I1f919961c4cf498a9c4a0b1ceb0df1937ed0d067
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2013-07-04 13:57:04 +02:00 committed by The Qt Project
parent 568f82fba3
commit b5520af6a9

View File

@ -3327,6 +3327,10 @@ bool QRasterPaintEngine::requiresPretransformedGlyphPositions(QFontEngine *fontE
bool QRasterPaintEngine::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const
{
// The raster engine does not support projected cached glyph drawing
if (m.type() >= QTransform::TxProject)
return false;
// The font engine might not support filling the glyph cache
// with the given transform applied, in which case we need to
// fall back to the QPainterPath code-path.