summaryrefslogtreecommitdiff
path: root/gtk/gtkoverlay.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-03-10 21:14:09 -0500
committerMatthias Clasen <mclasen@redhat.com>2018-03-11 00:31:44 -0500
commit694f1d8ecdf39317cabe68f595950f67b35f4af6 (patch)
tree3329107a31e14682555db878f7cd4f245736de6a /gtk/gtkoverlay.c
parente23f641e491fd85371a613dde7f90fee8924657d (diff)
downloadgtk+-694f1d8ecdf39317cabe68f595950f67b35f4af6.tar.gz
Stop using stack-allocated snapshots
Use the new/free api instead of init/finish for GtkSnapshot.
Diffstat (limited to 'gtk/gtkoverlay.c')
-rw-r--r--gtk/gtkoverlay.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index 3dc65aca77..90a930799b 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -673,17 +673,16 @@ gtk_overlay_snapshot (GtkWidget *widget,
if (main_widget_node == NULL)
{
- GtkSnapshot child_snapshot;
-
- gtk_snapshot_init (&child_snapshot,
- gtk_snapshot_get_renderer (snapshot),
- snapshot->record_names,
- NULL,
- "OverlayCaptureMainChild");
- gtk_snapshot_offset (&child_snapshot, main_alloc.x, main_alloc.y);
- gtk_widget_snapshot (main_widget, &child_snapshot);
- gtk_snapshot_offset (&child_snapshot, -main_alloc.x, -main_alloc.y);
- main_widget_node = gtk_snapshot_finish (&child_snapshot);
+ GtkSnapshot *child_snapshot;
+
+ child_snapshot = gtk_snapshot_new (gtk_snapshot_get_renderer (snapshot),
+ snapshot->record_names,
+ NULL,
+ "OverlayCaptureMainChild");
+ gtk_snapshot_offset (child_snapshot, main_alloc.x, main_alloc.y);
+ gtk_widget_snapshot (main_widget, child_snapshot);
+ gtk_snapshot_offset (child_snapshot, -main_alloc.x, -main_alloc.y);
+ main_widget_node = gtk_snapshot_free_to_node (child_snapshot);
graphene_matrix_init_translate (&translate, &GRAPHENE_POINT3D_INIT (main_alloc.x,main_alloc.y, 0));
}