Merge St.TextureCache and Shell.TextureCache

Brute force merge these two by essentially replacing St.TextureCache
with a (renamed) Shell.TextureCache.

One function was added for convenience, namely "st_texture_cache_load_file_simple".
St.TextureCache had a function to load a texture from a filename, and it
returned NULL on error but only half the callers actually checked this.  This
function is better.

https://bugzilla.gnome.org/show_bug.cgi?id=607500
This commit is contained in:
Colin Walters
2010-02-09 12:42:07 -05:00
parent aa7de264e6
commit 22948b3d39
20 changed files with 1607 additions and 2130 deletions

View File

@ -905,8 +905,8 @@ st_widget_real_style_changed (StWidget *self)
/* `border-image' takes precedence over `background-image'.
* Firefox lets the background-image shine thru when border-image has
* alpha an channel, maybe that would be an option for the future. */
texture = st_texture_cache_get_texture (texture_cache,
filename);
texture = (ClutterTexture*) st_texture_cache_load_file_simple (texture_cache,
filename);
clutter_texture_get_base_size (CLUTTER_TEXTURE (texture),
&width, &height);
@ -968,16 +968,8 @@ st_widget_real_style_changed (StWidget *self)
bg_file = st_theme_node_get_background_image (theme_node);
if (bg_file != NULL)
{
texture = st_texture_cache_get_texture (texture_cache, bg_file);
priv->background_image = (ClutterActor*) texture;
if (priv->background_image != NULL)
{
clutter_actor_set_parent (priv->background_image,
CLUTTER_ACTOR (self));
}
else
g_warning ("Could not load %s", bg_file);
priv->background_image = st_texture_cache_load_file_simple (texture_cache, bg_file);
clutter_actor_set_parent (priv->background_image, CLUTTER_ACTOR (self));
has_changed = TRUE;
relayout_needed = TRUE;