summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-04-12 13:59:55 +0200
committerBenjamin Otte <otte@redhat.com>2018-04-12 14:02:59 +0200
commitb9c8c146d2c9a410d142e9d13d1f77a296ac0e58 (patch)
treeabfab8e1740b37a492f9051d87f49d3587057259 /tests
parent770866f265a0dfc03a0ee1bb705e758e76749c8c (diff)
downloadgtk+-b9c8c146d2c9a410d142e9d13d1f77a296ac0e58.tar.gz
tests: Use gdk_texture_save_to_png() where appropriate
Diffstat (limited to 'tests')
-rw-r--r--tests/showrendernode.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/tests/showrendernode.c b/tests/showrendernode.c
index e0b2210ef3..3efc1a0daf 100644
--- a/tests/showrendernode.c
+++ b/tests/showrendernode.c
@@ -168,21 +168,12 @@ main (int argc, char **argv)
GdkSurface *window = gdk_surface_new_toplevel (gdk_display_get_default(), 10 , 10);
GskRenderer *renderer = gsk_renderer_new_for_surface (window);
GdkTexture *texture = gsk_renderer_render_texture (renderer, GTK_NODE_VIEW (nodeview)->node, NULL);
- cairo_surface_t *rendered_surface;
g_message ("Writing .node file to .png using %s", G_OBJECT_TYPE_NAME (renderer));
g_assert (texture != NULL);
- rendered_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
- gdk_texture_get_width (texture),
- gdk_texture_get_height (texture));
- gdk_texture_download (texture,
- cairo_image_surface_get_data (rendered_surface),
- cairo_image_surface_get_stride (rendered_surface));
- cairo_surface_mark_dirty (rendered_surface);
-
- cairo_surface_write_to_png (rendered_surface, write_to_filename);
+ gdk_texture_save_to_png (texture, write_to_filename);
gsk_renderer_unrealize (renderer);