harmony-fix.diff 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. 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
  2. --- 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
  3. +++ 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
  4. @@ -80,7 +80,7 @@
  5. class FreeTypeLibrary : SkNoncopyable {
  6. public:
  7. - FreeTypeLibrary() : fLibrary(nullptr), fIsLCDSupported(false), fLCDExtra(0) {
  8. + FreeTypeLibrary() : fLibrary(nullptr) {
  9. if (FT_New_Library(&gFTMemory, &fLibrary)) {
  10. return;
  11. }
  12. @@ -90,8 +90,6 @@
  13. // Default { 0x10, 0x40, 0x70, 0x40, 0x10 } adds up to 0x110, simulating ink spread.
  14. // SetLcdFilter must be called before SetLcdFilterWeights.
  15. if (FT_Library_SetLcdFilter(fLibrary, FT_LCD_FILTER_DEFAULT) == 0) {
  16. - fIsLCDSupported = true;
  17. - fLCDExtra = 2; //Using a filter adds one full pixel to each side.
  18. #ifdef SK_FONTHOST_FREETYPE_USE_NORMAL_LCD_FILTER
  19. // Adds to 0x110 simulating ink spread, but provides better results than default.
  20. @@ -124,13 +122,9 @@
  21. }
  22. FT_Library library() { return fLibrary; }
  23. - bool isLCDSupported() { return fIsLCDSupported; }
  24. - int lcdExtra() { return fLCDExtra; }
  25. private:
  26. FT_Library fLibrary;
  27. - bool fIsLCDSupported;
  28. - int fLCDExtra;
  29. // FT_Library_SetLcdFilterWeights was introduced in FreeType 2.4.0.
  30. // The following platforms provide FreeType of at least 2.4.0.
  31. @@ -633,17 +627,6 @@
  32. rec->fTextSize = SkIntToScalar(1 << 14);
  33. }
  34. - if (isLCD(*rec)) {
  35. - // TODO: re-work so that FreeType is set-up and selected by the SkFontMgr.
  36. - SkAutoMutexAcquire ama(gFTMutex);
  37. - ref_ft_library();
  38. - if (!gFTLibrary->isLCDSupported()) {
  39. - // If the runtime Freetype library doesn't support LCD, disable it here.
  40. - rec->fMaskFormat = SkMask::kA8_Format;
  41. - }
  42. - unref_ft_library();
  43. - }
  44. -
  45. SkPaint::Hinting h = rec->getHinting();
  46. if (SkPaint::kFull_Hinting == h && !isLCD(*rec)) {
  47. // collapse full->normal hinting if we're not doing LCD
  48. @@ -1046,11 +1029,11 @@
  49. void SkScalerContext_FreeType::updateGlyphIfLCD(SkGlyph* glyph) {
  50. if (isLCD(fRec)) {
  51. if (fLCDIsVert) {
  52. - glyph->fHeight += gFTLibrary->lcdExtra();
  53. - glyph->fTop -= gFTLibrary->lcdExtra() >> 1;
  54. + glyph->fHeight += 2;
  55. + glyph->fTop -= 1;
  56. } else {
  57. - glyph->fWidth += gFTLibrary->lcdExtra();
  58. - glyph->fLeft -= gFTLibrary->lcdExtra() >> 1;
  59. + glyph->fWidth += 2;
  60. + glyph->fLeft -= 1;
  61. }
  62. }
  63. }