Remove undesired pixel padding of glyphs on windows.

The excessive padding has serious performance implications throughout
Qt and need to go. The original reason for having them was to fix
issues with GL text rendering and issues with unspecified OpenType
fonts. There have been several other changes to the glyph cache
since then and neither of the issues can be reproduced today.

Change-Id: I6de67598a079c296daf48be07cc5c2d67768c384
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
This commit is contained in:
Gunnar Sletta 2013-09-04 15:30:41 +02:00 committed by The Qt Project
parent 35bc3dc45a
commit 0cf79e47da

View File

@ -1135,8 +1135,8 @@ QWindowsNativeImage *QWindowsFontEngine::drawGDIGlyph(HFONT font, glyph_t glyph,
#endif // wince
// The padding here needs to be kept in sync with the values in alphaMapBoundingBox.
QWindowsNativeImage *ni = new QWindowsNativeImage(iw + 2 * margin + 4,
ih + 2 * margin + 4,
QWindowsNativeImage *ni = new QWindowsNativeImage(iw + 2 * margin,
ih + 2 * margin,
QWindowsNativeImage::systemFormat());
/*If cleartype is enabled we use the standard system format even on Windows CE
@ -1175,8 +1175,8 @@ glyph_metrics_t QWindowsFontEngine::alphaMapBoundingBox(glyph_t glyph, QFixed po
if (format == QFontEngine::Format_A32 || format == QFontEngine::Format_ARGB)
margin = glyphMargin(QFontEngineGlyphCache::Raster_RGBMask);
glyph_metrics_t gm = boundingBox(glyph, matrix);
gm.width += margin * 2 + 4;
gm.height += margin * 2 + 4;
gm.width += margin * 2;
gm.height += margin * 2;
return gm;
}