[librsvg] benches: shorten code
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] benches: shorten code
- Date: Fri, 17 Jan 2020 10:14:17 +0000 (UTC)
commit a262cc44fb3a5e12be074cecb15cda7fbe246429
Author: Paolo Borelli <pborelli gnome org>
Date: Fri Jan 17 10:39:29 2020 +0100
benches: shorten code
rsvg_internals/benches/box_blur.rs | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/rsvg_internals/benches/box_blur.rs b/rsvg_internals/benches/box_blur.rs
index cefd20ae..28f1e37c 100644
--- a/rsvg_internals/benches/box_blur.rs
+++ b/rsvg_internals/benches/box_blur.rs
@@ -19,15 +19,13 @@ fn bench_box_blur(c: &mut Criterion) {
c.bench_function_over_inputs(
"box_blur 9",
|b, &(vertical, alpha_only)| {
- let input_surface =
- cairo::ImageSurface::create(cairo::Format::ARgb32, SURFACE_SIDE, SURFACE_SIDE)
- .unwrap();
let surface_type = if alpha_only {
SurfaceType::AlphaOnly
} else {
SurfaceType::SRgb
};
- let input_surface = SharedImageSurface::wrap(input_surface, surface_type).unwrap();
+ let input_surface =
+ SharedImageSurface::empty(SURFACE_SIDE, SURFACE_SIDE, surface_type).unwrap();
let mut output_surface =
cairo::ImageSurface::create(cairo::Format::ARgb32, SURFACE_SIDE, SURFACE_SIDE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]