[arch-commits] Commit in qt5-webengine/kde-unstable (3 files)

Antonio Rojas arojas at archlinux.org
Tue Oct 10 15:51:51 UTC 2017


    Date: Tuesday, October 10, 2017 @ 15:51:50
  Author: arojas
Revision: 307391

Update freetype patch

Added:
  qt5-webengine/kde-unstable/qtwebengine-harmony.patch
Modified:
  qt5-webengine/kde-unstable/PKGBUILD
Deleted:
  qt5-webengine/kde-unstable/harmony-fix.diff

---------------------------+
 PKGBUILD                  |    6 +--
 harmony-fix.diff          |   69 ---------------------------------------
 qtwebengine-harmony.patch |   76 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 79 insertions(+), 72 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-10-10 15:03:01 UTC (rev 307390)
+++ PKGBUILD	2017-10-10 15:51:50 UTC (rev 307391)
@@ -16,9 +16,9 @@
 groups=('qt' 'qt5')
 _pkgfqn="${pkgname/5-/}-everywhere-src-${_qtver}"
 source=("http://download.qt.io/development_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz"
-         harmony-fix.diff)
+         qtwebengine-harmony.patch)
 sha256sums=('df7547b87ef6d150c5ed4dc9a03b24299caf9ceb15a3515d995733f901ec3549'
-            '2c309c0f6978e6a399422319b5034b01881d5526cf48b2ee5fcc7f418029a344')
+            'c183e3a7c135b1942bbb977f74c7f4eff79cd9504c7a17ad29b99ce5776cdece')
 
 prepare() {
   mkdir -p build
@@ -30,7 +30,7 @@
   cd ${_pkgfqn}
 
   # FreeType 2.8.1
-  # patch -Np1 -i ../harmony-fix.diff
+  patch -Np1 -i ../qtwebengine-harmony.patch
 }
 
 build() {

Deleted: harmony-fix.diff
===================================================================
--- harmony-fix.diff	2017-10-10 15:03:01 UTC (rev 307390)
+++ harmony-fix.diff	2017-10-10 15:51:50 UTC (rev 307391)
@@ -1,69 +0,0 @@
-diff -u -r qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp qtwebengine-opensource-src-5.9.1-ftfixes/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp
---- qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp	2017-09-19 17:38:43.659642835 +0200
-+++ qtwebengine-opensource-src-5.9.1-ftfixes/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp	2017-09-19 17:38:50.492991631 +0200
-@@ -80,7 +80,7 @@
- 
- class FreeTypeLibrary : SkNoncopyable {
- public:
--    FreeTypeLibrary() : fLibrary(nullptr), fIsLCDSupported(false), fLCDExtra(0) {
-+    FreeTypeLibrary() : fLibrary(nullptr) {
-         if (FT_New_Library(&gFTMemory, &fLibrary)) {
-             return;
-         }
-@@ -90,8 +90,6 @@
-         // Default { 0x10, 0x40, 0x70, 0x40, 0x10 } adds up to 0x110, simulating ink spread.
-         // SetLcdFilter must be called before SetLcdFilterWeights.
-         if (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) {
--            fIsLCDSupported = true;
--            fLCDExtra = 2; //Using a filter adds one full pixel to each side.
- 
- #ifdef SK_FONTHOST_FREETYPE_USE_NORMAL_LCD_FILTER
-             // Adds to 0x110 simulating ink spread, but provides better results than default.
-@@ -124,13 +122,9 @@
-     }
- 
-     FT_Library library() { return fLibrary; }
--    bool isLCDSupported() { return fIsLCDSupported; }
--    int lcdExtra() { return fLCDExtra; }
- 
- private:
-     FT_Library fLibrary;
--    bool fIsLCDSupported;
--    int fLCDExtra;
- 
-     // FT_Library_SetLcdFilterWeights was introduced in FreeType 2.4.0.
-     // The following platforms provide FreeType of at least 2.4.0.
-@@ -633,17 +627,6 @@
-         rec->fTextSize = SkIntToScalar(1 << 14);
-     }
- 
--    if (isLCD(*rec)) {
--        // TODO: re-work so that FreeType is set-up and selected by the SkFontMgr.
--        SkAutoMutexAcquire ama(gFTMutex);
--        ref_ft_library();
--        if (!gFTLibrary->isLCDSupported()) {
--            // If the runtime Freetype library doesn't support LCD, disable it here.
--            rec->fMaskFormat = SkMask::kA8_Format;
--        }
--        unref_ft_library();
--    }
--
-     SkPaint::Hinting h = rec->getHinting();
-     if (SkPaint::kFull_Hinting == h && !isLCD(*rec)) {
-         // collapse full->normal hinting if we're not doing LCD
-@@ -1046,11 +1029,11 @@
- void SkScalerContext_FreeType::updateGlyphIfLCD(SkGlyph* glyph) {
-     if (isLCD(fRec)) {
-         if (fLCDIsVert) {
--            glyph->fHeight += gFTLibrary->lcdExtra();
--            glyph->fTop -= gFTLibrary->lcdExtra() >> 1;
-+            glyph->fHeight += 2;
-+            glyph->fTop -= 1;
-         } else {
--            glyph->fWidth += gFTLibrary->lcdExtra();
--            glyph->fLeft -= gFTLibrary->lcdExtra() >> 1;
-+            glyph->fWidth += 2;
-+            glyph->fLeft -= 1;
-         }
-     }
- }

Added: qtwebengine-harmony.patch
===================================================================
--- qtwebengine-harmony.patch	                        (rev 0)
+++ qtwebengine-harmony.patch	2017-10-10 15:51:50 UTC (rev 307391)
@@ -0,0 +1,76 @@
+--- qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp.orig	2017-10-10 17:42:06.956950985 +0200
++++ qtwebengine-opensource-src-5.9.1/src/3rdparty/chromium/third_party/skia/src/ports/SkFontHost_FreeType.cpp	2017-10-10 17:46:05.824187787 +0200
+@@ -99,8 +99,6 @@
+     FreeTypeLibrary()
+         : fGetVarDesignCoordinates(nullptr)
+         , fLibrary(nullptr)
+-        , fIsLCDSupported(false)
+-        , fLCDExtra(0)
+     {
+         if (FT_New_Library(&gFTMemory, &fLibrary)) {
+             return;
+@@ -147,12 +145,6 @@
+         }
+ #endif
+ 
+-        // Setup LCD filtering. This reduces color fringes for LCD smoothed glyphs.
+-        // The default has changed over time, so this doesn't mean the same thing to all users.
+-        if (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) {
+-            fIsLCDSupported = true;
+-            fLCDExtra = 2; //Using a filter adds one full pixel to each side.
+-        }
+     }
+     ~FreeTypeLibrary() {
+         if (fLibrary) {
+@@ -161,8 +153,6 @@
+     }
+ 
+     FT_Library library() { return fLibrary; }
+-    bool isLCDSupported() { return fIsLCDSupported; }
+-    int lcdExtra() { return fLCDExtra; }
+ 
+     // FT_Get_{MM,Var}_{Blend,Design}_Coordinates were added in FreeType 2.7.1.
+     // Prior to this there was no way to get the coordinates out of the FT_Face.
+@@ -173,8 +163,6 @@
+ 
+ private:
+     FT_Library fLibrary;
+-    bool fIsLCDSupported;
+-    int fLCDExtra;
+ 
+     // FT_Library_SetLcdFilterWeights was introduced in FreeType 2.4.0.
+     // The following platforms provide FreeType of at least 2.4.0.
+@@ -704,17 +692,6 @@
+         rec->fTextSize = SkIntToScalar(1 << 14);
+     }
+ 
+-    if (isLCD(*rec)) {
+-        // TODO: re-work so that FreeType is set-up and selected by the SkFontMgr.
+-        SkAutoMutexAcquire ama(gFTMutex);
+-        ref_ft_library();
+-        if (!gFTLibrary->isLCDSupported()) {
+-            // If the runtime Freetype library doesn't support LCD, disable it here.
+-            rec->fMaskFormat = SkMask::kA8_Format;
+-        }
+-        unref_ft_library();
+-    }
+-
+     SkPaint::Hinting h = rec->getHinting();
+     if (SkPaint::kFull_Hinting == h && !isLCD(*rec)) {
+         // collapse full->normal hinting if we're not doing LCD
+@@ -1115,11 +1092,11 @@
+ void SkScalerContext_FreeType::updateGlyphIfLCD(SkGlyph* glyph) {
+     if (isLCD(fRec)) {
+         if (fLCDIsVert) {
+-            glyph->fHeight += gFTLibrary->lcdExtra();
+-            glyph->fTop -= gFTLibrary->lcdExtra() >> 1;
++            glyph->fHeight += 2;
++            glyph->fTop -= 1;
+         } else {
+-            glyph->fWidth += gFTLibrary->lcdExtra();
+-            glyph->fLeft -= gFTLibrary->lcdExtra() >> 1;
++            glyph->fWidth += 2;
++            glyph->fLeft -= 1;
+         }
+     }
+ }



More information about the arch-commits mailing list