⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 254567 in webkit


Ignore:
Timestamp:
Jan 15, 2020, 6:44:06 AM (7 years ago)
Author:
clopez@igalia.com
Message:

[GTK] Turn off antialiasing when rendering with Ahem
https://bugs.webkit.org/show_bug.cgi?id=204671

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Many CSS related tests use the "Ahem" font to compare its special
squared glyphs with the positioned elements of the test. But if
we enable antialiasing for this font, then the antialiasing of
the glyphs causes small pixel differences with the reference test.

So, this patch disables antialiasing for the Ahem font in GTK and WPE
ports. This commit its pretty much like r252701 for the Mac/iOS ports.

Covered by existing tests.

  • platform/graphics/cairo/GraphicsContextImplCairo.cpp:

(WebCore::GraphicsContextImplCairo::drawGlyphs):

  • platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:

(WebCore::FontCustomPlatformData::fontPlatformData):

  • platform/graphics/freetype/SimpleFontDataFreeType.cpp:

(WebCore::Font::platformInit):

LayoutTests:

  • platform/gtk/TestExpectations:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r254562 r254567  
     12020-01-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
     2
     3        [GTK] Turn off antialiasing when rendering with Ahem
     4        https://bugs.webkit.org/show_bug.cgi?id=204671
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * platform/gtk/TestExpectations:
     9
    1102020-01-15  youenn fablet  <youenn@apple.com>
    211
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r254534 r254567  
    32193219webkit.org/b/152788 imported/mozilla/svg/filter-scaled-02.html [ ImageOnlyFailure Pass ]
    32203220
    3221 webkit.org/b/152821 imported/w3c/web-platform-tests/css/css-multicol/multicol-basic-001.html [ ImageOnlyFailure ]
    3222 webkit.org/b/152821 imported/w3c/web-platform-tests/css/css-multicol/multicol-basic-002.html [ ImageOnlyFailure ]
    3223 webkit.org/b/152821 imported/w3c/web-platform-tests/css/css-multicol/multicol-basic-003.html [ ImageOnlyFailure ]
    3224 webkit.org/b/152821 imported/w3c/web-platform-tests/css/css-multicol/multicol-basic-004.html [ ImageOnlyFailure ]
    3225 webkit.org/b/152821 imported/w3c/web-platform-tests/css/css-multicol/multicol-rule-002.xht [ ImageOnlyFailure ]
    3226 webkit.org/b/152821 imported/w3c/web-platform-tests/css/css-multicol/multicol-rule-px-001.xht [ ImageOnlyFailure ]
    3227 webkit.org/b/152821 imported/w3c/web-platform-tests/css/css-multicol/multicol-rule-stacking-001.xht [ ImageOnlyFailure ]
    3228 webkit.org/b/152821 imported/w3c/web-platform-tests/css/css-multicol/multicol-shorthand-001.xht [ ImageOnlyFailure ]
    3229 webkit.org/b/152821 imported/w3c/web-platform-tests/css/css-multicol/multicol-span-all-block-sibling-003.xht [ ImageOnlyFailure ]
    3230 webkit.org/b/152821 imported/w3c/web-platform-tests/css/css-multicol/multicol-span-all-margin-nested-firstchild-001.xht [ ImageOnlyFailure ]
    3231 
    32323221webkit.org/b/152908 pageoverlay/overlay-installation.html [ Failure ]
    32333222webkit.org/b/152908 pageoverlay/overlay-large-document-scrolled.html [ Failure ]
     
    39443933webkit.org/b/99036 pointer-lock/pointerlockchange-pointerlockerror-events.html [ Failure ]
    39453934
    3946 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-multicol/multicol-rule-fraction-003.xht [ ImageOnlyFailure ]
    3947 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-multicol/multicol-rule-shorthand-2.xht [ ImageOnlyFailure ]
    3948 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-001.html [ ImageOnlyFailure ]
    3949 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-002.html [ ImageOnlyFailure ]
    3950 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-003.html [ ImageOnlyFailure ]
    3951 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-004.html [ ImageOnlyFailure ]
    3952 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-005.html [ ImageOnlyFailure ]
    3953 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-006.html [ ImageOnlyFailure ]
    3954 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-007.html [ ImageOnlyFailure ]
    3955 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-008.html [ ImageOnlyFailure ]
    3956 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-009.html [ ImageOnlyFailure ]
    3957 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-010.html [ ImageOnlyFailure ]
    3958 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-014.html [ ImageOnlyFailure ]
    3959 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-015.html [ ImageOnlyFailure ]
    3960 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-016.html [ ImageOnlyFailure ]
    3961 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-end-017.html [ ImageOnlyFailure ]
    3962 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-001.html [ ImageOnlyFailure ]
    3963 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-002.html [ ImageOnlyFailure ]
    3964 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-003.html [ ImageOnlyFailure ]
    3965 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-004.html [ ImageOnlyFailure ]
    3966 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-005.html [ ImageOnlyFailure ]
    3967 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-justify-006.html [ ImageOnlyFailure ]
    3968 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-001.html [ ImageOnlyFailure ]
    3969 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-002.html [ ImageOnlyFailure ]
    3970 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-003.html [ ImageOnlyFailure ]
    3971 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-004.html [ ImageOnlyFailure ]
    3972 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-005.html [ ImageOnlyFailure ]
    3973 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-006.html [ ImageOnlyFailure ]
    3974 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-007.html [ ImageOnlyFailure ]
    3975 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-008.html [ ImageOnlyFailure ]
    3976 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-009.html [ ImageOnlyFailure ]
    3977 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-010.html [ ImageOnlyFailure ]
    3978 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-014.html [ ImageOnlyFailure ]
    3979 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-015.html [ ImageOnlyFailure ]
    3980 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-016.html [ ImageOnlyFailure ]
    3981 webkit.org/b/204671 imported/w3c/web-platform-tests/css/css-text/text-align/text-align-start-017.html [ ImageOnlyFailure ]
     3935webkit.org/b/206264 imported/w3c/web-platform-tests/css/css-multicol/multicol-gap-percentage-001.html [ Failure ]
    39823936
    39833937webkit.org/b/204675 imported/w3c/web-platform-tests/offscreen-canvas/compositing/2d.composite.globalAlpha.canvaspattern.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r254566 r254567  
     12020-01-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
     2
     3        [GTK] Turn off antialiasing when rendering with Ahem
     4        https://bugs.webkit.org/show_bug.cgi?id=204671
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Many CSS related tests use the "Ahem" font to compare its special
     9        squared glyphs with the positioned elements of the test. But if
     10        we enable antialiasing for this font, then the antialiasing of
     11        the glyphs causes small pixel differences with the reference test.
     12
     13        So, this patch disables antialiasing for the Ahem font in GTK and WPE
     14        ports. This commit its pretty much like r252701 for the Mac/iOS ports.
     15
     16        Covered by existing tests.
     17
     18        * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
     19        (WebCore::GraphicsContextImplCairo::drawGlyphs):
     20        * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
     21        (WebCore::FontCustomPlatformData::fontPlatformData):
     22        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
     23        (WebCore::Font::platformInit):
     24
    1252020-01-15  Andres Gonzalez  <andresg_22@apple.com>
    226
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp

    r254506 r254567  
    255255    double syntheticBoldOffset = font.syntheticBoldOffset();
    256256
     257    if (!font.allowsAntialiasing())
     258        fontSmoothing = FontSmoothingMode::NoSmoothing;
     259
    257260    auto& state = graphicsContext().state();
    258261    Cairo::drawGlyphs(m_platformContext, Cairo::FillSource(state), Cairo::StrokeSource(state),
  • trunk/Source/WebCore/platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp

    r252760 r254567  
    8080    auto* freeTypeFace = static_cast<FT_Face>(cairo_font_face_get_user_data(m_fontFace.get(), &freeTypeFaceKey));
    8181    ASSERT(freeTypeFace);
    82     RefPtr<FcPattern> pattern = defaultFontconfigOptions();
     82    RefPtr<FcPattern> pattern = FcPatternDuplicate(defaultFontconfigOptions());
     83    FcPatternAddString(pattern.get(), FC_FAMILY, reinterpret_cast<const FcChar8*>(freeTypeFace->family_name));
    8384#if ENABLE(VARIATION_FONTS)
    8485    auto variants = buildVariationSettings(freeTypeFace, description);
    8586    if (!variants.isEmpty()) {
    86         pattern = adoptRef(FcPatternDuplicate(pattern.get()));
    8787        FcPatternAddString(pattern.get(), FC_FONT_VARIATIONS, reinterpret_cast<const FcChar8*>(variants.utf8().data()));
    8888    }
  • trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp

    r245393 r254567  
    131131
    132132    m_syntheticBoldOffset = m_platformData.syntheticBold() ? 1.0f : 0.f;
     133
     134    FcChar8* fontConfigFamilyName;
     135    if (FcPatternGetString(m_platformData.fcPattern(), FC_FAMILY, 0, &fontConfigFamilyName) == FcResultMatch) {
     136        String familyName = String::fromUTF8(reinterpret_cast<char*>(fontConfigFamilyName));
     137        // Disable antialiasing for the Ahem font because many tests require this.
     138        if (equalIgnoringASCIICase(familyName, "Ahem"))
     139            m_allowsAntialiasing = false;
     140    }
    133141}
    134142
Note: See TracChangeset for help on using the changeset viewer.