File chromium-skia-system-fontconfig.patch of Package chromium-ffmpeg-extra (Revision 37577a2e6bf6adedd039f499eb0e845c)

Currently displaying revision 37577a2e6bf6adedd039f499eb0e845c , Show latest

78
 
1
--- chromium-69.0.3493.3.old/third_party/skia/src/ports/SkFontHost_FreeType.cpp 2018-07-25 16:42:39.217368047 +0200
2
+++ chromium-69.0.3493.3/third_party/skia/src/ports/SkFontHost_FreeType.cpp 2018-07-25 16:44:03.387793112 +0200
3
@@ -112,8 +112,6 @@
4
         : fGetVarDesignCoordinates(nullptr)
5
         , fGetVarAxisFlags(nullptr)
6
         , fLibrary(nullptr)
7
-        , fIsLCDSupported(false)
8
-        , fLCDExtra(0)
9
     {
10
         if (FT_New_Library(&gFTMemory, &fLibrary)) {
11
             return;
12
@@ -173,12 +171,7 @@
13
         }
14
 #endif
15
 
16
-        // Setup LCD filtering. This reduces color fringes for LCD smoothed glyphs.
17
-        // The default has changed over time, so this doesn't mean the same thing to all users.
18
-        if (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) {
19
-            fIsLCDSupported = true;
20
-            fLCDExtra = 2; //Using a filter adds one full pixel to each side.
21
-        }
22
+        FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT);
23
     }
24
     ~FreeTypeLibrary() {
25
         if (fLibrary) {
26
@@ -187,8 +180,6 @@
27
     }
28
 
29
     FT_Library library() { return fLibrary; }
30
-    bool isLCDSupported() { return fIsLCDSupported; }
31
-    int lcdExtra() { return fLCDExtra; }
32
 
33
     // FT_Get_{MM,Var}_{Blend,Design}_Coordinates were added in FreeType 2.7.1.
34
     // Prior to this there was no way to get the coordinates out of the FT_Face.
35
@@ -205,8 +196,6 @@
36
 
37
 private:
38
     FT_Library fLibrary;
39
-    bool fIsLCDSupported;
40
-    int fLCDExtra;
41
 
42
     // FT_Library_SetLcdFilterWeights was introduced in FreeType 2.4.0.
43
     // The following platforms provide FreeType of at least 2.4.0.
44
@@ -704,17 +693,6 @@
45
         rec->fTextSize = SkIntToScalar(1 << 14);
46
     }
47
 
48
-    if (isLCD(*rec)) {
49
-        // TODO: re-work so that FreeType is set-up and selected by the SkFontMgr.
50
-        SkAutoMutexAcquire ama(gFTMutex);
51
-        ref_ft_library();
52
-        if (!gFTLibrary->isLCDSupported()) {
53
-            // If the runtime Freetype library doesn't support LCD, disable it here.
54
-            rec->fMaskFormat = SkMask::kA8_Format;
55
-        }
56
-        unref_ft_library();
57
-    }
58
-
59
     SkPaint::Hinting h = rec->getHinting();
60
     if (SkPaint::kFull_Hinting == h && !isLCD(*rec)) {
61
         // collapse full->normal hinting if we're not doing LCD
62
@@ -1109,11 +1087,11 @@
63
 void SkScalerContext_FreeType::updateGlyphIfLCD(SkGlyph* glyph) {
64
     if (isLCD(fRec)) {
65
         if (fLCDIsVert) {
66
-            glyph->fHeight += gFTLibrary->lcdExtra();
67
-            glyph->fTop -= gFTLibrary->lcdExtra() >> 1;
68
+            glyph->fHeight += 2;
69
+            glyph->fTop -= 1;
70
         } else {
71
-            glyph->fWidth += gFTLibrary->lcdExtra();
72
-            glyph->fLeft -= gFTLibrary->lcdExtra() >> 1;
73
+            glyph->fWidth += 2;
74
+            glyph->fLeft -= 1;
75
         }
76
     }
77
 }
78