diff options
Diffstat (limited to 'gsk')
-rw-r--r-- | gsk/gskrendernodeparser.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c index c4c721e2e3..fe5c55ac1e 100644 --- a/gsk/gskrendernodeparser.c +++ b/gsk/gskrendernodeparser.c @@ -2699,26 +2699,23 @@ render_node_print (Printer *p, case GSK_TEXTURE_NODE: { GdkTexture *texture = gsk_texture_node_get_texture (node); - cairo_surface_t *surface; - GByteArray *array; + GBytes *bytes; start_node (p, "texture"); append_rect_param (p, "bounds", &node->bounds); - surface = gdk_texture_download_surface (texture); - array = g_byte_array_new (); - cairo_surface_write_to_png_stream (surface, cairo_write_array, array); + bytes = gdk_texture_save_to_png_bytes (texture); _indent (p); g_string_append (p->str, "texture: url(\"data:image/png;base64,"); - b64 = base64_encode_with_linebreaks (array->data, array->len); + b64 = base64_encode_with_linebreaks (g_bytes_get_data (bytes, NULL), + g_bytes_get_size (bytes)); append_escaping_newlines (p->str, b64); g_free (b64); g_string_append (p->str, "\");\n"); end_node (p); - g_byte_array_free (array, TRUE); - cairo_surface_destroy (surface); + g_bytes_unref (bytes); } break; |