[gtk/wip/baedert/for-master] widget: Use gtk_snapshot_{push, pop})_collect
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master] widget: Use gtk_snapshot_{push, pop})_collect
- Date: Fri, 31 Jan 2020 15:42:51 +0000 (UTC)
commit 1c27c51bc5e65a85136440dc5dfa9b9b43e716a7
Author: Timm Bäder <tbaeder redhat com>
Date: Fri Jan 31 08:08:11 2020 +0100
widget: Use gtk_snapshot_{push,pop})_collect
So we avoid allocating a new snapshot just for that.
gtk/gtkwidget.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index c711ef88c3..a55bfde082 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12136,22 +12136,21 @@ gtk_widget_maybe_add_debug_render_nodes (GtkWidget *widget,
static GskRenderNode *
gtk_widget_create_render_node (GtkWidget *widget,
- GtkSnapshot *parent_snapshot)
+ GtkSnapshot *snapshot)
{
GtkWidgetClass *klass = GTK_WIDGET_GET_CLASS (widget);
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
GtkCssBoxes boxes;
GtkCssValue *filter_value;
double opacity;
- GtkSnapshot *snapshot;
opacity = priv->alpha / 255.0;
if (opacity <= 0.0)
return NULL;
gtk_css_boxes_init (&boxes, widget);
- snapshot = gtk_snapshot_new_with_parent (parent_snapshot);
+ gtk_snapshot_push_collect (snapshot);
gtk_snapshot_push_debug (snapshot,
"RenderNode for %s %p",
G_OBJECT_TYPE_NAME (widget), widget);
@@ -12190,7 +12189,7 @@ gtk_widget_create_render_node (GtkWidget *widget,
gtk_snapshot_pop (snapshot);
- return gtk_snapshot_free_to_node (snapshot);
+ return gtk_snapshot_pop_collect (snapshot);
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]