fonts: Clean up messaging during web fonts loads (#32332)

Instead of sending a message to the script thread via IPC when a web
font loads and then sending another, just give the `FontContext` a
callback that send a single message to the script thread. This moves all
the cache invalidation internally into `FontContext` as well.

Additionally, the unused LayoutControlMessage::ExitNow enum variant is
removed.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Martin Robinson 2024-05-22 10:30:35 +02:00 committed by GitHub
parent d47c8ff2ae
commit 9f32809671
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 150 additions and 205 deletions

View file

@ -179,10 +179,7 @@ pub trait LayoutFactory: Send + Sync {
pub trait Layout {
/// Handle a single message from the Constellation.
fn handle_constellation_msg(&mut self, msg: LayoutControlMsg);
/// Handle a a single mesasge from the FontCacheThread.
fn handle_font_cache_msg(&mut self);
fn handle_constellation_message(&mut self, msg: LayoutControlMsg);
/// Get a reference to this Layout's Stylo `Device` used to handle media queries and
/// resolve font metrics.