@@ -3,19 +3,20 @@ mod context;
3
3
use anyhow:: Result ;
4
4
pub use context:: Context ;
5
5
use dyn_any:: StaticType ;
6
+ use futures:: lock:: Mutex ;
6
7
use glam:: UVec2 ;
7
8
use graphene_application_io:: { ApplicationIo , EditorApi , SurfaceHandle , SurfaceId } ;
8
9
use graphene_core:: { Color , Ctx } ;
9
10
pub use graphene_svg_renderer:: RenderContext ;
10
- use std:: sync:: { Arc , Mutex } ;
11
+ use std:: sync:: Arc ;
11
12
use vello:: { AaConfig , AaSupport , RenderParams , Renderer , RendererOptions , Scene } ;
12
13
use wgpu:: util:: TextureBlitter ;
13
14
use wgpu:: { Origin3d , SurfaceConfiguration , TextureAspect } ;
14
15
15
16
#[ derive( dyn_any:: DynAny ) ]
16
17
pub struct WgpuExecutor {
17
18
pub context : Context ,
18
- vello_renderer : futures :: lock :: Mutex < Renderer > ,
19
+ vello_renderer : Mutex < Renderer > ,
19
20
}
20
21
21
22
impl std:: fmt:: Debug for WgpuExecutor {
@@ -57,7 +58,7 @@ const VELLO_SURFACE_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Rgba8Unor
57
58
58
59
impl WgpuExecutor {
59
60
pub async fn render_vello_scene ( & self , scene : & Scene , surface : & WgpuSurface , size : UVec2 , context : & RenderContext , background : Color ) -> Result < ( ) > {
60
- let mut guard = surface. surface . target_texture . lock ( ) . unwrap ( ) ;
61
+ let mut guard = surface. surface . target_texture . lock ( ) . await ;
61
62
let target_texture = if let Some ( target_texture) = & * guard
62
63
&& target_texture. size == size
63
64
{
0 commit comments