[gnome-shell/gnome-3-28] st-texture-cache: Obey cache policy in st_texture_cache_load
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-28] st-texture-cache: Obey cache policy in st_texture_cache_load
- Date: Fri, 31 Aug 2018 14:15:39 +0000 (UTC)
commit 4dfc2e0fd1f7cacbdb68731249aa4beb72473601
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Nov 4 20:03:33 2011 +0000
st-texture-cache: Obey cache policy in st_texture_cache_load
https://bugzilla.gnome.org/show_bug.cgi?id=663461
(cherry picked from commit 50e849a186703842bbf1418bab175d996fbaaf8a)
src/st/st-texture-cache.c | 8 ++++----
src/st/st-theme-node-drawing.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index 0c794a3ab..3bf3a5e97 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -780,13 +780,13 @@ st_texture_cache_load (StTextureCache *cache,
if (!texture)
{
texture = load (cache, key, data, error);
- if (texture)
+ if (texture && policy == ST_TEXTURE_CACHE_POLICY_FOREVER)
g_hash_table_insert (cache->priv->keyed_cache, g_strdup (key), texture);
- else
- return NULL;
}
- cogl_object_ref (texture);
+ if (texture && policy == ST_TEXTURE_CACHE_POLICY_FOREVER)
+ cogl_object_ref (texture);
+
return texture;
}
diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c
index 8942966bf..2123cc487 100644
--- a/src/st/st-theme-node-drawing.c
+++ b/src/st/st-theme-node-drawing.c
@@ -402,7 +402,7 @@ st_theme_node_lookup_corner (StThemeNode *node,
return COGL_INVALID_HANDLE;
key = corner_to_string (&corner);
- texture = st_texture_cache_load (cache, key, ST_TEXTURE_CACHE_POLICY_NONE, load_corner, &corner, NULL);
+ texture = st_texture_cache_load (cache, key, ST_TEXTURE_CACHE_POLICY_FOREVER, load_corner, &corner, NULL);
if (texture)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]