From 0cf79e47dacb6439b378aca71d90ce4bbb45795b Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 4 Sep 2013 15:30:41 +0200 Subject: [PATCH] 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 --- src/plugins/platforms/windows/qwindowsfontengine.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index 6b5304120b..3df199bf13 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -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; }