Files
servo/components/compositing/render_notifier.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

47 lines
1.3 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/. */
use base::id::PainterId;
use compositing_traits::{PaintMessage, PaintProxy};
use webrender_api::{DocumentId, FramePublishId, FrameReadyParams};
#[derive(Clone)]
pub(crate) struct RenderNotifier {
painter_id: PainterId,
paint_proxy: PaintProxy,
}
impl RenderNotifier {
pub(crate) fn new(painter_id: PainterId, paint_proxy: PaintProxy) -> RenderNotifier {
RenderNotifier {
painter_id,
paint_proxy,
}
}
}
impl webrender_api::RenderNotifier for RenderNotifier {
fn clone(&self) -> Box<dyn webrender_api::RenderNotifier> {
Box::new(RenderNotifier::new(
self.painter_id,
self.paint_proxy.clone(),
))
}
fn wake_up(&self, _composite_needed: bool) {}
fn new_frame_ready(
&self,
document_id: DocumentId,
_: FramePublishId,
frame_ready_params: &FrameReadyParams,
) {
self.paint_proxy.send(PaintMessage::NewWebRenderFrameReady(
self.painter_id,
document_id,
frame_ready_params.render,
));
}
}