[gnome-shell/gbsneto/eager-cache-invalidation] st/theme-context: Invalidate texture cache when scaling changes
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/eager-cache-invalidation] st/theme-context: Invalidate texture cache when scaling changes
- Date: Fri, 3 Apr 2020 22:01:40 +0000 (UTC)
commit 966d4b164cbc308316fbcb875853a1d4e3487b2e
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Apr 3 19:00:28 2020 -0300
st/theme-context: Invalidate texture cache when scaling changes
src/st/st-texture-cache.c | 15 +++++++++++++++
src/st/st-texture-cache.h | 2 ++
src/st/st-theme-context.c | 4 ++++
3 files changed, 21 insertions(+)
---
diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c
index 850c0d6979..2c9319980f 100644
--- a/src/st/st-texture-cache.c
+++ b/src/st/st-texture-cache.c
@@ -1619,3 +1619,18 @@ st_texture_cache_rescan_icon_theme (StTextureCache *cache)
return gtk_icon_theme_rescan_if_needed (priv->icon_theme);
}
+
+
+/**
+ * st_texture_cache_invalidate:
+ * @cache: a #StTextureCache
+ *
+ * Invalidates the texture cache, and evicts all icons.
+ */
+void
+st_texture_cache_invalidate (StTextureCache *cache)
+{
+ g_return_if_fail (ST_IS_TEXTURE_CACHE (cache));
+
+ st_texture_cache_evict_icons (cache);
+}
diff --git a/src/st/st-texture-cache.h b/src/st/st-texture-cache.h
index a99316da8f..031087d878 100644
--- a/src/st/st-texture-cache.h
+++ b/src/st/st-texture-cache.h
@@ -115,4 +115,6 @@ CoglTexture * st_texture_cache_load (StTextureCache *cache,
gboolean st_texture_cache_rescan_icon_theme (StTextureCache *cache);
+void st_texture_cache_invalidate (StTextureCache *cache);
+
#endif /* __ST_TEXTURE_CACHE_H__ */
diff --git a/src/st/st-theme-context.c b/src/st/st-theme-context.c
index de112aa499..b21d5de96f 100644
--- a/src/st/st-theme-context.c
+++ b/src/st/st-theme-context.c
@@ -176,7 +176,11 @@ st_theme_context_set_property (GObject *object,
int scale_factor = g_value_get_int (value);
if (scale_factor != context->scale_factor)
{
+ StTextureCache *cache = st_texture_cache_get_default ();
+
context->scale_factor = scale_factor;
+
+ st_texture_cache_invalidate (cache);
st_theme_context_changed (context);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]