diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-09-25 09:31:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-25 07:31:55 +0000 |
commit | ade902207fc1f941fc77fa47bff1db0375ed7220 (patch) | |
tree | d94e171f40e2c6ad56b7e1a07cb1a78173509644 /components/compositing/compositor.rs | |
parent | 2c6d9a190f947ca6fe58a06d2549c4924e678d3a (diff) | |
download | servo-ade902207fc1f941fc77fa47bff1db0375ed7220.tar.gz servo-ade902207fc1f941fc77fa47bff1db0375ed7220.zip |
fonts: Use `IpcSharedMemory` to send font data (#33530)
This changes modifes the way that font data is sent over IPC channels.
Instead of serializing the data or sending it via IPC byte senders, font
data is copied into shared memory and a copy of the handle is sent over
the channel.
There is also the idea of sending the file handle of the on disk data of
system fonts. This could be implemented as a further followup once there
is an abstraction in `ipc-channel` over file handles.
To accomplish this, a `FontData` abstraction is added, which also allows
caching an in-memory shared `Arc<Vec<u8>>` version of the data (neeeded
by some APIs). This could also be a place for caching font tables in the
future.
Finally, the `FontCacheThread` is renamed to the `SystemFontService`
while the proxy for this is now named `SystemFontServiceProxy`.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Diffstat (limited to 'components/compositing/compositor.rs')
-rw-r--r-- | components/compositing/compositor.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 02ed570ae2c..ab3f4ae0bfb 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -895,12 +895,11 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> { ForwardedToCompositorMsg::Font(FontToCompositorMsg::AddFont( key_sender, index, - bytes_receiver, + data, )) => { let font_key = self.webrender_api.generate_font_key(); let mut transaction = Transaction::new(); - let bytes = bytes_receiver.recv().unwrap_or_default(); - transaction.add_raw_font(font_key, bytes, index); + transaction.add_raw_font(font_key, (**data).into(), index); self.webrender_api .send_transaction(self.webrender_document, transaction); let _ = key_sender.send(font_key); |