From 101ca55d29db6ddcfe67450622311ea23fe4e38b Mon Sep 17 00:00:00 2001 From: bendn Date: Wed, 4 Oct 2023 07:50:20 +0700 Subject: [PATCH] add tri bench --- Cargo.toml | 5 +++++ benches/drawing.rs | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 benches/drawing.rs diff --git a/Cargo.toml b/Cargo.toml index eaf4649..8a2d866 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,11 @@ name = "overlays" path = "benches/overlays.rs" harness = false +[[bench]] +name = "drawing" +path = "benches/drawing.rs" +harness = false + [[bench]] name = "affine_transformations" path = "benches/affine_transformations.rs" diff --git a/benches/drawing.rs b/benches/drawing.rs new file mode 100644 index 0000000..1ad9c97 --- /dev/null +++ b/benches/drawing.rs @@ -0,0 +1,7 @@ +use fimg::*; +fn tri() { + let mut b = [0u8; 1000 * 1000 * 4]; + let mut i = Image::<&mut [u8], 4>::build(1000, 1000).buf(&mut b); + i.tri((0., 0.), (1000., 500.), (0., 999.), [255, 255, 255, 255]); +} +iai::main!(tri);