diff options
author | Matthias Clasen <mclasen@redhat.com> | 2018-03-10 21:14:09 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2018-03-11 00:31:44 -0500 |
commit | 694f1d8ecdf39317cabe68f595950f67b35f4af6 (patch) | |
tree | 3329107a31e14682555db878f7cd4f245736de6a /gtk/gtkoverlay.c | |
parent | e23f641e491fd85371a613dde7f90fee8924657d (diff) | |
download | gtk+-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.c | 21 |
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)); } |