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

Changeset 132178 in webkit


Ignore:
Timestamp:
Oct 22, 2012, 10:11:29 PM (14 years ago)
Author:
mitz@apple.com
Message:

Font’s fast code path is used for partial runs with kerning and ligatures, but shouldn’t be
https://bugs.webkit.org/show_bug.cgi?id=100068

Reviewed by Sam Weinig.

As described in <http://webkit.org/b/100050>, the fast code path doesn’t handle partial runs
correctly when kerning or ligatures are enabled. Since the partial-run case is uncommon,
for now just use the complex code path in this case.

  • platform/graphics/Font.cpp:

(WebCore::Font::drawText): Changed to use the complex path for partial runs if there are any
typesetting features.
(WebCore::Font::drawEmphasisMarks): Ditto.
(WebCore::Font::selectionRectForText): Ditto.
(WebCore::Font::offsetForPosition): Changed to use the complex path if there are any
typesetting features.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r132177 r132178  
     12012-10-22  Dan Bernstein  <mitz@apple.com>
     2
     3        Font’s fast code path is used for partial runs with kerning and ligatures, but shouldn’t be
     4        https://bugs.webkit.org/show_bug.cgi?id=100068
     5
     6        Reviewed by Sam Weinig.
     7
     8        As described in <http://webkit.org/b/100050>, the fast code path doesn’t handle partial runs
     9        correctly when kerning or ligatures are enabled. Since the partial-run case is uncommon,
     10        for now just use the complex code path in this case.
     11
     12        * platform/graphics/Font.cpp:
     13        (WebCore::Font::drawText): Changed to use the complex path for partial runs if there are any
     14        typesetting features.
     15        (WebCore::Font::drawEmphasisMarks): Ditto.
     16        (WebCore::Font::selectionRectForText): Ditto.
     17        (WebCore::Font::offsetForPosition): Changed to use the complex path if there are any
     18        typesetting features.
     19
    1202012-10-22  Peter Wang  <peter.wang@torchmobile.com.cn>
    221
  • trunk/Source/WebCore/platform/graphics/Font.cpp

    r131410 r132178  
    160160
    161161    CodePath codePathToUse = codePath(run);
     162    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
     163    if (codePathToUse != Complex && typesettingFeatures() && (from || to != run.length()))
     164        codePathToUse = Complex;
    162165
    163166    if (codePathToUse != Complex)
     
    175178        to = run.length();
    176179
    177     if (codePath(run) != Complex)
     180    CodePath codePathToUse = codePath(run);
     181    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
     182    if (codePathToUse != Complex && typesettingFeatures() && (from || to != run.length()))
     183        codePathToUse = Complex;
     184
     185    if (codePathToUse != Complex)
    178186        drawEmphasisMarksForSimpleText(context, run, mark, point, from, to);
    179187    else
     
    233241    to = (to == -1 ? run.length() : to);
    234242
    235     if (codePath(run) != Complex)
     243    CodePath codePathToUse = codePath(run);
     244    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
     245    if (codePathToUse != Complex && typesettingFeatures() && (from || to != run.length()))
     246        codePathToUse = Complex;
     247
     248    if (codePathToUse != Complex)
    236249        return selectionRectForSimpleText(run, point, h, from, to);
    237250
     
    241254int Font::offsetForPosition(const TextRun& run, float x, bool includePartialGlyphs) const
    242255{
    243     if (codePath(run) != Complex)
     256    // FIXME: Use the fast code path once it handles partial runs with kerning and ligatures. See http://webkit.org/b/100050
     257    if (codePath(run) != Complex && !typesettingFeatures())
    244258        return offsetForPositionForSimpleText(run, x, includePartialGlyphs);
    245259
Note: See TracChangeset for help on using the changeset viewer.