Remove use of QImage::alphaChannel()

A direct logical replacement. Not sure what is going on though or why
an inversion is necessary, but logic is unchanged.

Change-Id: Id9b5531895371f6467018fa82336aff6238ae126
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2020-01-07 11:29:04 +01:00
parent 97645478de
commit f1e5c5575c

View File

@ -341,9 +341,10 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP
} else if (m_format == QFontEngine::Format_Mono) {
if (mask.depth() > 1) {
// TODO optimize this
mask = mask.alphaChannel();
mask.convertTo(QImage::Format_Alpha8);
mask.reinterpretAsFormat(QImage::Format_Grayscale8);
mask.invertPixels();
mask = mask.convertToFormat(QImage::Format_Mono, Qt::ThresholdDither);
mask.convertTo(QImage::Format_Mono, Qt::ThresholdDither);
}
int mw = qMin(mask.width(), c.w);