servo/components/gfx
Martin Robinson efa0d45757
Remove FontContextHandle (#32038)
The `FontContextHandle` was really only used on FreeType platforms to
store the `FT_Library` handle to use for creating faces. Each
`FontContext` and `FontCacheThread` would create its own
`FontContextHandle`. This change removes this data structure in favor of
a mutex-protected shared `FontContextHandle` for an entire Servo
process. The handle is initialized using a `OnceLock` to ensure that it
only happens once and also that it stays alive for the entire process
lifetime.

In addition to greatly simplifying the code, this will make it possible
for different threads to share platform-specific `FontHandle`s, avoiding
multiple allocations for a single font.

The only downside to all of this is that memory usage of FreeType fonts
isn't measured (though the mechanism is still there). This is because
the `FontCacheThread` currently doesn't do any memory measurement.
Eventually this *will* happen though, during the font system redesign.
In exchange, this should reduce the memory usage since there is only a
single FreeType library loaded into memory now.

This is part of #32033.
2024-04-12 10:39:32 +00:00
..
platform Remove FontContextHandle (#32038) 2024-04-12 10:39:32 +00:00
tests Remove FontContextHandle (#32038) 2024-04-12 10:39:32 +00:00
text fonts: Consider Tertiary Ideographic Plane to be CJK (#31670) 2024-03-18 11:45:52 +00:00
Cargo.toml Remove FontContextHandle (#32038) 2024-04-12 10:39:32 +00:00
font.rs Remove FontContextHandle (#32038) 2024-04-12 10:39:32 +00:00
font_cache_thread.rs Remove FontContextHandle (#32038) 2024-04-12 10:39:32 +00:00
font_context.rs Remove FontContextHandle (#32038) 2024-04-12 10:39:32 +00:00
font_template.rs Remove FontContextHandle (#32038) 2024-04-12 10:39:32 +00:00
lib.rs gfx: Rename WebrenderSurfman to RenderingContext and move to gfx (#31184) 2024-01-27 17:58:34 +00:00
rendering_context.rs clippy: Fix remaining warnings in gfx for MacOS (#31669) 2024-03-15 12:14:36 +00:00