@@ -8,7 +8,7 @@ use dyn_any::{DynAny, StaticType};
88use gpu_executor:: { ComputePassDimensions , GPUConstant , StorageBufferOptions , TextureBufferOptions , TextureBufferType , ToStorageBuffer , ToUniformBuffer } ;
99use graphene_core:: application_io:: { ApplicationIo , EditorApi , SurfaceHandle } ;
1010use graphene_core:: transform:: { Footprint , Transform } ;
11- use graphene_core:: { Cow , Node , SurfaceFrame , Type } ;
11+ use graphene_core:: { Color , Cow , Node , SurfaceFrame , Type } ;
1212
1313use anyhow:: { bail, Result } ;
1414use futures:: Future ;
@@ -133,7 +133,7 @@ pub use graphene_core::renderer::RenderContext;
133133// }
134134
135135impl WgpuExecutor {
136- pub async fn render_vello_scene ( & self , scene : & Scene , surface : & WgpuSurface , width : u32 , height : u32 , context : & RenderContext ) -> Result < ( ) > {
136+ pub async fn render_vello_scene ( & self , scene : & Scene , surface : & WgpuSurface , width : u32 , height : u32 , context : & RenderContext , background : Color ) -> Result < ( ) > {
137137 let surface = & surface. surface . inner ;
138138 let surface_caps = surface. get_capabilities ( & self . context . adapter ) ;
139139 surface. configure (
@@ -151,13 +151,14 @@ impl WgpuExecutor {
151151 ) ;
152152 let surface_texture = surface. get_current_texture ( ) ?;
153153
154+ let [ r, g, b, _] = background. to_rgba8_srgb ( ) ;
154155 let render_params = RenderParams {
155156 // We are using an explicit opaque color here to eliminate the alpha premultiplication step
156157 // which would be required to support a transparent webgpu canvas
157- base_color : vello:: peniko:: Color :: from_rgba8 ( 0x22 , 0x22 , 0x22 , 0xff ) ,
158+ base_color : vello:: peniko:: Color :: from_rgba8 ( r , g , b , 0xff ) ,
158159 width,
159160 height,
160- antialiasing_method : AaConfig :: Msaa8 ,
161+ antialiasing_method : AaConfig :: Msaa16 ,
161162 } ;
162163
163164 {
0 commit comments