mirror of
https://github.com/servo/servo
synced 2026-05-11 01:22:19 +02:00
This change finishes the big rename associated with the old `compositing` crates. Long ago, these crates managed a compositor, like you might find in a traditional web engine. These days, compositing is done in WebRender so the name has stopped making much sense. Various structs inside the crates have already been renamed and this is the final big change necessary for the rename Testing: This is just a rename so existing tests should cover it. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
47 lines
1.3 KiB
Rust
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 paint_api::{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,
|
|
));
|
|
}
|
|
}
|