[cairo-commit] test/any2ppm.c test/svg2png.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 12 16:37:29 UTC 2019


 test/any2ppm.c |    5 +----
 test/svg2png.c |    3 +--
 2 files changed, 2 insertions(+), 6 deletions(-)

New commits:
commit 250ae25b0a671b9de7313c042710bbb6760248c4
Author: Federico Mena Quintero <federico at gnome.org>
Date:   Tue Mar 12 10:19:36 2019 -0600

    Don't use deprecated rsvg_set_default_dpi()
    
    Use rsvg_handle_set_dpi() instead.

diff --git a/test/any2ppm.c b/test/any2ppm.c
index 7eb582c04..ac3b7f051 100644
--- a/test/any2ppm.c
+++ b/test/any2ppm.c
@@ -438,6 +438,7 @@ _rsvg_render_page (const char *filename,
     if (handle == NULL)
 	return error->message; /* XXX g_error_free */
 
+    rsvg_handle_set_dpi (handle, 72.0);
     rsvg_handle_get_dimensions (handle, &dimensions);
     surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
 					  dimensions.width,
@@ -875,10 +876,6 @@ main (int argc, char **argv)
 #endif
 #endif
 
-#if CAIRO_CAN_TEST_SVG_SURFACE
-    rsvg_set_default_dpi (72.0);
-#endif
-
 #if defined(_WIN32) && !defined (__CYGWIN__)
     _setmode (1, _O_BINARY);
 #endif
diff --git a/test/svg2png.c b/test/svg2png.c
index 24bdbfa91..52f52d08f 100644
--- a/test/svg2png.c
+++ b/test/svg2png.c
@@ -52,12 +52,11 @@ int main (int argc, char *argv[])
 
     error = NULL;
 
-    rsvg_set_default_dpi (72.0);
-
     handle = rsvg_handle_new_from_file (filename, &error);
     if (!handle)
 	FAIL (error->message);
 
+    rsvg_handle_set_dpi (handle, 72.0);
     rsvg_handle_get_dimensions (handle, &dimensions);
 
     surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24,


More information about the cairo-commit mailing list