mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-12 20:00:09 +00:00
node-editor: Embed textures in testcases
It is useless to have node files with references to external files in the testsuite, so turn such textures into data urls by doing a serialization roundtrip.
This commit is contained in:
parent
f211a2177f
commit
0a3eceb15d
@ -1017,6 +1017,19 @@ testcase_save_clicked_cb (GtkWidget *button,
|
||||
}
|
||||
|
||||
text = get_current_text (self->text_buffer);
|
||||
{
|
||||
GBytes *bytes;
|
||||
GskRenderNode *node;
|
||||
gsize size;
|
||||
|
||||
bytes = g_bytes_new_take (text, strlen (text) + 1);
|
||||
node = gsk_render_node_deserialize (bytes, NULL, NULL);
|
||||
g_bytes_unref (bytes);
|
||||
bytes = gsk_render_node_serialize (node);
|
||||
gsk_render_node_unref (node);
|
||||
text = g_bytes_unref_to_data (bytes, &size);
|
||||
}
|
||||
|
||||
if (!g_file_set_contents (node_file, text, -1, &error))
|
||||
{
|
||||
gtk_label_set_label (GTK_LABEL (self->testcase_error_label), error->message);
|
||||
|
Loading…
Reference in New Issue
Block a user