servo/components/layout_2020
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
..
display_list layout: Add support for object-fit and object-position (#33479) 2024-09-18 06:20:28 +00:00
flexbox Make ComputedValuesExt expose keywords for the sizing properties (#33558) 2024-09-27 17:16:07 +00:00
flow fonts: Make FontKey and FontInstanceKey generation asynchronous (#33600) 2024-10-01 15:31:26 +00:00
fragment_tree layout: Add support for object-fit and object-position (#33479) 2024-09-18 06:20:28 +00:00
table Simplify the computation of CAPMIN (#33577) 2024-09-28 09:39:22 +00:00
tests layout: Right-to-left support for other layout modes (#33375) 2024-09-11 13:40:11 +00:00
Cargo.toml Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
cell.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
context.rs fonts: Simplify FontContext in two ways that affect the unit test (#33541) 2024-09-25 20:15:47 +00:00
dom.rs Add HTMLCanvasDataSource::Empty that represent transparent black instead of HTMLCanvasDataSource::Image(None) (#33519) 2024-09-22 14:04:53 +00:00
dom_traversal.rs Replace .map_or(false with Option::is_some_and (#33468) 2024-09-16 10:03:52 +00:00
formatting_contexts.rs Simplify the computation of CAPMIN (#33577) 2024-09-28 09:39:22 +00:00
geom.rs Make ComputedValuesExt expose keywords for the sizing properties (#33558) 2024-09-27 17:16:07 +00:00
layout_debug.rs clippy: Fix warnings in shared and config, fonts, layout, and layout_2020 components (#32674) 2024-07-04 14:18:58 +00:00
lib.rs Make ComputedValuesExt expose keywords for the sizing properties (#33558) 2024-09-27 17:16:07 +00:00
lists.rs layout: Add a basic support for list-style-position: outside (#32114) 2024-04-22 14:23:35 +00:00
positioned.rs Make ComputedValuesExt expose keywords for the sizing properties (#33558) 2024-09-27 17:16:07 +00:00
query.rs layout: Switch .len() comparison to is_empty() in components/layout_2020/query.rs. (#33544) 2024-09-25 20:29:30 +00:00
replaced.rs Make ComputedValuesExt expose keywords for the sizing properties (#33558) 2024-09-27 17:16:07 +00:00
sizing.rs Make ComputedValuesExt expose keywords for the sizing properties (#33558) 2024-09-27 17:16:07 +00:00
style_ext.rs Make ComputedValuesExt expose keywords for the sizing properties (#33558) 2024-09-27 17:16:07 +00:00
traversal.rs script: Split style and layout data in DOM nodes (#31985) 2024-04-04 07:56:51 +00:00