diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-07-10 15:54:39 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-07-10 17:35:50 +0200 |
commit | 3230162fd0ac96dea77c683b2067ae65ec7ed0b4 (patch) | |
tree | a514617f5d3b72eb5e00cf60b86d8478de9b0e02 /components/gfx_traits | |
parent | 1543912589e67734f0b684e1db900f41a4c04a1a (diff) | |
download | servo-3230162fd0ac96dea77c683b2067ae65ec7ed0b4.tar.gz servo-3230162fd0ac96dea77c683b2067ae65ec7ed0b4.zip |
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.
Diffstat (limited to 'components/gfx_traits')
-rw-r--r-- | components/gfx_traits/lib.rs | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/components/gfx_traits/lib.rs b/components/gfx_traits/lib.rs index a7fae65f87e..a20c5a0c34c 100644 --- a/components/gfx_traits/lib.rs +++ b/components/gfx_traits/lib.rs @@ -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; } |