Proxy all WR interactions for layout/font/script/canvas threads to the compositor

thread. There is now a single RenderApi that is used, and all transactions are serialized
through the compositor.
This commit is contained in:
Josh Matthews 2020-06-08 13:53:33 -04:00
parent a6016b3a62
commit 75efaa95f5
16 changed files with 344 additions and 261 deletions

View file

@ -11,7 +11,9 @@ name = "gfx_traits"
path = "lib.rs"
[dependencies]
app_units = "0.7"
malloc_size_of = { path = "../malloc_size_of" }
malloc_size_of_derive = "0.1"
range = { path = "../range" }
serde = "1.0"
webrender_api = { git = "https://github.com/servo/webrender" }

View file

@ -103,3 +103,17 @@ pub fn node_id_from_scroll_id(id: usize) -> Option<usize> {
}
None
}
pub enum FontData {
Raw(Vec<u8>),
Native(webrender_api::NativeFontHandle),
}
pub trait WebrenderApi {
fn add_font_instance(
&self,
font_key: webrender_api::FontKey,
size: app_units::Au,
) -> webrender_api::FontInstanceKey;
fn add_font(&self, data: FontData) -> webrender_api::FontKey;
}