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>
This commit is contained in:
Martin Robinson 2025-04-17 13:00:55 +02:00 committed by GitHub
parent 95ee5708fa
commit d345844ed7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 17 additions and 23 deletions

View file

@ -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

View file

@ -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 {

View file

@ -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,
}

View file

@ -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};

View file

@ -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

View file

@ -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;