Fix block_on in iced_wgpu hanging Wasm builds

This commit is contained in:
Héctor Ramón Jiménez 2024-03-07 23:25:24 +01:00
parent 1bb5a1b9a2
commit ecf42b97df
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
8 changed files with 53 additions and 30 deletions

View file

@ -6,6 +6,7 @@ use crate::core::Color;
use crate::futures::{MaybeSend, MaybeSync};
use raw_window_handle::{HasDisplayHandle, HasWindowHandle};
use std::future::Future;
use thiserror::Error;
/// A graphics compositor that can draw to windows.
@ -23,7 +24,7 @@ pub trait Compositor: Sized {
fn new<W: Window + Clone>(
settings: Self::Settings,
compatible_window: W,
) -> Result<Self, Error>;
) -> impl Future<Output = Result<Self, Error>>;
/// Creates a [`Self::Renderer`] for the [`Compositor`].
fn create_renderer(&self) -> Self::Renderer;