diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-04-17 13:00:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-17 11:00:55 +0000 |
commit | d345844ed715fb96286808da8a5fc81f1bb22447 (patch) | |
tree | 61abb2b6b7ba97849d02e601f7dc3e6f56919074 | |
parent | 95ee5708fa432a2903d39c40df5e38ff435f30c1 (diff) | |
download | servo-d345844ed715fb96286808da8a5fc81f1bb22447.tar.gz servo-d345844ed715fb96286808da8a5fc81f1bb22447.zip |
compositing: Remove `windowing.rs` and making `compositing` private (#36582)
This file used to contain the `EmbedderDelegate` and `WindowMethods`
traits, but these are gone now, so we can move the one remaining enum
to be in `compositor.rs` where it is used. This change also stops
exposing the `compositing` crate as public Servo API.
Testing: This does not change behavior so is covered by existing tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
-rw-r--r-- | components/compositing/compositor.rs | 9 | ||||
-rw-r--r-- | components/compositing/lib.rs | 3 | ||||
-rw-r--r-- | components/compositing/windowing.rs | 11 | ||||
-rw-r--r-- | components/servo/lib.rs | 9 | ||||
-rw-r--r-- | components/servo/webview.rs | 3 | ||||
-rw-r--r-- | ports/servoshell/desktop/headed_window.rs | 5 |
6 files changed, 17 insertions, 23 deletions
diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 53debad39d6..098b22a2b68 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -56,7 +56,6 @@ use webrender_api::{ use crate::InitialCompositorState; use crate::webview::{UnknownWebView, WebView}; use crate::webview_manager::WebViewManager; -use crate::windowing::WebRenderDebugOption; #[derive(Debug, PartialEq)] enum UnableToComposite { @@ -78,6 +77,14 @@ enum ReadyState { WaitingForConstellationReply, ReadyToSaveImage, } + +/// An option to control what kind of WebRender debugging is enabled while Servo is running. +#[derive(Clone)] +pub enum WebRenderDebugOption { + Profiler, + TextureCacheDebug, + RenderTargetDebug, +} /// Data that is shared by all WebView renderers. pub struct ServoRenderer { /// This is a temporary map between [`PipelineId`]s and their associated [`WebViewId`]. Once diff --git a/components/compositing/lib.rs b/components/compositing/lib.rs index 8631b63076a..65bd18929e1 100644 --- a/components/compositing/lib.rs +++ b/components/compositing/lib.rs @@ -16,7 +16,7 @@ use profile_traits::{mem, time}; use webrender::RenderApi; use webrender_api::DocumentId; -pub use crate::compositor::IOCompositor; +pub use crate::compositor::{IOCompositor, WebRenderDebugOption}; #[macro_use] mod tracing; @@ -25,7 +25,6 @@ mod compositor; mod touch; pub mod webview; pub mod webview_manager; -pub mod windowing; /// Data used to construct a compositor. pub struct InitialCompositorState { diff --git a/components/compositing/windowing.rs b/components/compositing/windowing.rs deleted file mode 100644 index e047e54b276..00000000000 --- a/components/compositing/windowing.rs +++ /dev/null @@ -1,11 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ - -/// Various debug and profiling flags that WebRender supports. -#[derive(Clone)] -pub enum WebRenderDebugOption { - Profiler, - TextureCacheDebug, - RenderTargetDebug, -} diff --git a/components/servo/lib.rs b/components/servo/lib.rs index b8f72554ba5..eea9f414dfe 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -42,6 +42,7 @@ use canvas::WebGLComm; use canvas::canvas_paint_thread::CanvasPaintThread; use canvas_traits::webgl::{GlType, WebGLThreads}; use clipboard_delegate::StringRequest; +pub use compositing::WebRenderDebugOption; use compositing::{IOCompositor, InitialCompositorState}; pub use compositing_traits::rendering_context::{ OffscreenRenderingContext, RenderingContext, SoftwareRenderingContext, WindowRenderingContext, @@ -107,10 +108,10 @@ use webview::WebViewInner; #[cfg(feature = "webxr")] pub use webxr; pub use { - background_hang_monitor, base, canvas, canvas_traits, compositing, devtools, devtools_traits, - euclid, fonts, ipc_channel, 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, style, style_traits, webrender_api, + background_hang_monitor, base, canvas, canvas_traits, devtools, devtools_traits, euclid, fonts, + ipc_channel, 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, style, style_traits, webrender_api, }; #[cfg(feature = "bluetooth")] pub use {bluetooth, bluetooth_traits}; diff --git a/components/servo/webview.rs b/components/servo/webview.rs index fb4ba6cc136..f4bf13e3a7e 100644 --- a/components/servo/webview.rs +++ b/components/servo/webview.rs @@ -9,7 +9,6 @@ use std::time::Duration; use base::id::WebViewId; use compositing::IOCompositor; -use compositing::windowing::WebRenderDebugOption; use compositing_traits::RendererWebView; use constellation_traits::{EmbedderToConstellationMessage, TraversalDirection}; use dpi::PhysicalSize; @@ -25,7 +24,7 @@ use webrender_api::units::{DeviceIntPoint, DevicePixel, DeviceRect}; use crate::clipboard_delegate::{ClipboardDelegate, DefaultClipboardDelegate}; use crate::webview_delegate::{DefaultWebViewDelegate, WebViewDelegate}; -use crate::{ConstellationProxy, Servo}; +use crate::{ConstellationProxy, Servo, WebRenderDebugOption}; /// A handle to a Servo webview. If you clone this handle, it does not create a new webview, /// but instead creates a new handle to the webview. Once the last handle is dropped, Servo diff --git a/ports/servoshell/desktop/headed_window.rs b/ports/servoshell/desktop/headed_window.rs index 2e38d2eed30..a529aa83c02 100644 --- a/ports/servoshell/desktop/headed_window.rs +++ b/ports/servoshell/desktop/headed_window.rs @@ -14,7 +14,6 @@ use euclid::{Angle, Length, Point2D, Rotation3D, Scale, Size2D, UnknownUnit, Vec use keyboard_types::{Modifiers, ShortcutMatcher}; use log::{debug, info}; use raw_window_handle::{HasDisplayHandle, HasWindowHandle, RawWindowHandle}; -use servo::compositing::windowing::WebRenderDebugOption; use servo::servo_config::pref; use servo::servo_geometry::DeviceIndependentPixel; use servo::webrender_api::ScrollLocation; @@ -22,8 +21,8 @@ use servo::webrender_api::units::{DeviceIntPoint, DeviceIntSize, DevicePixel}; use servo::{ Cursor, ImeEvent, InputEvent, Key, KeyState, KeyboardEvent, MouseButton as ServoMouseButton, MouseButtonAction, MouseButtonEvent, MouseMoveEvent, OffscreenRenderingContext, - RenderingContext, ScreenGeometry, Theme, TouchEvent, TouchEventType, TouchId, WebView, - WheelDelta, WheelEvent, WheelMode, WindowRenderingContext, + RenderingContext, ScreenGeometry, Theme, TouchEvent, TouchEventType, TouchId, + WebRenderDebugOption, WebView, WheelDelta, WheelEvent, WheelMode, WindowRenderingContext, }; use surfman::{Context, Device}; use url::Url; |