diff options
author | Hiroyuki Ikezoe <hiikezoe@gnome.org> | 2010-04-19 20:10:55 +0900 |
---|---|---|
committer | Hiroyuki Ikezoe <hiikezoe@gnome.org> | 2010-04-19 20:10:55 +0900 |
commit | fed5073e6804bdc5376e1248f3e0a7fc1863633a (patch) | |
tree | 3eae8cd8b2c9ee0dedf2313d6233d3b3271a2805 /tools | |
parent | 10e41fccf789c762c5b57be655e3cd8ca24cedb6 (diff) | |
download | librsvg-fed5073e6804bdc5376e1248f3e0a7fc1863633a.tar.gz |
fix incorrect scaling.
Also fix memory leak.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/test-performance.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/test-performance.c b/tools/test-performance.c index d27bf1cf..1d5f11bf 100644 --- a/tools/test-performance.c +++ b/tools/test-performance.c @@ -134,8 +134,10 @@ main (int argc, char **argv) continue; handle = rsvg_handle_new_from_data (contents, length, NULL); - if (!handle) + if (!handle) { + g_free (contents); continue; + } rsvg_handle_get_dimensions (handle, &dimensions); /* if both are unspecified, assume user wants to zoom the pixbuf in at least 1 dimension */ @@ -161,8 +163,10 @@ main (int argc, char **argv) for (i = 0; i < count; i++) { handle = rsvg_handle_new_from_data (contents, length, NULL); + cairo_save (cr); cairo_scale (cr, (double) width / dimensions.width, (double) height / dimensions.height); rsvg_handle_render_cairo (handle, cr); + cairo_restore (cr); g_object_unref (handle); } @@ -177,3 +181,4 @@ main (int argc, char **argv) return 0; } +/* vim: set ts=4 nowrap ai expandtab sw=4: */ |