mirror of
https://github.com/italicsjenga/vello.git
synced 2025-01-10 04:31:30 +11:00
format
This commit is contained in:
parent
20f7b68514
commit
9adeaf3e82
|
@ -305,7 +305,12 @@ impl Recording {
|
|||
buf_proxy
|
||||
}
|
||||
|
||||
pub fn upload_image(&mut self, width: u32, height: u32, data: impl Into<Vec<u8>>) -> ImageProxy {
|
||||
pub fn upload_image(
|
||||
&mut self,
|
||||
width: u32,
|
||||
height: u32,
|
||||
data: impl Into<Vec<u8>>,
|
||||
) -> ImageProxy {
|
||||
let data = data.into();
|
||||
let image_proxy = ImageProxy::new(width, height);
|
||||
self.push(Command::UploadImage(image_proxy, data));
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 =
|
||||
|
|
Loading…
Reference in a new issue