mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
fonts: Clean up WebRender web fonts when they are no longer used (#32545)
This is the first part of cleaning up unused WebRender resources. Currently this only cleans up web font resources, but a more full-featured implementation in the future could also clean up unused system fonts. Fixes #32345. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
parent
bd15a4fbd8
commit
fef1337da0
6 changed files with 181 additions and 7 deletions
|
@ -845,6 +845,23 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
.send_transaction(self.webrender_document, txn);
|
||||
},
|
||||
|
||||
ForwardedToCompositorMsg::Layout(ScriptToCompositorMsg::RemoveFonts(
|
||||
keys,
|
||||
instance_keys,
|
||||
)) => {
|
||||
let mut transaction = Transaction::new();
|
||||
|
||||
for instance in instance_keys.into_iter() {
|
||||
transaction.delete_font_instance(instance);
|
||||
}
|
||||
for key in keys.into_iter() {
|
||||
transaction.delete_font(key);
|
||||
}
|
||||
|
||||
self.webrender_api
|
||||
.send_transaction(self.webrender_document, transaction);
|
||||
},
|
||||
|
||||
ForwardedToCompositorMsg::Net(NetToCompositorMsg::AddImage(key, desc, data)) => {
|
||||
let mut txn = Transaction::new();
|
||||
txn.add_image(key, desc, data, None);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue