iconhelper: check if surface was invalidated

Fetching the style may cause the surface to be invalidated.
This commit is contained in:
Christian Hergert 2016-04-27 17:45:01 -07:00
parent 055ce9f095
commit 88d0258397

View File

@ -892,16 +892,22 @@ _gtk_icon_helper_draw (GtkIconHelper *self,
gdouble x,
gdouble y)
{
GtkCssStyle *style;
gtk_icon_helper_ensure_surface (self);
/*
* Get the style first as the rendered surface maybe cleared if the style
* must be recomputed
*/
style = gtk_css_node_get_style (gtk_css_gadget_get_node (GTK_CSS_GADGET (self)));
if (self->priv->rendered_surface != NULL)
{
gtk_css_style_render_icon_surface (gtk_css_node_get_style (gtk_css_gadget_get_node (GTK_CSS_GADGET (self))),
gtk_css_style_render_icon_surface (style,
cr,
self->priv->rendered_surface,
x, y);
}
}
gboolean
_gtk_icon_helper_get_is_empty (GtkIconHelper *self)