servo/components
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
..
allocator Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
background_hang_monitor 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 Move unmultiply_inplace to pixels crate (#33553) 2024-09-27 04:28:00 +00:00
compositing fonts: Make FontKey and FontInstanceKey generation asynchronous (#33600) 2024-10-01 15:31:26 +00:00
config Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
config_plugins Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
constellation Create HttpStatus to safely deal with HTTP responses status. (#33581) 2024-09-29 18:23:48 +00:00
deny_public_fields Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
devtools Create HttpStatus to safely deal with HTTP responses status. (#33581) 2024-09-29 18:23:48 +00:00
dom_struct Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
domobject_derive Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
fonts fonts: Make FontKey and FontInstanceKey generation asynchronous (#33600) 2024-10-01 15:31:26 +00:00
geometry Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
hyper_serde Stop using time@0.1 in Servo (#33394) 2024-09-11 07:09:56 +00:00
jstraceable_derive Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
layout fonts: Make FontKey and FontInstanceKey generation asynchronous (#33600) 2024-10-01 15:31:26 +00:00
layout_2020 fonts: Make FontKey and FontInstanceKey generation asynchronous (#33600) 2024-10-01 15:31:26 +00:00
layout_thread fonts: Simplify FontContext in two ways that affect the unit test (#33541) 2024-09-25 20:15:47 +00:00
layout_thread_2020 fonts: Simplify FontContext in two ways that affect the unit test (#33541) 2024-09-25 20:15:47 +00:00
media Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
metrics 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
pixels Optimized unmultiply_inplace to remove fp ops (#33582) 2024-09-30 19:39:27 +00:00
profile Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
rand Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
range Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
script webgpu: renovate gpucanvascontext and webgpu presentation to match the spec (#33521) 2024-10-01 10:03:11 +00:00
servo fonts: Make FontKey and FontInstanceKey generation asynchronous (#33600) 2024-10-01 15:31:26 +00:00
shared fonts: Make FontKey and FontInstanceKey generation asynchronous (#33600) 2024-10-01 15:31:26 +00:00
url Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
webdriver_server Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
webgpu webgpu: renovate gpucanvascontext and webgpu presentation to match the spec (#33521) 2024-10-01 10:03:11 +00:00