summaryrefslogtreecommitdiff
path: root/gtk/gtkiconhelper.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2016-02-06 09:23:11 +0100
committerTimm Bäder <mail@baedert.org>2016-02-07 19:16:26 +0100
commit0c80210685e2b60addbd7dd22c86b8536a79b142 (patch)
treeca9b2cd26d026f4733af3bd7bc6bc0d1fa996c9e /gtk/gtkiconhelper.c
parent0ec4c76d8f54a7e2127cafb1ba8c4bbe68fd30fa (diff)
downloadgtk+-0c80210685e2b60addbd7dd22c86b8536a79b142.tar.gz
iconhelper: Save whether the surface is symbolic
Diffstat (limited to 'gtk/gtkiconhelper.c')
-rw-r--r--gtk/gtkiconhelper.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c
index c18080394d..0b4b9b797e 100644
--- a/gtk/gtkiconhelper.c
+++ b/gtk/gtkiconhelper.c
@@ -42,6 +42,7 @@ struct _GtkIconHelperPrivate {
guint use_fallback : 1;
guint force_scale_pixbuf : 1;
+ guint rendered_surface_is_symbolic : 1;
cairo_surface_t *rendered_surface;
};
@@ -55,6 +56,7 @@ gtk_icon_helper_invalidate (GtkIconHelper *self)
{
cairo_surface_destroy (self->priv->rendered_surface);
self->priv->rendered_surface = NULL;
+ self->priv->rendered_surface_is_symbolic = FALSE;
}
if (!GTK_IS_CSS_TRANSIENT_NODE (gtk_css_gadget_get_node (GTK_CSS_GADGET (self))))
@@ -205,6 +207,7 @@ gtk_icon_helper_init (GtkIconHelper *self)
self->priv->icon_size = GTK_ICON_SIZE_INVALID;
self->priv->pixel_size = -1;
+ self->priv->rendered_surface_is_symbolic = FALSE;
}
static void
@@ -419,6 +422,7 @@ ensure_surface_for_gicon (GtkIconHelper *self,
gint scale,
GIcon *gicon)
{
+ GtkIconHelperPrivate *priv = self->priv;
GtkIconTheme *icon_theme;
gint width, height;
GtkIconInfo *info;
@@ -487,6 +491,11 @@ ensure_surface_for_gicon (GtkIconHelper *self,
icon_effect = _gtk_css_icon_effect_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_EFFECT));
gtk_css_icon_effect_apply (icon_effect, surface);
}
+ else
+ {
+ priv->rendered_surface_is_symbolic = TRUE;
+ }
+
g_object_unref (destination);
return surface;