Fix performance on large canvases

This commit is contained in:
2025-06-23 22:18:57 +02:00
parent eaf0c3cb55
commit cfed4fd5ed
2 changed files with 41 additions and 37 deletions

View File

@ -87,6 +87,17 @@ pub fn rasterize_onto<'a, Blend: BlendFn>(
}
}
/// Rasterize a single triangles onto an image,
///
/// Triangle positions must be in image-local point-coords.
pub fn rasterize_triangle_onto<'a, Blend: BlendFn>(
image: &mut ColorImage,
point_to_pixel: TSTransform,
triangle: [&'a Vertex; 3],
) {
rasterize_onto::<Blend>(image, point_to_pixel, [triangle].into_iter());
}
/// A bounding box, measured in pixels.
#[derive(Debug, PartialEq, Eq)]
pub struct PxBoundingBox {