[gtk+/wip/cssnode3: 6/46] stylecontext: Simplify a function



commit 8e6f07fae923e2f540137914b15bced6480e92a9
Author: Benjamin Otte <otte redhat com>
Date:   Sat Jan 24 19:44:47 2015 +0100

    stylecontext: Simplify a function

 gtk/gtkstylecontext.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 7396c82..93c04b1 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -751,24 +751,26 @@ store_in_global_parent_cache (GtkStyleContext             *context,
 
 static GtkCssStyle *
 update_properties (GtkStyleContext             *context,
+                   GtkCssNode                  *cssnode,
                    GtkCssStyle                 *style,
-                   const GtkCssNodeDeclaration *decl,
-                   gboolean                     is_root,
-                   GtkCssStyle                 *parent,
                    const GtkBitmask            *parent_changes)
 {
   GtkStyleContextPrivate *priv;
+  const GtkCssNodeDeclaration *decl;
   GtkCssMatcher matcher;
   GtkWidgetPath *path;
+  GtkCssStyle *parent;
   GtkCssStyle *result;
 
   priv = context->priv;
+  parent = gtk_css_node_get_parent_style (context, cssnode);
+  decl = gtk_css_node_get_declaration (cssnode);
 
   result = lookup_in_global_parent_cache (context, parent, decl);
   if (result)
     return g_object_ref (result);
 
-  path = create_query_path (context, decl, is_root);
+  path = create_query_path (context, decl, TRUE);
 
   if (!_gtk_css_matcher_init (&matcher, path))
     {
@@ -2978,10 +2980,8 @@ _gtk_style_context_validate (GtkStyleContext  *context,
              GtkCssStyle *new_base;
               
               new_base = update_properties (context,
+                                            cssnode,
                                             GTK_CSS_ANIMATED_STYLE (current)->style,
-                                            gtk_css_node_get_declaration (cssnode),
-                                            TRUE,
-                                            gtk_css_node_get_parent_style (context, cssnode),
                                             parent_changes);
               new_values = gtk_css_animated_style_new_advance (GTK_CSS_ANIMATED_STYLE (current),
                                                                new_base,
@@ -2991,10 +2991,8 @@ _gtk_style_context_validate (GtkStyleContext  *context,
           else
             {
              new_values = update_properties (context,
+                                              cssnode,
                                               current,
-                                              gtk_css_node_get_declaration (cssnode),
-                                              TRUE,
-                                              gtk_css_node_get_parent_style (context, cssnode),
                                               parent_changes);
             }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]