From 0f21c7828b1b4fa45e8aaf9aafd8067a0d27dacc Mon Sep 17 00:00:00 2001 From: Fathi Boudra Date: Mon, 16 Mar 2009 16:34:22 +0000 Subject: Add new patch to fix #448555 sent by Samuel Rodal. --- debian/changelog | 9 +-- debian/patches/0277-remove-blurrying-glyph.diff | 23 ------- ...egacy-LCD-filtering-if-specified-in-font-c.diff | 70 ++++++++++++++++++++++ debian/patches/10_config_tests_fixes.diff | 7 +++ debian/patches/series | 2 +- 5 files changed, 83 insertions(+), 28 deletions(-) delete mode 100644 debian/patches/0277-remove-blurrying-glyph.diff create mode 100644 debian/patches/0278-X11-Use-legacy-LCD-filtering-if-specified-in-font-c.diff diff --git a/debian/changelog b/debian/changelog index 95b311f..a8a7b31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -qt4-x11 (4.5.0-2) UNRELEASED; urgency=low +qt4-x11 (4.5.0-2) experimental; urgency=low * Add qt-copy patches: - 0275-qtconcurrent-threadcount.diff @@ -6,9 +6,10 @@ qt4-x11 (4.5.0-2) UNRELEASED; urgency=low ignoring the configured number of threads for the main thread pool. - 0276-webkit-pedantic.diff Fix playground/base/plasma/applet/welcome compile with -pedantic. - - 0277-remove-blurrying-glyph.diff (Closes: #448555) - This patch removes blurrying glyph. - Thanks to M G Berberich. + - 0278-X11-Use-legacy-LCD-filtering-if-specified-in-font-c.diff + If Freetype is built without subpixel rendering, we should use + the Qt 3 intrapixel filter instead of the bitmap convolution + when the Legacy LCD filter is chosen. (Closes: #448555) -- Fathi Boudra Mon, 16 Mar 2009 11:59:24 +0100 diff --git a/debian/patches/0277-remove-blurrying-glyph.diff b/debian/patches/0277-remove-blurrying-glyph.diff deleted file mode 100644 index 4f0e403..0000000 --- a/debian/patches/0277-remove-blurrying-glyph.diff +++ /dev/null @@ -1,23 +0,0 @@ -qt-bugs@ issue : none -Qt Software task ID : 195256 -bugs.kde.org number : none -applied: no -author: M G Berberich - -This patch removes blurrying glyph. -See http://bugs.debian.org/448555 for more informations. - ---- a/src/gui/text/qfontengine_ft.cpp -+++ b/src/gui/text/qfontengine_ft.cpp -@@ -1041,10 +1041,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loa - if (hsubpixel) { - Q_ASSERT (bitmap.pixel_mode == FT_PIXEL_MODE_GRAY); - Q_ASSERT(antialias); -- uchar *convoluted = new uchar[bitmap.rows*bitmap.pitch]; -- convoluteBitmap(bitmap.buffer, convoluted, bitmap.width, info.height, bitmap.pitch); -- convertRGBToARGB(convoluted + 1, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_RGB); -- delete [] convoluted; -+ convertRGBToARGB(bitmap.buffer + 1, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_RGB); - } else if (vfactor != 1) { - convertRGBToARGB_V(bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_VRGB); - } diff --git a/debian/patches/0278-X11-Use-legacy-LCD-filtering-if-specified-in-font-c.diff b/debian/patches/0278-X11-Use-legacy-LCD-filtering-if-specified-in-font-c.diff new file mode 100644 index 0000000..d79a8e8 --- /dev/null +++ b/debian/patches/0278-X11-Use-legacy-LCD-filtering-if-specified-in-font-c.diff @@ -0,0 +1,70 @@ +qt-bugs@ issue : none +Qt Software task ID : 248387 +bugs.kde.org number : none +applied: no +author: Samuel Rodal + +[PATCH] X11: Use legacy LCD filtering if specified in font config. + +If Freetype is built without subpixel rendering, we should use +the Qt 3 intrapixel filter instead of the bitmap convolution +when the Legacy LCD filter is chosen. + +--- a/src/gui/text/qfontengine_ft.cpp ++++ b/src/gui/text/qfontengine_ft.cpp +@@ -529,7 +529,7 @@ static const uint subpixel_filter[3][3] + }; + #endif + +-static void convertRGBToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr) ++static void convertRGBToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr, bool legacyFilter) + { + int h = height; + const int offs = bgr ? -1 : 1; +@@ -540,8 +540,16 @@ static void convertRGBToARGB(const uchar + uint red = src[x+1-offs]; + uint green = src[x+1]; + uint blue = src[x+1+offs]; +- uint alpha = green; +- uint res = (alpha << 24) + (red << 16) + (green << 8) + blue; ++ uint res; ++#if !defined(QT_USE_FREETYPE_LCDFILTER) ++ if (legacyFilter) { ++ uint high = (red*subpixel_filter[0][0] + green*subpixel_filter[0][1] + blue*subpixel_filter[0][2]) >> 8; ++ uint mid = (red*subpixel_filter[1][0] + green*subpixel_filter[1][1] + blue*subpixel_filter[1][2]) >> 8; ++ uint low = (red*subpixel_filter[2][0] + green*subpixel_filter[2][1] + blue*subpixel_filter[2][2]) >> 8; ++ res = (mid << 24) + (high << 16) + (mid << 8) + low; ++ } else ++#endif ++ res = (green << 24) + (red << 16) + (green << 8) + blue; + *dd = res; + ++dd; + } +@@ -941,7 +949,7 @@ QFontEngineFT::Glyph *QFontEngineFT::loa + glyph_buffer = new uchar[glyph_buffer_size]; + + if (hsubpixel) +- convertRGBToARGB(slot->bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, slot->bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_RGB); ++ convertRGBToARGB(slot->bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, slot->bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_RGB, false); + else if (vfactor != 1) + convertRGBToARGB_V(slot->bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, slot->bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_VRGB); + } else +@@ -1042,8 +1050,16 @@ QFontEngineFT::Glyph *QFontEngineFT::loa + Q_ASSERT (bitmap.pixel_mode == FT_PIXEL_MODE_GRAY); + Q_ASSERT(antialias); + uchar *convoluted = new uchar[bitmap.rows*bitmap.pitch]; +- convoluteBitmap(bitmap.buffer, convoluted, bitmap.width, info.height, bitmap.pitch); +- convertRGBToARGB(convoluted + 1, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_RGB); ++ bool useLegacyLcdFilter = false; ++#if defined(FT_LCD_FILTER_H) ++ useLegacyLcdFilter = (lcdFilterType == FT_LCD_FILTER_LEGACY); ++#endif ++ uchar *buffer = bitmap.buffer; ++ if (!useLegacyLcdFilter) { ++ convoluteBitmap(bitmap.buffer, convoluted, bitmap.width, info.height, bitmap.pitch); ++ buffer = convoluted; ++ } ++ convertRGBToARGB(buffer + 1, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_RGB, useLegacyLcdFilter); + delete [] convoluted; + } else if (vfactor != 1) { + convertRGBToARGB_V(bitmap.buffer, (uint *)glyph_buffer, info.width, info.height, bitmap.pitch, subpixelType != QFontEngineFT::Subpixel_VRGB); diff --git a/debian/patches/10_config_tests_fixes.diff b/debian/patches/10_config_tests_fixes.diff index acb0670..bbfa574 100644 --- a/debian/patches/10_config_tests_fixes.diff +++ b/debian/patches/10_config_tests_fixes.diff @@ -56,3 +56,10 @@ win32:!contains( LIBS, .*gds.* ):!contains( LIBS, .*fbclient.* ) { !win32-borland:LIBS *= -lgds32_ms +--- a/config.tests/unix/sqlite/sqlite.pro ++++ b/config.tests/unix/sqlite/sqlite.pro +@@ -1,3 +1,4 @@ + SOURCES = sqlite.cpp + CONFIG -= qt dylib + mac:CONFIG -= app_bundle ++LIBS += -ldl diff --git a/debian/patches/series b/debian/patches/series index 2417916..b914a4b 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -11,7 +11,7 @@ 0274-shm-native-image-fix.diff 0275-qtconcurrent-threadcount.diff 0276-webkit-pedantic.diff -0277-remove-blurrying-glyph.diff +0278-X11-Use-legacy-LCD-filtering-if-specified-in-font-c.diff # debian patches 01_qmake_for_debian.diff -- cgit v1.2.3