DescriptionOffset-only GlyphBuffer
Instead of storing glyph advances (only to later convert to offsets for the Skia draw calls), refactor GlyphBuffer to store offsets directly. This reduces the amount of buffer post-processing and decreases the API friction when calling into Skia.
GlyphBuffer offsets are relative to the text run origin and are either horizontal/x-only (generated by the simple shaper) or x/y interleaved (generated by the complex shaper). These correspond to the text positioning modes used by Skia.
Thanks to the new buffer format, the refactor also includes:
* zero offset processing when building text blobs (the offsets are essentially memcpy-ed)
* minimal processing (translate by destination point) for the legacy drawPosText path (we could also optimize this path, but the added complexity is probably not justified given the plans to completely switch to text blobs)
* SimpleShaper::adjustSpacing no longer needs to inject synthetic glyphs but simply adjusts the offsets for following glyps
* drawEmphasisMarks uses explicit offsets to glyph-midpoint instead of computing them based on advances
Other things to investigate:
* multi-run buffer builder (to support multi-run text blobs)
* stop storing space glyphs (simply adjust the following glyph offsets instead)
R=jbroman@chromium.org,eae@chromium.org,dominik.rottsches@intel.com
BUG=377845
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=185129
Patch Set 1 #Patch Set 2 : updated unit test #Patch Set 3 : speculative vertical rounding fix #Patch Set 4 : speculative vertical rounding fix 2 #Patch Set 5 : instrumented test run #Patch Set 6 : speculative vertical rounding fix take 3 #Patch Set 7 : cleanup #Patch Set 8 : expectations update #Patch Set 9 : refactor emphasis to avoid advances #Patch Set 10 : minor cleanup #
Total comments: 16
Patch Set 11 : review comments #
Total comments: 2
Patch Set 12 : review nit #
Total comments: 6
Patch Set 13 : review comments + rebase #Patch Set 14 : rebased #
Messages
Total messages: 17 (3 generated)
|