@@ -3,19 +3,20 @@ mod context;
33use anyhow:: Result ;
44pub use context:: Context ;
55use dyn_any:: StaticType ;
6+ use futures:: lock:: Mutex ;
67use glam:: UVec2 ;
78use graphene_application_io:: { ApplicationIo , EditorApi , SurfaceHandle , SurfaceId } ;
89use graphene_core:: { Color , Ctx } ;
910pub use graphene_svg_renderer:: RenderContext ;
10- use std:: sync:: { Arc , Mutex } ;
11+ use std:: sync:: Arc ;
1112use vello:: { AaConfig , AaSupport , RenderParams , Renderer , RendererOptions , Scene } ;
1213use wgpu:: util:: TextureBlitter ;
1314use wgpu:: { Origin3d , SurfaceConfiguration , TextureAspect } ;
1415
1516#[ derive( dyn_any:: DynAny ) ]
1617pub struct WgpuExecutor {
1718 pub context : Context ,
18- vello_renderer : futures :: lock :: Mutex < Renderer > ,
19+ vello_renderer : Mutex < Renderer > ,
1920}
2021
2122impl std:: fmt:: Debug for WgpuExecutor {
@@ -57,7 +58,7 @@ const VELLO_SURFACE_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Rgba8Unor
5758
5859impl WgpuExecutor {
5960 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 ;
6162 let target_texture = if let Some ( target_texture) = & * guard
6263 && target_texture. size == size
6364 {
0 commit comments