[librsvg] render_to_offsetted_viewport(): Convert to reftest
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] render_to_offsetted_viewport(): Convert to reftest
- Date: Tue, 26 Mar 2019 22:23:03 +0000 (UTC)
commit 625ee00f1b8f2c07cc52f90b83545df200575a26
Author: Federico Mena Quintero <federico gnome org>
Date: Tue Mar 26 15:56:21 2019 -0600
render_to_offsetted_viewport(): Convert to reftest
.../fixtures/rect-48x48-offsetted-100x100-10x20.png | Bin 1331 -> 0 bytes
librsvg_crate/tests/render_to_viewport.rs | 18 ++++++++++++++++--
2 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/librsvg_crate/tests/render_to_viewport.rs b/librsvg_crate/tests/render_to_viewport.rs
index c02651e3..867880ff 100644
--- a/librsvg_crate/tests/render_to_viewport.rs
+++ b/librsvg_crate/tests/render_to_viewport.rs
@@ -77,10 +77,24 @@ fn render_to_offsetted_viewport() {
)
.unwrap();
- compare_to_file(
+ let reference_surf = cairo::ImageSurface::create(cairo::Format::ARgb32, 100, 100).unwrap();
+
+ {
+ let cr = cairo::Context::new(&reference_surf);
+
+ cr.translate(10.0, 20.0);
+
+ cr.rectangle(8.0, 8.0, 32.0, 32.0);
+ cr.set_source_rgba(0.0, 0.0, 1.0, 1.0);
+ cr.fill();
+ }
+
+ let reference_surf = SharedImageSurface::new(reference_surf, SurfaceType::SRgb).unwrap();
+
+ compare_to_surface(
&output_surf,
+ &reference_surf,
"render_to_offseted_viewport",
- "rect-48x48-offsetted-100x100-10x20.png",
);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]