Fix app icon fading

The way we were loading data into a CoglTexture, then pulling it out
and manipulating it on the CPU, then loading it back into a texture
was a bit lame.

Clean things up a bit here by loading directly into the CPU, doing
the fading, then creating a texture.

Also cache the faded data in StTextureCache.

https://bugzilla.gnome.org/show_bug.cgi?id=612759
This commit is contained in:
Colin Walters
2010-03-12 15:57:01 -05:00
parent 374fd35476
commit 3aea09b614
7 changed files with 177 additions and 84 deletions

View File

@ -1021,7 +1021,16 @@ themed_icon_from_name (const char *iconname)
return icon;
}
static GIcon *
/**
* shell_app_info_get_icon:
* @info: A #ShellAppInfo
*
* Get the #GIcon associated with this app; for apps "faked" from a #MetaWindow,
* return %NULL.
*
* Returns: (transfer full): The icon for @info, or %NULL
*/
GIcon *
shell_app_info_get_icon (ShellAppInfo *info)
{
char *iconname = NULL;
@ -1120,6 +1129,21 @@ shell_app_info_create_icon_texture (ShellAppInfo *info, float size)
return ret;
}
/**
* shell_app_info_get_source_window:
* @info: A #ShellAppInfo
*
* If @info is tracking a #MetaWindow, return that window.
* Otherwise, return %NULL.
*/
MetaWindow *
shell_app_info_get_source_window (ShellAppInfo *info)
{
if (info->type == SHELL_APP_INFO_TYPE_WINDOW)
return info->window;
return NULL;
}
/**
* shell_app_info_launch_full:
* @timestamp: Event timestamp, or 0 for current event timestamp