mirror of
https://github.com/servo/servo.git
synced 2025-08-18 03:45:33 +01:00
Try to use
WebRender types more
The newer versions of WebRender move types around between `webrender` and `webrender_api` and this will reduce the churn during the upgrade.
This commit is contained in:
parent
1543912589
commit
3230162fd0
39 changed files with 330 additions and 327 deletions
|
@ -17,6 +17,7 @@ pub mod print_tree;
|
|||
|
||||
use range::RangeIndex;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use webrender_api::{Epoch as WebRenderEpoch, FontInstanceKey, FontKey, NativeFontHandle};
|
||||
|
||||
/// A newtype struct for denoting the age of messages; prevents race conditions.
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
|
||||
|
@ -28,9 +29,9 @@ impl Epoch {
|
|||
}
|
||||
}
|
||||
|
||||
impl Into<webrender_api::Epoch> for Epoch {
|
||||
fn into(self) -> webrender_api::Epoch {
|
||||
webrender_api::Epoch(self.0)
|
||||
impl Into<WebRenderEpoch> for Epoch {
|
||||
fn into(self) -> WebRenderEpoch {
|
||||
WebRenderEpoch(self.0)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -112,14 +113,10 @@ pub fn node_id_from_scroll_id(id: usize) -> Option<usize> {
|
|||
|
||||
pub enum FontData {
|
||||
Raw(Vec<u8>),
|
||||
Native(webrender_api::NativeFontHandle),
|
||||
Native(NativeFontHandle),
|
||||
}
|
||||
|
||||
pub trait WebrenderApi {
|
||||
fn add_font_instance(
|
||||
&self,
|
||||
font_key: webrender_api::FontKey,
|
||||
size: f32,
|
||||
) -> webrender_api::FontInstanceKey;
|
||||
fn add_font(&self, data: FontData) -> webrender_api::FontKey;
|
||||
fn add_font_instance(&self, font_key: FontKey, size: f32) -> FontInstanceKey;
|
||||
fn add_font(&self, data: FontData) -> FontKey;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue