Fix gamma-correction in QCoreTextFontEngine with Mojave

The code was previously assuming font-smoothing was only used with
A32 font antialiasing, so the corresponding gamma-correction was not
performed.

Task-number: QTBUG-71075
Task-number: QTBUG-71946
Change-Id: I68d8304cf18638239d8bfac32c67333f16ccc7bd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2018-11-16 16:01:30 +01:00 committed by Tor Arne Vestbø
parent 247baedb25
commit 1f1dc3fc4c

View File

@ -736,8 +736,7 @@ bool QCoreTextFontEngine::shouldSmoothFont() const
bool QCoreTextFontEngine::expectsGammaCorrectedBlending() const bool QCoreTextFontEngine::expectsGammaCorrectedBlending() const
{ {
// Only works well when font-smoothing is enabled return shouldSmoothFont();
return (glyphFormat == Format_A32) && !(fontDef.styleStrategy & (QFont::NoAntialias | QFont::NoSubpixelAntialias));
} }
QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &matrix) QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &matrix)