diff options
author | Martin Robinson <mrobinson@igalia.com> | 2024-05-17 14:28:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-17 12:28:58 +0000 |
commit | 3398fc017b994fff113342baab47718a44a37752 (patch) | |
tree | 9ec5881db059b0bda7d374ad4d0abe96319e5c25 /components/servo/lib.rs | |
parent | 1017533297889beca40be5f121629347963fbf27 (diff) | |
download | servo-3398fc017b994fff113342baab47718a44a37752.tar.gz servo-3398fc017b994fff113342baab47718a44a37752.zip |
Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)
For a long time, `gfx_traits` has held a lot of things unrelated to graphics
and also unrelated to the `gfx` crate (which is mostly about fonts).
This is a cleanup which does a few things:
1. Move non `gfx` crate things out of `gfx_traits`. This is important in
order to prevent dependency cycles with a different integration between
layout, script, and fonts.
2. Rename the `msg` crate to `base`. It didn't really contain anything
to do with messages and instead mostly holds ids, which are used
across many different crates in Servo. This new crate will hold the
*rare* data types that are widely used.
Details:
- All BackgroundHangMonitor-related things from base to a new
`background_hang_monitor_api` crate.
- Moved `TraversalDirection` to `script_traits`
- Moved `Epoch`-related things from `gfx_traits` to `base`.
- Moved `PrintTree` to base. This should be widely useful in Servo.
- Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it
to `WebRenderFontApi`.
Diffstat (limited to 'components/servo/lib.rs')
-rw-r--r-- | components/servo/lib.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 17b3541ee52..fc15c830100 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -25,6 +25,8 @@ use std::rc::Rc; use std::sync::{Arc, Mutex}; use std::vec::Drain; +pub use base::id::TopLevelBrowsingContextId; +use base::id::{PipelineNamespace, PipelineNamespaceId}; use bluetooth::BluetoothThreadFactory; use bluetooth_traits::BluetoothRequest; use canvas::canvas_paint_thread::{self, CanvasPaintThread}; @@ -70,8 +72,6 @@ pub use gleam::gl; use ipc_channel::ipc::{self, IpcSender}; use log::{error, trace, warn, Log, Metadata, Record}; use media::{GLPlayerThreads, GlApi, NativeDisplay, WindowGLContext}; -pub use msg::constellation_msg::TopLevelBrowsingContextId; -use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId}; use net::resource_thread::new_resource_threads; use net_traits::IpcSend; use profile::{mem as profile_mem, time as profile_time}; @@ -96,12 +96,13 @@ use webrender_api::{ NativeFontHandle, }; use webrender_traits::{ - WebrenderExternalImageHandlers, WebrenderExternalImageRegistry, WebrenderImageHandlerType, + WebRenderFontApi, WebrenderExternalImageHandlers, WebrenderExternalImageRegistry, + WebrenderImageHandlerType, }; pub use { - background_hang_monitor, bluetooth, bluetooth_traits, canvas, canvas_traits, compositing, + background_hang_monitor, base, bluetooth, bluetooth_traits, canvas, canvas_traits, compositing, constellation, devtools, devtools_traits, embedder_traits, euclid, gfx, ipc_channel, - keyboard_types, layout_thread_2013, layout_thread_2020, media, msg, net, net_traits, profile, + keyboard_types, layout_thread_2013, layout_thread_2020, media, net, net_traits, profile, profile_traits, script, script_layout_interface, script_traits, servo_config as config, servo_config, servo_geometry, servo_url as url, servo_url, style, style_traits, webgpu, webrender_api, webrender_traits, @@ -1051,7 +1052,7 @@ fn create_constellation( struct FontCacheWR(CompositorProxy); -impl gfx_traits::WebrenderApi for FontCacheWR { +impl WebRenderFontApi for FontCacheWR { fn add_font_instance( &self, font_key: FontKey, |