[gtk+] gtk: Remove unneeded gtk_snapshot_push()/pop() calls



commit cb8483b0a62e5e8e0004173a9104ffda5f3a030b
Author: Benjamin Otte <otte redhat com>
Date:   Fri Dec 9 21:38:35 2016 +0100

    gtk: Remove unneeded gtk_snapshot_push()/pop() calls

 gtk/gtkaccellabel.c |   12 +-----------
 gtk/gtkcontainer.c  |   11 -----------
 gtk/gtkcssgadget.c  |    4 ----
 gtk/gtkwidget.c     |    4 ----
 gtk/gtkwindow.c     |    7 -------
 5 files changed, 1 insertions(+), 37 deletions(-)
---
diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c
index 2f423cb..6dde745 100644
--- a/gtk/gtkaccellabel.c
+++ b/gtk/gtkaccellabel.c
@@ -464,16 +464,8 @@ gtk_accel_label_snapshot (GtkWidget   *widget,
 {
   GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (widget);
   guint ac_width;
-  GtkAllocation allocation, clip;
+  GtkAllocation allocation;
   GtkRequisition requisition;
-  graphene_rect_t bounds;
-
-  gtk_widget_get_clip (widget, &clip);
-  gtk_widget_get_allocation (widget, &allocation);
-  graphene_rect_init (&bounds,
-                      clip.x - allocation.x, clip.y - allocation.y,
-                      clip.width, clip.height);
-  gtk_snapshot_push (snapshot, &bounds, "AccelLabel");
 
   GTK_WIDGET_CLASS (gtk_accel_label_parent_class)->snapshot (widget, snapshot);
 
@@ -508,8 +500,6 @@ gtk_accel_label_snapshot (GtkWidget   *widget,
 
       g_object_unref (accel_layout);
     }
-
-  gtk_snapshot_pop (snapshot);
 }
 
 static void
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 928d95e..7db677a 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -3095,21 +3095,10 @@ gtk_container_snapshot (GtkWidget   *widget,
                         GtkSnapshot *snapshot)
 {
   GtkContainer *container = GTK_CONTAINER (widget);
-  GtkAllocation allocation, clip;
-  graphene_rect_t bounds;
-
-  gtk_widget_get_clip (widget, &clip);
-  gtk_widget_get_allocation (widget, &allocation);
-  graphene_rect_init (&bounds,
-                      clip.x - allocation.x, clip.y - allocation.y,
-                      clip.width, clip.height);
-  gtk_snapshot_push (snapshot, &bounds, "Children<%s>", G_OBJECT_TYPE_NAME (container));
 
   gtk_container_forall (container,
                         gtk_container_snapshot_forall,
                         snapshot);
-
-  gtk_snapshot_pop (snapshot);
 }
 
 static void
diff --git a/gtk/gtkcssgadget.c b/gtk/gtkcssgadget.c
index 85a2d7f..ce6e8d7 100644
--- a/gtk/gtkcssgadget.c
+++ b/gtk/gtkcssgadget.c
@@ -1033,8 +1033,6 @@ gtk_css_gadget_snapshot (GtkCssGadget *gadget,
   get_box_border (style, &border);
   get_box_padding (style, &padding);
 
-  gtk_snapshot_push (snapshot, &bounds, "%s<%s>", gtk_css_node_get_name (priv->node), G_OBJECT_TYPE_NAME 
(priv->owner));
-
   gtk_snapshot_translate_2d (snapshot, x + margin.left, y + margin.top);
   gtk_css_style_snapshot_background (style,
                                      snapshot,
@@ -1068,8 +1066,6 @@ gtk_css_gadget_snapshot (GtkCssGadget *gadget,
                                       height - margin.top - margin.bottom);
       gtk_snapshot_translate_2d (snapshot, - x - margin.left, - y - margin.top);
   }
-
-  gtk_snapshot_pop (snapshot);
 }
 
 void
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 162d67a..b9466dc 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -15582,8 +15582,6 @@ gtk_widget_snapshot (GtkWidget   *widget,
           gboolean result;
           cairo_t *cr;
 
-          gtk_snapshot_push (snapshot, &bounds, "DrawSignal<%s>", G_OBJECT_TYPE_NAME (widget));
-
           klass->snapshot (widget, snapshot);
 
           cr = gtk_snapshot_append_cairo_node (snapshot, 
@@ -15591,8 +15589,6 @@ gtk_widget_snapshot (GtkWidget   *widget,
                                                "DrawSignalContents<%s>", G_OBJECT_TYPE_NAME (widget));
           g_signal_emit (widget, widget_signals[DRAW], 0, cr, &result);
           cairo_destroy (cr);
-
-          gtk_snapshot_pop (snapshot);
         }
       else
         {
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 0e9678e..c6600c2 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -9392,7 +9392,6 @@ gtk_window_snapshot (GtkWidget   *widget,
   GtkAllocation allocation;
   GtkBorder window_border;
   gint title_height;
-  graphene_rect_t bounds;
   GList *l;
 
   context = gtk_widget_get_style_context (widget);
@@ -9400,10 +9399,6 @@ gtk_window_snapshot (GtkWidget   *widget,
   get_shadow_width (GTK_WINDOW (widget), &window_border);
   _gtk_widget_get_allocation (widget, &allocation);
 
-  graphene_rect_init (&bounds, allocation.x, allocation.y, allocation.width, allocation.height);
-
-  gtk_snapshot_push (snapshot, &bounds, "Window Decoration");
-
   if (priv->client_decorated &&
       priv->decorated &&
       !priv->fullscreen &&
@@ -9480,8 +9475,6 @@ gtk_window_snapshot (GtkWidget   *widget,
     }
 
   gtk_debug_updates_snapshot (widget, snapshot);
-
-  gtk_snapshot_pop (snapshot);
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]