Files
servo/components/compositing/lib.rs
Martin Robinson 824f551f03 Rename IOCompositor to Paint (#41176)
For a long time, the "Compositor" hasn't done any compositing. This is
handled by WebRender. In addition the "Compositor" does many other
tasks. This change renames `IOCompositor` to `Paint`.

`Paint` is Servo's paint subsystem and contains multiple `Painter`s.
This change does not rename the crate; that will be done in a
followup change.

Testing: This just renames types and updates comments, so no new tests
are necessary.

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-12-10 15:09:49 +00:00

58 lines
1.9 KiB
Rust

/* 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/. */
#![deny(unsafe_code)]
use std::cell::Cell;
use std::rc::Rc;
use base::generic_channel::RoutedReceiver;
use compositing_traits::{PaintMessage, PaintProxy};
use constellation_traits::EmbedderToConstellationMessage;
use crossbeam_channel::Sender;
use embedder_traits::{EventLoopWaker, ShutdownState};
use profile_traits::{mem, time};
#[cfg(feature = "webxr")]
use webxr::WebXrRegistry;
pub use crate::paint::{Paint, WebRenderDebugOption};
#[macro_use]
mod tracing;
mod largest_contentful_paint_calculator;
mod paint;
mod painter;
mod pinch_zoom;
mod pipeline_details;
mod refresh_driver;
mod render_notifier;
mod screenshot;
mod touch;
mod webrender_external_images;
mod webview_renderer;
/// Data used to initialize the `Paint` subsystem.
pub struct InitialPaintState {
/// A channel to `Paint`.
pub paint_proxy: PaintProxy,
/// A port on which messages inbound to `Paint` can be received.
pub receiver: RoutedReceiver<PaintMessage>,
/// A channel to the constellation.
pub embedder_to_constellation_sender: Sender<EmbedderToConstellationMessage>,
/// A channel to the time profiler thread.
pub time_profiler_chan: time::ProfilerChan,
/// A channel to the memory profiler thread.
pub mem_profiler_chan: mem::ProfilerChan,
/// A shared state which tracks whether Servo has started or has finished
/// shutting down.
pub shutdown_state: Rc<Cell<ShutdownState>>,
/// An [`EventLoopWaker`] used in order to wake up the embedder when it is
/// time to paint.
pub event_loop_waker: Box<dyn EventLoopWaker>,
/// If WebXR is enabled, a [`WebXrRegistry`] to register WebXR threads.
#[cfg(feature = "webxr")]
pub webxr_registry: Box<dyn WebXrRegistry>,
}