From 86d096eeef9968e38d8fa7068a9b55fba202c3dc Mon Sep 17 00:00:00 2001 From: Ciure Andrei Date: Sat, 15 Jun 2019 13:42:53 +0300 Subject: [PATCH] Backed out changeset 6153e6bb58e1 (bug 1558375) for causing 1229972.html to perma crash CLOSED TREE --- gfx/2d/ScaledFontFreeType.cpp | 3 --- gfx/skia/skia/src/ports/SkFontHost_cairo.cpp | 8 ++------ gfx/thebes/gfxFT2FontBase.cpp | 3 --- gfx/thebes/gfxFT2FontList.cpp | 9 --------- gfx/thebes/gfxFT2Fonts.cpp | 3 --- 5 files changed, 2 insertions(+), 24 deletions(-) diff --git a/gfx/2d/ScaledFontFreeType.cpp b/gfx/2d/ScaledFontFreeType.cpp index 36ddcde2fb72..847fd2c2f8ac 100644 --- a/gfx/2d/ScaledFontFreeType.cpp +++ b/gfx/2d/ScaledFontFreeType.cpp @@ -133,9 +133,6 @@ already_AddRefed UnscaledFontFreeType::CreateScaledFont( } int flags = FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_HINTING; - if (face->face_flags & FT_FACE_FLAG_TRICKY) { - flags &= ~FT_LOAD_NO_AUTOHINT; - } cairo_font_face_t* font = cairo_ft_font_face_create_for_ft_face( face, flags, coords.data(), aNumVariations); if (cairo_font_face_status(font) != CAIRO_STATUS_SUCCESS) { diff --git a/gfx/skia/skia/src/ports/SkFontHost_cairo.cpp b/gfx/skia/skia/src/ports/SkFontHost_cairo.cpp index 435accc91633..b26aec3a803c 100644 --- a/gfx/skia/skia/src/ports/SkFontHost_cairo.cpp +++ b/gfx/skia/skia/src/ports/SkFontHost_cairo.cpp @@ -393,13 +393,9 @@ SkScalerContext_CairoFT::SkScalerContext_CairoFT(sk_sp typeface, con } } - // Disable autohinting when asked to disable hinting, except for "tricky" fonts. + // Disable autohinting to disable hinting even for "tricky" fonts. if (!gFontHintingEnabled) { - CairoLockedFTFace faceLock(fScaledFont); - FT_Face face = faceLock.getFace(); - if (!(face->face_flags & FT_FACE_FLAG_TRICKY)) { - loadFlags |= FT_LOAD_NO_AUTOHINT; - } + loadFlags |= FT_LOAD_NO_AUTOHINT; } if ((fRec.fFlags & SkScalerContext::kEmbeddedBitmapText_Flag) == 0) { diff --git a/gfx/thebes/gfxFT2FontBase.cpp b/gfx/thebes/gfxFT2FontBase.cpp index 5c2de4d335fb..f61ed83e5c8c 100644 --- a/gfx/thebes/gfxFT2FontBase.cpp +++ b/gfx/thebes/gfxFT2FontBase.cpp @@ -508,9 +508,6 @@ bool gfxFT2FontBase::GetFTGlyphAdvance(uint16_t aGID, int32_t* aAdvance) { int32_t flags = hinting ? FT_LOAD_ADVANCE_ONLY : FT_LOAD_ADVANCE_ONLY | FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_HINTING; - if (face.get()->face_flags & FT_FACE_FLAG_TRICKY) { - flags &= ~FT_LOAD_NO_AUTOHINT; - } FT_Error ftError = Factory::LoadFTGlyph(face.get(), aGID, flags); if (ftError != FT_Err_Ok) { // FT_Face was somehow broken/invalid? Don't try to access glyph slot. diff --git a/gfx/thebes/gfxFT2FontList.cpp b/gfx/thebes/gfxFT2FontList.cpp index 324e910c95d9..a92500327709 100644 --- a/gfx/thebes/gfxFT2FontList.cpp +++ b/gfx/thebes/gfxFT2FontList.cpp @@ -383,9 +383,6 @@ FT2FontEntry* FT2FontEntry::CreateFontEntry( int flags = gfxPlatform::GetPlatform()->FontHintingEnabled() ? FT_LOAD_DEFAULT : (FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_HINTING); - if (aFace->face_flags & FT_FACE_FLAG_TRICKY) { - flags &= ~FT_LOAD_NO_AUTOHINT; - } fe->mFontFace = cairo_ft_font_face_create_for_ft_face(aFace, flags, nullptr, 0); FTUserFontData* userFontData = @@ -427,9 +424,6 @@ cairo_font_face_t* FT2FontEntry::CairoFontFace(const gfxFontStyle* aStyle) { int flags = gfxPlatform::GetPlatform()->FontHintingEnabled() ? FT_LOAD_DEFAULT : (FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_HINTING); - if (FT_Face(face)->face_flags & FT_FACE_FLAG_TRICKY) { - flags &= ~FT_LOAD_NO_AUTOHINT; - } mFontFace = cairo_ft_font_face_create_for_ft_face(face, flags, nullptr, 0); auto userFontData = new FTUserFontData(face, face.FontData(), face.DataLength()); @@ -447,9 +441,6 @@ cairo_font_face_t* FT2FontEntry::CairoFontFace(const gfxFontStyle* aStyle) { int flags = gfxPlatform::GetPlatform()->FontHintingEnabled() ? FT_LOAD_DEFAULT : (FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_HINTING); - if (mFTFace->face_flags & FT_FACE_FLAG_TRICKY) { - flags &= ~FT_LOAD_NO_AUTOHINT; - } // Resolve variations from entry (descriptor) and style (property) AutoTArray settings; GetVariationsForStyle(settings, aStyle ? *aStyle : gfxFontStyle()); diff --git a/gfx/thebes/gfxFT2Fonts.cpp b/gfx/thebes/gfxFT2Fonts.cpp index 405a0c43c3a1..576e5c8edb83 100644 --- a/gfx/thebes/gfxFT2Fonts.cpp +++ b/gfx/thebes/gfxFT2Fonts.cpp @@ -204,9 +204,6 @@ void gfxFT2Font::FillGlyphDataForChar(FT_Face face, uint32_t ch, FT_Int32 flags = gfxPlatform::GetPlatform()->FontHintingEnabled() ? FT_LOAD_DEFAULT : (FT_LOAD_NO_AUTOHINT | FT_LOAD_NO_HINTING); - if (face->face_flags & FT_FACE_FLAG_TRICKY) { - flags &= ~FT_LOAD_NO_AUTOHINT; - } FT_Error err = Factory::LoadFTGlyph(face, gid, flags); if (err) {