diff --git a/piet-wgsl/src/engine.rs b/piet-wgsl/src/engine.rs index 5e89905..9a3556c 100644 --- a/piet-wgsl/src/engine.rs +++ b/piet-wgsl/src/engine.rs @@ -305,7 +305,12 @@ impl Recording { buf_proxy } - pub fn upload_image(&mut self, width: u32, height: u32, data: impl Into>) -> ImageProxy { + pub fn upload_image( + &mut self, + width: u32, + height: u32, + data: impl Into>, + ) -> ImageProxy { let data = data.into(); let image_proxy = ImageProxy::new(width, height); self.push(Command::UploadImage(image_proxy, data)); diff --git a/piet-wgsl/src/render.rs b/piet-wgsl/src/render.rs index 4cc63e3..4550927 100644 --- a/piet-wgsl/src/render.rs +++ b/piet-wgsl/src/render.rs @@ -143,7 +143,12 @@ pub fn render_full(scene: &Scene, shaders: &FullShaders) -> (Recording, BufProxy let width = ramps.width(); let height = ramps.height(); let data: &[u8] = bytemuck::cast_slice(data); - println!("gradient image: {}x{} ({} bytes)", width, height, data.len()); + println!( + "gradient image: {}x{} ({} bytes)", + width, + height, + data.len() + ); ResourceProxy::Image(recording.upload_image(width, height, data)) }; let n_pathtag = data.tag_stream.len(); diff --git a/piet-wgsl/src/test_scene.rs b/piet-wgsl/src/test_scene.rs index cdbd467..bb6f7ad 100644 --- a/piet-wgsl/src/test_scene.rs +++ b/piet-wgsl/src/test_scene.rs @@ -15,7 +15,10 @@ // Also licensed under MIT license, at your choice. use kurbo::BezPath; -use piet_scene::{Affine, Brush, Color, Fill, LinearGradient, PathElement, Point, Scene, SceneBuilder, Stroke, GradientStop}; +use piet_scene::{ + Affine, Brush, Color, Fill, GradientStop, LinearGradient, PathElement, Point, Scene, + SceneBuilder, Stroke, +}; use crate::pico_svg::PicoSvg; @@ -68,9 +71,16 @@ pub fn gen_test_scene() -> Scene { offset: 1.0, color: Color::rgb8(0, 0, 255), }, - ].into() + ] + .into(), }); - builder.fill(Fill::NonZero, Affine::scale(3.0, 3.0), &gradient, None, &path); + builder.fill( + Fill::NonZero, + Affine::scale(3.0, 3.0), + &gradient, + None, + &path, + ); } _ => { let xml_str =