Draft multi-threaded image rendering in iced_wgpu
This commit is contained in:
parent
92888a3639
commit
cb8d2710da
22 changed files with 886 additions and 305 deletions
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue