[gtk/wip/baedert/for-master: 57/89] 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: 57/89] widget: Use gtk_snapshot_{push, pop})_collect
- Date: Thu, 6 Feb 2020 15:44:43 +0000 (UTC)
commit 7ff555be29523e07e0e236f87dfa06746c4f5bb2
Author: Timm Bäder <mail baedert org>
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 84b9d39ae4..d82923f00c 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12108,22 +12108,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);
@@ -12162,7 +12161,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]