st-texture-cache: Remove load_gicon_with_colors()

The split between st_texture_cache_load_gicon() and load_gicon_with_colors()
no longer makes any sense, so just move the code into the public method.

https://bugzilla.gnome.org/show_bug.cgi?id=740447
This commit is contained in:
Florian Müllner 2014-11-29 14:43:50 +00:00
parent f4cc3327e8
commit deddac8748

View File

@ -812,12 +812,27 @@ ensure_request (StTextureCache *cache,
return had_pending; return had_pending;
} }
static ClutterActor * /**
load_gicon_with_colors (StTextureCache *cache, * st_texture_cache_load_gicon:
* @cache: The texture cache instance
* @theme_node: (nullable): The #StThemeNode to use for colors, or NULL
* if the icon must not be recolored
* @icon: the #GIcon to load
* @size: Size of themed
* @scale: Scale factor of display
*
* This method returns a new #ClutterActor for a given #GIcon. If the
* icon isn't loaded already, the texture will be filled
* asynchronously.
*
* Return Value: (transfer none): A new #ClutterActor for the icon, or %NULL if not found
*/
ClutterActor *
st_texture_cache_load_gicon (StTextureCache *cache,
StThemeNode *theme_node,
GIcon *icon, GIcon *icon,
gint size, gint size,
gint scale, gint scale)
StIconColors *colors)
{ {
AsyncTextureLoadData *request; AsyncTextureLoadData *request;
ClutterActor *texture; ClutterActor *texture;
@ -826,8 +841,12 @@ load_gicon_with_colors (StTextureCache *cache,
GtkIconTheme *theme; GtkIconTheme *theme;
GtkIconInfo *info; GtkIconInfo *info;
StTextureCachePolicy policy; StTextureCachePolicy policy;
StIconColors *colors = NULL;
GtkIconLookupFlags lookup_flags; GtkIconLookupFlags lookup_flags;
if (theme_node)
colors = st_theme_node_get_icon_colors (theme_node);
/* Do theme lookups in the main thread to avoid thread-unsafety */ /* Do theme lookups in the main thread to avoid thread-unsafety */
theme = cache->priv->icon_theme; theme = cache->priv->icon_theme;
@ -894,31 +913,6 @@ load_gicon_with_colors (StTextureCache *cache,
return CLUTTER_ACTOR (texture); return CLUTTER_ACTOR (texture);
} }
/**
* st_texture_cache_load_gicon:
* @cache: The texture cache instance
* @theme_node: (nullable): The #StThemeNode to use for colors, or NULL
* if the icon must not be recolored
* @icon: the #GIcon to load
* @size: Size of themed
* @scale: Scale factor of display
*
* This method returns a new #ClutterActor for a given #GIcon. If the
* icon isn't loaded already, the texture will be filled
* asynchronously.
*
* Return Value: (transfer none): A new #ClutterActor for the icon, or %NULL if not found
*/
ClutterActor *
st_texture_cache_load_gicon (StTextureCache *cache,
StThemeNode *theme_node,
GIcon *icon,
gint size,
gint scale)
{
return load_gicon_with_colors (cache, icon, size, scale, theme_node ? st_theme_node_get_icon_colors (theme_node) : NULL);
}
static ClutterActor * static ClutterActor *
load_from_pixbuf (GdkPixbuf *pixbuf) load_from_pixbuf (GdkPixbuf *pixbuf)
{ {