[gtk+] snapshot: Convert GtkSpinner
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] snapshot: Convert GtkSpinner
- Date: Tue, 15 Nov 2016 16:57:47 +0000 (UTC)
commit dad8703e03fb6c6a01957bcfa29b876ba045ed2d
Author: Benjamin Otte <otte redhat com>
Date: Tue Nov 15 07:25:13 2016 +0100
snapshot: Convert GtkSpinner
gtk/gtkiconhelper.c | 9 +++------
gtk/gtkspinner.c | 12 +++++-------
2 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c
index e02e43f..397f79e 100644
--- a/gtk/gtkiconhelper.c
+++ b/gtk/gtkiconhelper.c
@@ -861,20 +861,17 @@ void
gtk_icon_helper_snapshot (GtkIconHelper *self,
GtkSnapshot *snapshot)
{
+ GtkCssStyle *style;
GskTexture *texture;
- GskRenderNode *node;
- graphene_rect_t bounds;
gtk_icon_helper_ensure_texture (self, gtk_snapshot_get_renderer (snapshot));
texture = self->priv->texture;
if (texture == NULL)
return;
- graphene_rect_init (&bounds, 0, 0, gsk_texture_get_width (texture), gsk_texture_get_height (texture));
+ style = gtk_css_node_get_style (gtk_css_gadget_get_node (GTK_CSS_GADGET (self)));
- node = gtk_snapshot_append (snapshot, &bounds, "Icon Helper");
- gsk_render_node_set_texture (node, texture);
- gsk_render_node_unref (node);
+ gtk_css_style_snapshot_icon (style, snapshot, texture);
}
gboolean
diff --git a/gtk/gtkspinner.c b/gtk/gtkspinner.c
index db1316e..b11c806 100644
--- a/gtk/gtkspinner.c
+++ b/gtk/gtkspinner.c
@@ -115,13 +115,11 @@ gtk_spinner_size_allocate (GtkWidget *widget,
gtk_widget_set_clip (widget, &clip);
}
-static GskRenderNode *
-gtk_spinner_get_render_node (GtkWidget *widget,
- GskRenderer *renderer)
+static void
+gtk_spinner_snapshot (GtkWidget *widget,
+ GtkSnapshot *snapshot)
{
- return gtk_css_gadget_get_render_node (GTK_SPINNER (widget)->priv->gadget,
- renderer,
- FALSE);
+ gtk_css_gadget_snapshot (GTK_SPINNER (widget)->priv->gadget, snapshot);
}
static void
@@ -196,7 +194,7 @@ gtk_spinner_class_init (GtkSpinnerClass *klass)
widget_class = GTK_WIDGET_CLASS(klass);
widget_class->size_allocate = gtk_spinner_size_allocate;
- widget_class->get_render_node = gtk_spinner_get_render_node;
+ widget_class->snapshot = gtk_spinner_snapshot;
widget_class->measure = gtk_spinner_measure;
/* GtkSpinner:active:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]