Draft multi-threaded image rendering in iced_wgpu

This commit is contained in:
Héctor Ramón Jiménez 2025-10-24 17:23:40 +02:00
parent 92888a3639
commit cb8d2710da
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
22 changed files with 886 additions and 305 deletions

View file

@ -4,7 +4,9 @@ use crate::futures::futures::{
select,
task::{Context, Poll},
};
use crate::graphics::shell;
use crate::runtime::Action;
use crate::runtime::window;
use std::pin::Pin;
/// An event loop proxy with backpressure that implements `Sink`.
@ -134,3 +136,16 @@ impl<T: 'static> Sink<Action<T>> for Proxy<T> {
Poll::Ready(Ok(()))
}
}
impl<T> shell::Notifier for Proxy<T>
where
T: Send,
{
fn request_redraw(&self) {
self.send_action(Action::Window(window::Action::RedrawAll));
}
fn invalidate_layout(&self) {
self.send_action(Action::Window(window::Action::RelayoutAll));
}
}