iconhelper: always ensure a stated pixbuf

Even when we are set a pixbuf itself.

https://bugzilla.gnome.org/show_bug.cgi?id=726271
This commit is contained in:
Cosimo Cecchi 2013-08-04 16:50:31 +02:00 committed by Matthias Clasen
parent 19510cdec7
commit b0a0b7ebe7

View File

@ -388,6 +388,7 @@ ensure_pixbuf_at_size (GtkIconHelper *self,
GtkStyleContext *context)
{
gint width, height;
GdkPixbuf *stated;
if (!check_invalidate_pixbuf (self, context))
return;
@ -427,6 +428,10 @@ ensure_pixbuf_at_size (GtkIconHelper *self,
if (!self->priv->rendered_pixbuf)
self->priv->rendered_pixbuf = g_object_ref (self->priv->orig_pixbuf);
stated = ensure_stated_pixbuf_from_pixbuf (self, context, self->priv->rendered_pixbuf);
g_object_unref (self->priv->rendered_pixbuf);
self->priv->rendered_pixbuf = stated;
}
GdkPixbuf *
@ -545,7 +550,7 @@ ensure_surface_from_pixbuf (GtkIconHelper *self,
GtkStyleContext *context)
{
gint width, height;
GdkPixbuf *pixbuf;
GdkPixbuf *pixbuf, *stated;
int scale;
if (!check_invalidate_surface (self, context))
@ -585,6 +590,10 @@ ensure_surface_from_pixbuf (GtkIconHelper *self,
scale = self->priv->orig_pixbuf_scale;
}
stated = ensure_stated_pixbuf_from_pixbuf (self, context, pixbuf);
g_object_unref (pixbuf);
pixbuf = stated;
self->priv->rendered_surface_width = (gdk_pixbuf_get_width (pixbuf) + scale - 1) / scale;
self->priv->rendered_surface_height = (gdk_pixbuf_get_height (pixbuf) + scale - 1) / scale;