snapshot: Convert GtkSpinner

This commit is contained in:
Benjamin Otte 2016-11-15 07:25:13 +01:00
parent 0cf9f70ccd
commit dad8703e03
2 changed files with 8 additions and 13 deletions

View File

@ -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

View File

@ -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: