summaryrefslogtreecommitdiffstats
path: root/tiny_skia/src
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-03-07 23:39:55 +0100
committerLibravatar GitHub <noreply@github.com>2024-03-07 23:39:55 +0100
commit2074757cdc65ec16eeb1c7a12a5ff3bb5ed00859 (patch)
tree43ea058c8b7d0b4a13f9fe3ad7015efeea94ed48 /tiny_skia/src
parent1bb5a1b9a23e1c4739430ac87ca33b06c2f4d9df (diff)
parentecf42b97df85df25b1b825f37adfeb00f658f6ee (diff)
downloadiced-2074757cdc65ec16eeb1c7a12a5ff3bb5ed00859.tar.gz
iced-2074757cdc65ec16eeb1c7a12a5ff3bb5ed00859.tar.bz2
iced-2074757cdc65ec16eeb1c7a12a5ff3bb5ed00859.zip
Merge pull request #2313 from iced-rs/fix/wasm-block-on
Fix `block_on` in `iced_wgpu` hanging Wasm builds
Diffstat (limited to 'tiny_skia/src')
-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 {