diff options
author | Alexander Larsson <alexl@redhat.com> | 2016-12-21 20:39:07 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2017-01-11 16:39:39 +0100 |
commit | 8ecbd85acc181378e6ed335541c556fcf6cc09f8 (patch) | |
tree | 555177ce5dfdc8ed95174f3e86a08abdc7ca6303 /gtk/gtkstack.c | |
parent | c00f8dce9f8076e3e914210dda62e7fd2207d1e4 (diff) | |
download | gtk+-wip/alexl/rendertree.tar.gz |
gsk: Add GskRenderTreewip/alexl/rendertree
A render tree owns all the nodes that are created during a frame,
and they are allocated with a custom allocator. All the resources
allocated for the tree are kept until destruction, and then
it is all released at the same time.
Allocation happes in chunks which makes both allocation and
freeing very efficient, and also quite cache efficient.
This somewhat changes the memory management of GskRenderNode. All
nodes created by the tree are owned by the tree, and normally you
don't need to ref them. If you want to keep them around you can still
ref them, but that actually refs the entire tree.
Diffstat (limited to 'gtk/gtkstack.c')
-rw-r--r-- | gtk/gtkstack.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index d1f4767ed8..dea41c837f 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -1933,12 +1933,11 @@ gtk_stack_snapshot_crossfade (GtkWidget *widget, gtk_snapshot_push_transform (snapshot, &identity, "CrossFadeStart"); gtk_snapshot_append_node (snapshot, priv->last_visible_node); start_node = gtk_snapshot_pop (snapshot); - node = gsk_cross_fade_node_new (start_node, end_node, progress); - gsk_render_node_unref (start_node); + node = gsk_cross_fade_node_new (gtk_snapshot_get_tree (snapshot), start_node, end_node, progress); } else { - node = gsk_opacity_node_new (end_node, 1.0 - progress); + node = gsk_opacity_node_new (gtk_snapshot_get_tree (snapshot), end_node, 1.0 - progress); } if (snapshot->record_names) @@ -1949,9 +1948,6 @@ gtk_stack_snapshot_crossfade (GtkWidget *widget, } gtk_snapshot_append_node (snapshot, node); - - gsk_render_node_unref (node); - gsk_render_node_unref (end_node); } static void |