summaryrefslogtreecommitdiffstats
path: root/tiny_skia
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-07 23:25:24 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-03-07 23:25:24 +0100
commitecf42b97df85df25b1b825f37adfeb00f658f6ee (patch)
tree43ea058c8b7d0b4a13f9fe3ad7015efeea94ed48 /tiny_skia
parent1bb5a1b9a23e1c4739430ac87ca33b06c2f4d9df (diff)
downloadiced-ecf42b97df85df25b1b825f37adfeb00f658f6ee.tar.gz
iced-ecf42b97df85df25b1b825f37adfeb00f658f6ee.tar.bz2
iced-ecf42b97df85df25b1b825f37adfeb00f658f6ee.zip
Fix `block_on` in `iced_wgpu` hanging Wasm builds
Diffstat (limited to 'tiny_skia')
-rw-r--r--tiny_skia/src/window/compositor.rs5
1 files changed, 3 insertions, 2 deletions
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<W: compositor::Window>(
settings: Self::Settings,
compatible_window: W,
- ) -> Result<Self, Error> {
- Ok(new(settings, compatible_window))
+ ) -> impl Future<Output = Result<Self, Error>> {
+ future::ready(Ok(new(settings, compatible_window)))
}
fn create_renderer(&self) -> Self::Renderer {