servo/components/canvas
Martin Robinson 0553789d48
fonts: Instantiate system fonts using system font loaders (#33747)
System fonts used to be instantiated using the system font loader and
this change restores that behavior. In addition, on macOS and FreeType
platforms font data for system fonts is loaded using memory mapping. The
benefit is that system font loaders typically are able to cache fonts in
system memory (using memory mapping, for instance) and we'd like to load
them in a the way most compatible with other applications.

On my Linux system, this manages to get the overhead of loading a very
large font down from 10ms to approximately 1ms. Subsequent runs show
even less overhead. We've measured similar gains on macOS systems.

Currently, system font data must be loaded into memory manually for
canvas and this is unlikely to change even with a switch to `vello`. The
use of explicit memmory mapping should help in this case -- though it
probably won't be possible to use this properly on macOS and Windows if
we ever want to load fonts from TTCs properly.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-10-10 23:09:51 +00:00
..
webgl_mode Move RenderingContext to webrender_traits (#32386) 2024-05-28 12:48:55 +00:00
canvas_data.rs fonts: Instantiate system fonts using system font loaders (#33747) 2024-10-10 23:09:51 +00:00
canvas_paint_thread.rs compositor: Create a single cross-process compositor API (#33619) (#33660) 2024-10-09 17:30:24 +00:00
Cargo.toml Add rust-version to all Cargo.toml files (#33483) 2024-09-17 16:39:07 +00:00
lib.rs remove extern crate (#30311) 2023-09-08 12:11:31 +00:00
raqote_backend.rs fonts: Instantiate system fonts using system font loaders (#33747) 2024-10-10 23:09:51 +00:00
webgl_limits.rs Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
webgl_thread.rs Move unmultiply_inplace to pixels crate (#33553) 2024-09-27 04:28:00 +00:00