summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-11-28 12:12:07 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-11-29 18:03:18 +0000
commit0cf5648ce6df8b60090a14f738dd5d66643a0532 (patch)
tree039436aae30c4c30493a4c96705a6e7a809477cf
parentec254d2555083ff258db9675fa43ad23888f0685 (diff)
CoreText: Store glyphs in linear RGB when needed by blending algorithm
Instead of tying the linear-conversion to a specific function, we move it to imageForGlyph and base it on the premise for needing it. Change-Id: Ib8fc79ad419ef703abcb82785ac15d4c75fb98e6 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 6c2ffba92e..271f07e0c1 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -824,6 +824,9 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
CTFontDrawGlyphs(ctfont, &cgGlyph, &CGPointZero, 1, ctx);
}
+ if (expectsGammaCorrectedBlending())
+ qGamma_correct_back_to_linear_cs(&im);
+
#if defined(Q_OS_MACOS)
if (blackOnWhiteGlyphs)
im.invertPixels();
@@ -864,9 +867,7 @@ QImage QCoreTextFontEngine::alphaRGBMapForGlyph(glyph_t glyph, QFixed subPixelPo
if (x.type() > QTransform::TxScale)
return QFontEngine::alphaRGBMapForGlyph(glyph, subPixelPosition, x);
- QImage im = imageForGlyph(glyph, subPixelPosition, x);
- qGamma_correct_back_to_linear_cs(&im);
- return im;
+ return imageForGlyph(glyph, subPixelPosition, x);
}
QImage QCoreTextFontEngine::bitmapForGlyph(glyph_t glyph, QFixed subPixelPosition, const QTransform &t)