servo/components/shared
Martin Robinson abad89a49c
fonts: Make FontKey and FontInstanceKey generation asynchronous (#33600)
Instead of a blocking a layout thread on the generation of WebRender
`FontKey`s and `FontInstanceKey`s, generate the keys ahead of time and
send the font data to WebRender asynchronously. This has the benefit of
allowing use of the font much more quickly in layout, though blocking
display list sending itself on the font data upload.

In order to make this work for web fonts, `FontContext` now asks the
`SystemFontService` for a `FontKey`s and `FontInstanceKey`s for new web
fonts. This should happen much more quickly as the `SystemFontService`
is only blocking in order to load system fonts into memory now. In
practice this still drops layout thread blocking to fractions of a
millisecond instead of multiple milliseconds as before.

In addition, ensure that we don't send font data or generate keys for
fonts that are used in layout but never added to display lists. This
should help to reduce memory usage and increase performance.

Performance of this change was verified by putting a microbenchmark
around `FontContext::create_font` which is what triggered font key
generation.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-10-01 15:31:26 +00:00
..
background_hang_monitor Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
base Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
bluetooth Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
canvas Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
compositing fonts: Simplify FontContext in two ways that affect the unit test (#33541) 2024-09-25 20:15:47 +00:00
devtools Create HttpStatus to safely deal with HTTP responses status. (#33581) 2024-09-29 18:23:48 +00:00
embedder Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
fonts Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
net Create HttpStatus to safely deal with HTTP responses status. (#33581) 2024-09-29 18:23:48 +00:00
profile Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
script chore: Update wgpu (#33506) 2024-09-21 04:20:18 +00:00
script_layout fonts: Use IpcSharedMemory to send font data (#33530) 2024-09-25 07:31:55 +00:00
webrender fonts: Make FontKey and FontInstanceKey generation asynchronous (#33600) 2024-10-01 15:31:26 +00:00