Commit | Line | Data |
---|---|---|
bd70e9dd VM |
1 | --- 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 |
2 | +++ 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 | |
3 | @@ -99,8 +99,6 @@ | |
4 | FreeTypeLibrary() | |
5 | : fGetVarDesignCoordinates(nullptr) | |
6 | , fLibrary(nullptr) | |
7 | - , fIsLCDSupported(false) | |
8 | - , fLCDExtra(0) | |
9 | { | |
10 | if (FT_New_Library(&gFTMemory, &fLibrary)) { | |
11 | return; | |
12 | @@ -147,12 +145,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 | @@ -161,8 +153,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 | @@ -173,8 +163,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 +692,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 | @@ -1115,11 +1092,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 | } |