mirror of
https://github.com/servo/servo.git
synced 2025-06-09 00:53:26 +00:00
Update webrender.
This commit is contained in:
parent
a34d1573b6
commit
b39955df67
11 changed files with 16 additions and 28 deletions
|
@ -16,7 +16,6 @@ default = []
|
|||
gl = ["gleam", "pixels"]
|
||||
|
||||
[dependencies]
|
||||
app_units = "0.7"
|
||||
canvas = { path = "../canvas" }
|
||||
crossbeam-channel = "0.4"
|
||||
embedder_traits = { path = "../embedder_traits" }
|
||||
|
|
|
@ -129,7 +129,7 @@ pub enum Msg {
|
|||
pub enum WebrenderFontMsg {
|
||||
AddFontInstance(
|
||||
webrender_api::FontKey,
|
||||
app_units::Au,
|
||||
f32,
|
||||
Sender<webrender_api::FontInstanceKey>,
|
||||
),
|
||||
AddFont(gfx_traits::FontData, Sender<webrender_api::FontKey>),
|
||||
|
|
|
@ -182,10 +182,13 @@ impl FontCache {
|
|||
Command::GetFontInstance(font_key, size, result) => {
|
||||
let webrender_api = &self.webrender_api;
|
||||
|
||||
let instance_key = *self
|
||||
.font_instances
|
||||
.entry((font_key, size))
|
||||
.or_insert_with(|| webrender_api.add_font_instance(font_key, size));
|
||||
let instance_key =
|
||||
*self
|
||||
.font_instances
|
||||
.entry((font_key, size))
|
||||
.or_insert_with(|| {
|
||||
webrender_api.add_font_instance(font_key, size.to_f32_px())
|
||||
});
|
||||
|
||||
let _ = result.send(instance_key);
|
||||
},
|
||||
|
|
|
@ -11,7 +11,6 @@ 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" }
|
||||
|
|
|
@ -113,7 +113,7 @@ pub trait WebrenderApi {
|
|||
fn add_font_instance(
|
||||
&self,
|
||||
font_key: webrender_api::FontKey,
|
||||
size: app_units::Au,
|
||||
size: f32,
|
||||
) -> webrender_api::FontInstanceKey;
|
||||
fn add_font(&self, data: FontData) -> webrender_api::FontKey;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,6 @@ webrender_debugger = ["webrender/debugger"]
|
|||
xr-profile = ["canvas/xr-profile", "canvas_traits/xr-profile", "script/xr-profile", "webxr/profile"]
|
||||
|
||||
[dependencies]
|
||||
app_units = "0.7"
|
||||
background_hang_monitor = { path = "../background_hang_monitor" }
|
||||
bluetooth = { path = "../bluetooth" }
|
||||
bluetooth_traits = { path = "../bluetooth_traits" }
|
||||
|
|
|
@ -928,7 +928,7 @@ impl gfx_traits::WebrenderApi for FontCacheWR {
|
|||
fn add_font_instance(
|
||||
&self,
|
||||
font_key: webrender_api::FontKey,
|
||||
size: app_units::Au,
|
||||
size: f32,
|
||||
) -> webrender_api::FontInstanceKey {
|
||||
let (sender, receiver) = unbounded();
|
||||
let _ = self.0.send(Msg::Webrender(WebrenderMsg::Font(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue