Changeset 124454 in webkit


Ignore:
Timestamp:
Aug 2, 2012 7:21:10 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Cairo] Add complex font drawing using HarfbuzzNG
https://bugs.webkit.org/show_bug.cgi?id=91864

Patch by Dominik Röttsches <dominik.rottsches@intel.com> on 2012-08-02
Reviewed by Martin Robinson.

Source/WebCore:

Unfortunately the Freetype based approach that avoids allocations and UTF8 conversion
fails to produce correct results for some tests.

No new tests, at least

fast/dom/52776.html
fast/text/atsui-negative-spacing-features.html
fast/text/atsui-spacing-features.html

expose this problem.

  • platform/graphics/harfbuzz/ng/HarfBuzzNGFaceCairo.cpp:

(WebCore::harfbuzzGetGlyph): Revert to initial cairo_scaled_font based approach.

LayoutTests:

Unskipping tests, now passing with valid complex font results.

  • platform/efl/TestExpectations:
  • platform/efl/fast/text/atsui-pointtooffset-calls-cg-expected.txt:
  • platform/efl/fast/text/international/text-spliced-font-expected.png: Added.
  • platform/efl/fast/text/international/text-spliced-font-expected.txt: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r124448 r124454  
     12012-08-02  Dominik Röttsches  <dominik.rottsches@intel.com>
     2
     3        [Cairo] Add complex font drawing using HarfbuzzNG
     4        https://bugs.webkit.org/show_bug.cgi?id=91864
     5
     6        Reviewed by Martin Robinson.
     7
     8        Unskipping tests, now passing with valid complex font results.
     9
     10        * platform/efl/TestExpectations:
     11        * platform/efl/fast/text/atsui-pointtooffset-calls-cg-expected.txt:
     12        * platform/efl/fast/text/international/text-spliced-font-expected.png: Added.
     13        * platform/efl/fast/text/international/text-spliced-font-expected.txt: Added.
     14
    1152012-08-02  Alexander Pavlov  <apavlov@chromium.org>
    216
  • trunk/LayoutTests/platform/efl/TestExpectations

    r124428 r124454  
    359359BUGWKEFL SKIP : storage/indexeddb = PASS
    360360BUGWKEFL SKIP : http/tests/inspector/indexeddb = PASS
    361 
    362 // harfbuzzGetGlyph is producing incorrect results.
    363 BUGWK91864 : fast/dom/52776.html = TEXT
    364 BUGWK91864 : fast/text/atsui-negative-spacing-features.html = TEXT
    365 BUGWK91864 : fast/text/atsui-pointtooffset-calls-cg.html = TEXT
    366 BUGWK91864 : fast/text/atsui-spacing-features.html = TEXT
    367 BUGWK91864 : fast/text/international/text-spliced-font.html = MISSING
    368361
    369362// Quota API is not supported.
  • trunk/LayoutTests/platform/efl/fast/text/atsui-pointtooffset-calls-cg-expected.txt

    r123874 r124454  
    1717        RenderText {#text} at (62,18) size 632x19
    1818          text run at (62,18) width 632: " by clicking the X and verifying that the correct caret position (13) is reported to the editing delegate."
    19 caret: position 11 of child 2 {#text} of body
     19caret: position 13 of child 2 {#text} of body
  • trunk/Source/WebCore/ChangeLog

    r124453 r124454  
     12012-08-02  Dominik Röttsches  <dominik.rottsches@intel.com>
     2
     3        [Cairo] Add complex font drawing using HarfbuzzNG
     4        https://bugs.webkit.org/show_bug.cgi?id=91864
     5
     6        Reviewed by Martin Robinson.
     7
     8        Unfortunately the Freetype based approach that avoids allocations and UTF8 conversion
     9        fails to produce correct results for some tests.
     10
     11        No new tests, at least
     12          fast/dom/52776.html
     13          fast/text/atsui-negative-spacing-features.html
     14          fast/text/atsui-spacing-features.html
     15        expose this problem.
     16
     17        * platform/graphics/harfbuzz/ng/HarfBuzzNGFaceCairo.cpp:
     18        (WebCore::harfbuzzGetGlyph): Revert to initial cairo_scaled_font based approach.
     19
    1202012-08-02  Eugene Klyuchnikov  <eustas.big@gmail.com>
    221
  • trunk/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzNGFaceCairo.cpp

    r123864 r124454  
    9696    cairo_scaled_font_t* scaledFont = platformData->scaledFont();
    9797    ASSERT(scaledFont);
    98     CairoFtFaceLocker cairoFtFaceLocker(scaledFont);
    99     FT_Face ftFace = cairoFtFaceLocker.lock();
    100     ASSERT(ftFace);
    101     *glyph = FT_Get_Char_Index(ftFace, unicode);
    102     return !!*glyph;
     98
     99    cairo_glyph_t* glyphs = 0;
     100    int numGlyphs = 0;
     101    CString utf8Codepoint = UTF8Encoding().encode(reinterpret_cast<UChar*>(&unicode), 1, QuestionMarksForUnencodables);
     102    if (CAIRO_STATUS_SUCCESS != cairo_scaled_font_text_to_glyphs(scaledFont, 0, 0, utf8Codepoint.data(), utf8Codepoint.length(), &glyphs, &numGlyphs, 0, 0, 0))
     103        return false;
     104    if (!numGlyphs)
     105        return false;
     106    *glyph = glyphs[0].index;
     107    cairo_glyph_free(glyphs);
     108    return true;
    103109}
    104110
Note: See TracChangeset for help on using the changeset viewer.