[Harfbuzz] Fix incorrect font rendering when selecting texts in pages which specifies...
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Sep 2017 13:42:34 +0000 (13:42 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Sep 2017 13:42:34 +0000 (13:42 +0000)
commit30baef3f94b3548f7535511307a497b53b087359
treebbdecc52c430f7bad31ef8228c60a8a64add61ec
parentcf9dc5a9148f829d09f13f47dae67fba526c4164
[Harfbuzz] Fix incorrect font rendering when selecting texts in pages which specifies text-rendering: optimizeLegibility
https://bugs.webkit.org/show_bug.cgi?id=148220

Reviewed by Michael Catanzaro.

Add support for shaping a range of characters and return the advance to the first glyph in the range.

Covered by existing tests.

* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::getGlyphsAndAdvancesForComplexText const): Pass "from" and "to" parameters to
HarfBuzzShaper::shape and return the x position of the selection rect.
* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::shape): Forward "from" and "to" parameters to fillGlyphBuffer().
(WebCore::HarfBuzzShaper::fillGlyphBufferFromHarfBuzzRun): Only add glyphs for the given character range.
(WebCore::HarfBuzzShaper::fillGlyphBuffer): Only consider runs in the given character range.
* platform/graphics/harfbuzz/HarfBuzzShaper.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222086 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.h