[librsvg] surface_utils: shorten iterator test code
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] surface_utils: shorten iterator test code
- Date: Wed, 15 Jan 2020 00:44:59 +0000 (UTC)
commit 823bdd5c79b25bbc66a590b79dc0abaa3f48b827
Author: Paolo Borelli <pborelli gnome org>
Date: Wed Jan 15 01:44:30 2020 +0100
surface_utils: shorten iterator test code
rsvg_internals/src/surface_utils/iterators.rs | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
---
diff --git a/rsvg_internals/src/surface_utils/iterators.rs b/rsvg_internals/src/surface_utils/iterators.rs
index 920da89b..62c15e5d 100644
--- a/rsvg_internals/src/surface_utils/iterators.rs
+++ b/rsvg_internals/src/surface_utils/iterators.rs
@@ -201,11 +201,7 @@ mod tests {
const WIDTH: i32 = 32;
const HEIGHT: i32 = 64;
- let surface = SharedImageSurface::wrap(
- cairo::ImageSurface::create(cairo::Format::ARgb32, WIDTH, HEIGHT).unwrap(),
- SurfaceType::SRgb,
- )
- .unwrap();
+ let surface = SharedImageSurface::empty(WIDTH, HEIGHT, SurfaceType::SRgb).unwrap();
// Full image.
assert_eq!(Pixels::new(&surface).count(), (WIDTH * HEIGHT) as usize);
@@ -240,11 +236,7 @@ mod tests {
const WIDTH: i32 = 32;
const HEIGHT: i32 = 64;
- let surface = SharedImageSurface::wrap(
- cairo::ImageSurface::create(cairo::Format::ARgb32, WIDTH, HEIGHT).unwrap(),
- SurfaceType::SRgb,
- )
- .unwrap();
+ let surface = SharedImageSurface::empty(WIDTH, HEIGHT, SurfaceType::SRgb).unwrap();
let rect_bounds = IRect::new(-8, -8, 8, 8);
assert_eq!(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]