LibGfx+LibWeb: Draw glyph runs with subpixel accuracy

This improves the quality of our font rendering, especially when
animations are involved. Relevant changes:

  * Skia fonts have their subpixel flag set, which means that individual
    glyphs are rendered at subpixel offsets causing glyph runs as a
    whole to look better.

  * Fragment offsets are no longer rounded to whole device pixels, and
    instead the floating point offset is kept. This allows us to pass
    through the floating point baseline position all the way to the Skia
    calls, which already expected that to be a float position.

The `scrollable-contains-table.html` ref test needed different table
headings since they would slightly inflate the column size in the test
file, but not the reference.
This commit is contained in:
Jelle Raaijmakers 2024-12-09 10:24:26 +01:00 committed by Jelle Raaijmakers
commit 4d9f17eddf
Notes: github-actions[bot] 2024-12-21 22:10:48 +00:00
83 changed files with 524 additions and 525 deletions

View file

@ -5,7 +5,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (24,8) content-size 768x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (24,8) content-size 768x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [42,8 14.265625x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [42.125,8 14.265625x17] baseline: 13.296875
"A"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 3, rect: [24,8 18.125x17] baseline: 13.296875
@ -15,7 +15,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (24,25) content-size 768x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (24,25) content-size 768x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [45,25 9.34375x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [44.59375,25 9.34375x17] baseline: 13.296875
"B"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 3, rect: [24,25 20.59375x17] baseline: 13.296875
@ -25,7 +25,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (24,42) content-size 768x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (24,42) content-size 768x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [45,42 10.3125x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [44.875,42 10.3125x17] baseline: 13.296875
"C"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 3, rect: [24,42 20.875x17] baseline: 13.296875
@ -45,7 +45,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (40,76) content-size 752x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (40,76) content-size 752x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [70,76 11.140625x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [70.21875,76 11.140625x17] baseline: 13.296875
"D"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [40,76 30.21875x17] baseline: 13.296875
@ -55,7 +55,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (40,93) content-size 752x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (40,93) content-size 752x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [73,93 11.859375x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [72.6875,93 11.859375x17] baseline: 13.296875
"E"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [40,93 32.6875x17] baseline: 13.296875
@ -75,7 +75,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (56,127) content-size 736x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (56,127) content-size 736x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [100,127 12.546875x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [99.65625,127 12.546875x17] baseline: 13.296875
"F"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 7, rect: [56,127 43.65625x17] baseline: 13.296875
@ -85,7 +85,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (56,144) content-size 736x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (56,144) content-size 736x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [102,144 13.234375x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [102.125,144 13.234375x17] baseline: 13.296875
"G"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 7, rect: [56,144 46.125x17] baseline: 13.296875
@ -95,7 +95,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (56,161) content-size 736x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (56,161) content-size 736x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [102,161 12.234375x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [102.40625,161 12.234375x17] baseline: 13.296875
"H"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 7, rect: [56,161 46.40625x17] baseline: 13.296875
@ -109,7 +109,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (40,178) content-size 752x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (40,178) content-size 752x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [72,178 4.59375x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [71.625,178 4.59375x17] baseline: 13.296875
"I"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [40,178 31.625x17] baseline: 13.296875
@ -119,7 +119,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (40,195) content-size 752x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (40,195) content-size 752x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [72,195 8.90625x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [72.328125,195 8.90625x17] baseline: 13.296875
"J"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 5, rect: [40,195 32.328125x17] baseline: 13.296875
@ -133,7 +133,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (24,212) content-size 768x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (24,212) content-size 768x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [44,212 9.8125x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [44.234375,212 9.8125x17] baseline: 13.296875
"K"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 3, rect: [24,212 20.234375x17] baseline: 13.296875
@ -143,7 +143,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (24,229) content-size 768x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (24,229) content-size 768x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [45,229 10.859375x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [44.515625,229 10.859375x17] baseline: 13.296875
"L"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 3, rect: [24,229 20.515625x17] baseline: 13.296875
@ -153,7 +153,7 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline
BlockContainer <(anonymous)> at (24,246) content-size 768x0 children: inline
TextNode <#text>
BlockContainer <div.li> at (24,246) content-size 768x17 children: inline
frag 0 from TextNode start: 0, length: 1, rect: [45,246 11.765625x17] baseline: 13.296875
frag 0 from TextNode start: 0, length: 1, rect: [44.5,246 11.765625x17] baseline: 13.296875
"M"
InlineNode <(anonymous)>
frag 0 from TextNode start: 0, length: 3, rect: [24,246 20.5x17] baseline: 13.296875