[gtk+/wip/cssstyle: 8/27] stylecontext: Only look up stuff in the cache that can be in the cache
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/cssstyle: 8/27] stylecontext: Only look up stuff in the cache that can be in the cache
- Date: Wed, 24 Dec 2014 02:20:03 +0000 (UTC)
commit 91725fe318dea511db6bb0aab6703257a4a9772f
Author: Benjamin Otte <otte redhat com>
Date: Sat Dec 13 02:07:34 2014 +0100
stylecontext: Only look up stuff in the cache that can be in the cache
Only saved styles are stored in the cache so we should look only those
up there.
gtk/gtkstylecontext.c | 15 +++++++--------
1 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index eeabc5e..06cf07c 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -717,16 +717,15 @@ style_values_lookup (GtkStyleContext *context)
g_assert (priv->widget != NULL || priv->widget_path != NULL);
- values = g_hash_table_lookup (priv->style_values, info->decl);
- if (values)
- {
- style_info_set_values (info, values);
- return values;
- }
-
-
if (gtk_style_context_is_saved (context))
{
+ values = g_hash_table_lookup (priv->style_values, info->decl);
+ if (values)
+ {
+ style_info_set_values (info, values);
+ return values;
+ }
+
values = gtk_css_static_style_new ();
g_hash_table_insert (priv->style_values,
gtk_css_node_declaration_ref (info->decl),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]