Changeset 254190 in webkit


Ignore:
Timestamp:
Jan 8, 2020 1:00:34 AM (4 years ago)
Author:
Fujii Hironori
Message:

[HarfBuzz][GTK] fast/text/complex-first-glyph-with-initial-advance.html is failing
https://bugs.webkit.org/show_bug.cgi?id=118221

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Arabic diacritics made glyphs vertically unaligned if the first
glyph had a vertical offset.

The initial advance should be same with the first glyph origin for
HarfBuzz. See the diagram in ComplexTextController.h for details.
<https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/ComplexTextController.h?rev=224007#L109>

drawGlyphs of Cairo port was assuming upward y-axis for glyph
advances even though those of Mac and AppleWin port are assuming
downward y-axis. This is a problem for Windows ports because
AppleWin and WinCairo port are sharing the code calculating
advances.

Covered by existing tests.

  • platform/graphics/cairo/FontCairo.cpp:

(WebCore::FontCascade::drawGlyphs):

  • platform/graphics/cairo/GraphicsContextImplCairo.cpp:

(WebCore::GraphicsContextImplCairo::drawGlyphs):
Sum up the height of advances into yOffset instead of subtraction.

  • platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:

(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
Don't negate offsetY. Set m_initialAdvance as the first item of
m_glyphOrigins.

LayoutTests:

  • platform/gtk/TestExpectations: Unmarked

fast/text/complex-first-glyph-with-initial-advance.html and
fast/text/initial-advance-in-intermediate-run-complex.html.

  • platform/wincairo/TestExpectations: Unmarked

fast/text/complex-first-glyph-with-initial-advance.html and
fast/text/complex-initial-advance.html.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r254187 r254190  
     12020-01-08  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [HarfBuzz][GTK] fast/text/complex-first-glyph-with-initial-advance.html is failing
     4        https://bugs.webkit.org/show_bug.cgi?id=118221
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * platform/gtk/TestExpectations: Unmarked
     9        fast/text/complex-first-glyph-with-initial-advance.html and
     10        fast/text/initial-advance-in-intermediate-run-complex.html.
     11        * platform/wincairo/TestExpectations: Unmarked
     12        fast/text/complex-first-glyph-with-initial-advance.html and
     13        fast/text/complex-initial-advance.html.
     14
    1152020-01-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
    216
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r254154 r254190  
    29452945webkit.org/b/118220 http/tests/cache/partitioned-cache-iframe.html [ Failure ]
    29462946
    2947 webkit.org/b/118221 fast/text/complex-first-glyph-with-initial-advance.html [ ImageOnlyFailure ]
    2948 
    29492947webkit.org/b/118416 storage/websql/sql-error-codes.html [ Failure ]
    29502948
     
    33063304
    33073305webkit.org/b/168552 fast/text/hyphenate-locale.html [ Failure ]
    3308 
    3309 webkit.org/b/168555 fast/text/initial-advance-in-intermediate-run-complex.html [ ImageOnlyFailure ]
    33103306
    33113307webkit.org/b/168719 fast/css/paint-order-shadow.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r253669 r254190  
    17151715fast/text/chinese-font-name-aliases.html [ ImageOnlyFailure ]
    17161716fast/text/combining-mark-paint.html [ ImageOnlyFailure ]
    1717 fast/text/complex-first-glyph-with-initial-advance.html [ ImageOnlyFailure ]
    17181717fast/text/complex-grapheme-cluster-with-initial-advance.html [ ImageOnlyFailure ]
    1719 fast/text/complex-initial-advance.html [ ImageOnlyFailure ]
    17201718fast/text/complex-small-caps-non-bmp-capitalize.html [ ImageOnlyFailure ]
    17211719fast/text/decorations-vertical-underline.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r254187 r254190  
     12020-01-08  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [HarfBuzz][GTK] fast/text/complex-first-glyph-with-initial-advance.html is failing
     4        https://bugs.webkit.org/show_bug.cgi?id=118221
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Arabic diacritics made glyphs vertically unaligned if the first
     9        glyph had a vertical offset.
     10
     11        The initial advance should be same with the first glyph origin for
     12        HarfBuzz. See the diagram in ComplexTextController.h for details.
     13        <https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/ComplexTextController.h?rev=224007#L109>
     14
     15        drawGlyphs of Cairo port was assuming upward y-axis for glyph
     16        advances even though those of Mac and AppleWin port are assuming
     17        downward y-axis. This is a problem for Windows ports because
     18        AppleWin and WinCairo port are sharing the code calculating
     19        advances.
     20
     21        Covered by existing tests.
     22
     23        * platform/graphics/cairo/FontCairo.cpp:
     24        (WebCore::FontCascade::drawGlyphs):
     25        * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
     26        (WebCore::GraphicsContextImplCairo::drawGlyphs):
     27        Sum up the height of advances into yOffset instead of subtraction.
     28
     29        * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
     30        (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
     31        Don't negate offsetY. Set m_initialAdvance as the first item of
     32        m_glyphOrigins.
     33
    1342020-01-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
    235
  • trunk/Source/WebCore/platform/graphics/cairo/FontCairo.cpp

    r243602 r254190  
    6666            glyphs[i] = { glyphsData[i], xOffset, yOffset };
    6767            xOffset += advances[i].width();
    68             yOffset -= advances[i].height();
     68            yOffset += advances[i].height();
    6969        }
    7070    }
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp

    r252136 r254190  
    249249            glyphs[i] = { glyphsData[i], xOffset, yOffset };
    250250            xOffset += advances[i].width();
    251             yOffset -= advances[i].height();
     251            yOffset += advances[i].height();
    252252        }
    253253    }
  • trunk/Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp

    r245393 r254190  
    165165
    166166        float offsetX = harfBuzzPositionToFloat(glyphPositions[i].x_offset);
    167         float offsetY = -harfBuzzPositionToFloat(glyphPositions[i].y_offset);
     167        float offsetY = harfBuzzPositionToFloat(glyphPositions[i].y_offset);
    168168        float advanceX = harfBuzzPositionToFloat(glyphPositions[i].x_advance);
    169169        float advanceY = harfBuzzPositionToFloat(glyphPositions[i].y_advance);
    170 
    171         if (!i)
    172             m_initialAdvance = { offsetX, -offsetY };
    173170
    174171        m_glyphs[i] = glyph;
     
    176173        m_glyphOrigins[i] = { offsetX, offsetY };
    177174    }
     175    m_initialAdvance = toFloatSize(m_glyphOrigins[0]);
    178176}
    179177
Note: See TracChangeset for help on using the changeset viewer.