aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-05-17 14:28:58 +0200
committerGitHub <noreply@github.com>2024-05-17 12:28:58 +0000
commit3398fc017b994fff113342baab47718a44a37752 (patch)
tree9ec5881db059b0bda7d374ad4d0abe96319e5c25 /components/servo
parent1017533297889beca40be5f121629347963fbf27 (diff)
downloadservo-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')
-rw-r--r--components/servo/Cargo.toml2
-rw-r--r--components/servo/lib.rs13
2 files changed, 8 insertions, 7 deletions
diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml
index c0f3555b1c2..18181c40e30 100644
--- a/components/servo/Cargo.toml
+++ b/components/servo/Cargo.toml
@@ -34,6 +34,7 @@ xr-profile = ["canvas/xr-profile", "canvas_traits/xr-profile", "script/xr-profil
[dependencies]
background_hang_monitor = { path = "../background_hang_monitor" }
+base = { workspace = true }
bluetooth = { path = "../bluetooth" }
bluetooth_traits = { workspace = true }
canvas = { path = "../canvas", default-features = false }
@@ -58,7 +59,6 @@ layout_thread_2020 = { path = "../layout_thread_2020" }
log = { workspace = true }
media = { path = "../media" }
mozangle = { workspace = true }
-msg = { workspace = true }
net = { path = "../net" }
net_traits = { workspace = true }
profile = { path = "../profile" }
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,