Skip to content

Commit

Permalink
iconhelper: Remove unused context argument
Browse files Browse the repository at this point in the history
Various functions don't use the style context.
  • Loading branch information
Benjamin Otte committed Nov 25, 2015
1 parent de7e27b commit 2a8e661
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions gtk/gtkiconhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ _gtk_icon_helper_init (GtkIconHelper *self)

static void
ensure_icon_size (GtkIconHelper *self,
GtkStyleContext *context,
gint *width_out,
gint *height_out)
{
Expand Down Expand Up @@ -312,7 +311,7 @@ ensure_pixbuf_for_gicon (GtkIconHelper *self,
icon_theme = gtk_icon_theme_get_for_screen (gtk_style_context_get_screen (context));
flags = get_icon_lookup_flags (self, context);

ensure_icon_size (self, context, &width, &height);
ensure_icon_size (self, &width, &height);

if (self->priv->gicon != NULL)
{
Expand Down Expand Up @@ -348,7 +347,6 @@ ensure_pixbuf_for_icon_set (GtkIconHelper *self,

static void
get_surface_size (GtkIconHelper *self,
GtkStyleContext *context,
cairo_surface_t *surface,
int *width,
int *height)
Expand All @@ -368,7 +366,7 @@ get_surface_size (GtkIconHelper *self,
ceil (cairo_image_surface_get_height (surface) / y_scale);
}
else
ensure_icon_size (self, context, width, height);
ensure_icon_size (self, width, height);
}

static void
Expand All @@ -386,7 +384,7 @@ ensure_pixbuf_from_surface (GtkIconHelper *self,
if (self->priv->rendered_pixbuf)
return;

get_surface_size (self, context, self->priv->orig_surface, &width, &height);
get_surface_size (self, self->priv->orig_surface, &width, &height);

surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
width, height);
Expand Down Expand Up @@ -419,7 +417,7 @@ ensure_pixbuf_at_size (GtkIconHelper *self,
(self->priv->pixel_size != -1 ||
self->priv->icon_size != GTK_ICON_SIZE_INVALID))
{
ensure_icon_size (self, context, &width, &height);
ensure_icon_size (self, &width, &height);

if (self->priv->orig_pixbuf_scale > 1 ||
/* These should divide the orig_pixbuf size by scale, but need not
Expand Down Expand Up @@ -559,7 +557,7 @@ ensure_surface_from_surface (GtkIconHelper *self,
self->priv->rendered_surface =
cairo_surface_reference (self->priv->orig_surface);

get_surface_size (self, context, self->priv->orig_surface,
get_surface_size (self, self->priv->orig_surface,
&self->priv->rendered_surface_width,
&self->priv->rendered_surface_height);
}
Expand All @@ -582,7 +580,7 @@ get_pixbuf_size (GtkIconHelper *self,
(self->priv->pixel_size != -1 ||
self->priv->icon_size != GTK_ICON_SIZE_INVALID))
{
ensure_icon_size (self, context, &width, &height);
ensure_icon_size (self, &width, &height);

if (scale != self->priv->orig_pixbuf_scale ||
width < gdk_pixbuf_get_width (self->priv->orig_pixbuf) / self->priv->orig_pixbuf_scale ||
Expand Down Expand Up @@ -666,7 +664,7 @@ ensure_surface_for_icon_set (GtkIconHelper *self,
G_GNUC_END_IGNORE_DEPRECATIONS;

if (self->priv->rendered_surface)
get_surface_size (self, context, self->priv->rendered_surface,
get_surface_size (self, self->priv->rendered_surface,
&self->priv->rendered_surface_width,
&self->priv->rendered_surface_height);
}
Expand Down Expand Up @@ -742,7 +740,7 @@ ensure_surface_for_gicon (GtkIconHelper *self,
icon_theme = gtk_icon_theme_get_for_screen (gtk_style_context_get_screen (context));
flags = get_icon_lookup_flags (self, context);

ensure_icon_size (self, context, &width, &height);
ensure_icon_size (self, &width, &height);
scale = get_scale_factor (self, context);

if (self->priv->gicon != NULL)
Expand Down Expand Up @@ -832,7 +830,7 @@ _gtk_icon_helper_get_size (GtkIconHelper *self,
switch (self->priv->storage_type)
{
case GTK_IMAGE_SURFACE:
get_surface_size (self, context, self->priv->orig_surface,
get_surface_size (self, self->priv->orig_surface,
&width,
&height);
break;
Expand All @@ -846,7 +844,7 @@ _gtk_icon_helper_get_size (GtkIconHelper *self,
case GTK_IMAGE_ICON_NAME:
case GTK_IMAGE_GICON:
if (self->priv->pixel_size != -1 || self->priv->force_scale_pixbuf)
ensure_icon_size (self, context, &width, &height);
ensure_icon_size (self, &width, &height);

break;

Expand Down Expand Up @@ -876,7 +874,7 @@ _gtk_icon_helper_get_size (GtkIconHelper *self,
}
else if (self->priv->icon_size != GTK_ICON_SIZE_INVALID)
{
ensure_icon_size (self, context, &width, &height);
ensure_icon_size (self, &width, &height);
}
}

Expand Down

0 comments on commit 2a8e661

Please sign in to comment.