DirectWrite: Fix clipping bug with grayscale AA rendering
The code is using the same rasterizer for A8 and A32 glyphs, in the former case it's just converting to grayscale afterwards. Therefore, we need to pad the glyph cache with the same number of pixels for both cases. [ChangeLog][Windows][DirectWrite] Fixed clipping bug when rendering unhinted text with grayscale antialiasing. Task-number: QTBUG-49562 Change-Id: If85ff768451116278f6d2ccd1e77b5ce0664087d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>bb10
parent
44c6c3ae27
commit
a6ef446d4c
|
|
@ -487,7 +487,7 @@ qreal QWindowsFontEngineDirectWrite::maxCharWidth() const
|
|||
|
||||
QImage QWindowsFontEngineDirectWrite::alphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition)
|
||||
{
|
||||
QImage im = imageForGlyph(glyph, subPixelPosition, 0, QTransform());
|
||||
QImage im = alphaRGBMapForGlyph(glyph, subPixelPosition, QTransform());
|
||||
|
||||
QImage alphaMap(im.width(), im.height(), QImage::Format_Alpha8);
|
||||
|
||||
|
|
@ -709,9 +709,9 @@ QString QWindowsFontEngineDirectWrite::fontNameSubstitute(const QString &familyN
|
|||
glyph_metrics_t QWindowsFontEngineDirectWrite::alphaMapBoundingBox(glyph_t glyph, QFixed pos, const QTransform &matrix, GlyphFormat format)
|
||||
{
|
||||
Q_UNUSED(pos);
|
||||
int margin = 0;
|
||||
if (format == QFontEngine::Format_A32 || format == QFontEngine::Format_ARGB)
|
||||
margin = glyphMargin(QFontEngine::Format_A32);
|
||||
Q_UNUSED(format);
|
||||
|
||||
int margin = glyphMargin(QFontEngine::Format_A32);
|
||||
glyph_metrics_t gm = QFontEngine::boundingBox(glyph, matrix);
|
||||
gm.width += margin * 2;
|
||||
gm.height += margin * 2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue