/
githubmirror
/
servo
Обзор
Документация
Войти
/
githubmirror
/
servo
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
components/paint/render_notifier.rs
46 строк
1 KB
Euclid Ye
cargo: Rename workspace-local library starting with b to `servo_*` (#43552)
23 мар 2026, 11:26
Не верифицирован
23 мар 2026, 11:26
cae0752
Код
Авторство
О чём код?
/* 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 paint_api::{PaintMessage, PaintProxy}; use servo_base::id::PainterId; 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, )); } }