Skip to content

Rename IOCompositor to Paint#41176

Merged
mrobinson merged 2 commits intoservo:mainfrom
mrobinson:rename-paint
Dec 10, 2025
Merged

Rename IOCompositor to Paint#41176
mrobinson merged 2 commits intoservo:mainfrom
mrobinson:rename-paint

Conversation

@mrobinson
Copy link
Copy Markdown
Member

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 Painters.
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.

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.

Signed-off-by: Martin Robinson <[email protected]>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 10, 2025
/// Once the frame is ready the [`Painter`] for the WebRender instance will ask libservo
/// to inform the embedder that a new frame is ready so that it can trigger a paint.
/// 3. Drive animation and animation callback updates. Animation updates should ideally be
/// coordinated with the system vscync signal, so the `RefreshDriver` is exposed in the
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// coordinated with the system vscync signal, so the `RefreshDriver` is exposed in the
/// coordinated with the system vsync signal, so the `RefreshDriver` is exposed in the

);
let _span =
profile_traits::trace_span!("ScriptToCompositorMsg::BuiltDisplayList",).entered();
let _span = profile_traits::trace_span!("PaintMessage::BuiltDisplayList",).entered();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let _span = profile_traits::trace_span!("PaintMessage::BuiltDisplayList",).entered();
let _span = profile_traits::trace_span!("PaintMessage::SendDisplayList",).entered();

PaintMessage doesn't have a BuiltDisplayList variant.

//!
//! * The script thread.
//! * The graphics compositor.
//! * The `Paint` subsystem, which runs in the embedder main thread.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//! * The `Paint` subsystem, which runs in the embedder main thread.
//! * The `Paint` subsystem, which runs in the embedder's main thread.

Copy link
Copy Markdown
Member

@mukilan mukilan Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think on Android and OHOS we don't run the compositor on the main thread.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've modified this to read The Paintsubsystem, which runs in the same thread as theServo instance..

// Do not handle events if the BC has been, or is being, discarded
if document.window().Closed() {
warn!("Compositor event sent to a pipeline with a closed window {pipeline_id}.");
warn!("Paint event sent to a pipeline with a closed window {pipeline_id}.");
Copy link
Copy Markdown
Member

@mukilan mukilan Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
warn!("Paint event sent to a pipeline with a closed window {pipeline_id}.");
warn!("Input event sent to a pipeline with a closed window {pipeline_id}.");

"Paint event" doesn't match the change to the method's documentation.

) {
let Some(document) = self.documents.borrow().find_document(pipeline_id) else {
warn!("Compositor event sent to closed pipeline {pipeline_id}.");
warn!("Paint event sent to closed pipeline {pipeline_id}.");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
warn!("Paint event sent to closed pipeline {pipeline_id}.");
warn!("Input event sent to closed pipeline {pipeline_id}.");


/// A tree of spatial nodes, which mirrors the spatial nodes in the WebRender
/// display list, except these are used to scrolling in the compositor so that
/// display list, except these are used to scrolling in `Paint` so that
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// display list, except these are used to scrolling in `Paint` so that
/// display list, except these are used for scrolling in `Paint` so that

/// [`CrossProcessCompositorApi`] for communicating with the compositor.
pub compositor_api: CrossProcessCompositorApi,
/// [`CrossProcessPaintApi`] for communicating with `Paint`.
pub paint_aip: CrossProcessPaintApi,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub paint_aip: CrossProcessPaintApi,
pub paint_api: CrossProcessPaintApi,

/// `Paint` is rasterising or presenting.
///
/// Not associated with a specific URL.
Compositing = 0x00,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Compositing = 0x00,
Painting = 0x00,

Not sure if this enum variant needs a rename or you plan to address it in a subsequent patch.

@mrobinson
Copy link
Copy Markdown
Member Author

@mukilan Thanks for the review. I think I've addressed all your comments.

pub const fn variant_name(&self) -> &'static str {
match self {
ProfilerCategory::Compositing => "Compositing",
ProfilerCategory::Painting => "Compositing",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ProfilerCategory::Painting => "Compositing",
ProfilerCategory::Painting => "Painting",

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Dec 10, 2025
Signed-off-by: Martin Robinson <[email protected]>
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 10, 2025
@mrobinson mrobinson enabled auto-merge December 10, 2025 14:19
@mrobinson mrobinson added this pull request to the merge queue Dec 10, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 10, 2025
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Dec 10, 2025
@mrobinson mrobinson added this pull request to the merge queue Dec 10, 2025
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Dec 10, 2025
Merged via the queue into servo:main with commit 824f551 Dec 10, 2025
38 checks passed
@mrobinson mrobinson deleted the rename-paint branch December 10, 2025 17:00
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants