From ecf42b97df85df25b1b825f37adfeb00f658f6ee Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Thu, 7 Mar 2024 23:25:24 +0100 Subject: Fix `block_on` in `iced_wgpu` hanging Wasm builds --- tiny_skia/src/window/compositor.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tiny_skia') diff --git a/tiny_skia/src/window/compositor.rs b/tiny_skia/src/window/compositor.rs index 21ccf620..a98825f1 100644 --- a/tiny_skia/src/window/compositor.rs +++ b/tiny_skia/src/window/compositor.rs @@ -5,6 +5,7 @@ use crate::graphics::{Error, Viewport}; use crate::{Backend, Primitive, Renderer, Settings}; use std::collections::VecDeque; +use std::future::{self, Future}; use std::num::NonZeroU32; pub struct Compositor { @@ -31,8 +32,8 @@ impl crate::graphics::Compositor for Compositor { fn new( settings: Self::Settings, compatible_window: W, - ) -> Result { - Ok(new(settings, compatible_window)) + ) -> impl Future> { + future::ready(Ok(new(settings, compatible_window))) } fn create_renderer(&self) -> Self::Renderer { -- cgit