[gtk/wip/baedert/for-master: 13/38] 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: 13/38] widget: Use gtk_snapshot_{push, pop})_collect
- Date: Thu, 6 Feb 2020 16:05:11 +0000 (UTC)
commit 973e52790a8edb08be0e85302d3949a57f302da6
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 e87d66a0dd..8175497d54 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12094,22 +12094,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);
@@ -12148,7 +12147,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]