summaryrefslogtreecommitdiff
path: root/gsk/gskrendernodeimpl.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2017-09-20 21:00:33 -0400
committerMatthias Clasen <mclasen@redhat.com>2017-09-20 23:26:15 -0400
commitb18ab9761afc91d3ac4220e5dbee7b6c89e43d8a (patch)
tree57eaf73afc5423b4d5968a0996c2a31f4087c40b /gsk/gskrendernodeimpl.c
parentb5eeb98374d39c62d51dbc0bcb707c595471cf24 (diff)
downloadgtk+-b18ab9761afc91d3ac4220e5dbee7b6c89e43d8a.tar.gz
gsk: Fix serialization of text nodes
Diffstat (limited to 'gsk/gskrendernodeimpl.c')
-rw-r--r--gsk/gskrendernodeimpl.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index a71bea7515..ad6ffdace5 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -3901,6 +3901,8 @@ gsk_text_node_serialize (GskRenderNode *node)
desc = pango_font_describe (self->font);
s = pango_font_description_to_string (desc);
+
+ g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(uiiii)"));
for (i = 0; i < self->glyphs->num_glyphs; i++)
{
PangoGlyphInfo *glyph = &self->glyphs->glyphs[i];
@@ -3912,7 +3914,6 @@ gsk_text_node_serialize (GskRenderNode *node)
glyph->attr.is_cluster_start);
}
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(uiiii)"));
v = g_variant_new (GSK_TEXT_NODE_VARIANT_TYPE,
s,
self->color.red,
@@ -3935,7 +3936,7 @@ gsk_text_node_deserialize (GVariant *variant,
{
PangoFont *font;
PangoGlyphString *glyphs;
- GVariantIter iter;
+ GVariantIter *iter;
GskRenderNode *result;
PangoGlyphInfo glyph;
PangoFontDescription *desc;
@@ -3950,7 +3951,7 @@ gsk_text_node_deserialize (GVariant *variant,
if (!check_variant_type (variant, GSK_TEXT_NODE_VARIANT_TYPE, error))
return NULL;
- g_variant_get (variant, "(&sddddiidda(uiiii))",
+ g_variant_get (variant, "(&sdddddda(uiiii))",
&s, &color.red, &color.green, &color.blue, &color.alpha,
&x, &y, &iter);
@@ -3960,9 +3961,9 @@ gsk_text_node_deserialize (GVariant *variant,
font = pango_font_map_load_font (fontmap, context, desc);
glyphs = pango_glyph_string_new ();
- pango_glyph_string_set_size (glyphs, g_variant_iter_n_children (&iter));
+ pango_glyph_string_set_size (glyphs, g_variant_iter_n_children (iter));
i = 0;
- while (g_variant_iter_next (&iter, "(uiiii)",
+ while (g_variant_iter_next (iter, "(uiiii)",
&glyph.glyph, &glyph.geometry.width,
&glyph.geometry.x_offset, &glyph.geometry.y_offset,
&cluster_start))
@@ -3971,6 +3972,7 @@ gsk_text_node_deserialize (GVariant *variant,
glyphs->glyphs[i] = glyph;
i++;
}
+ g_variant_iter_free (iter);
result = gsk_text_node_new (font, glyphs, &color, x, y); /* FIXME: Avoid copying glyphs */