[gtk/wip/otte/css: 2/2] cssnode: Don't recompute style on get_style()



commit a55bd02bd19c5bae6bc99b3dce3a5b04b007a1c7
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jan 29 04:45:11 2020 +0100

    cssnode: Don't recompute style on get_style()
    
    Styles are only ever computed by the root, when the frame clock ticks.
    
    This means that until the first frame clock tick - usually right before
    measure() gets called for real - CSS values are the defaults.
    
    Widgets need to be fixed to deal with this.
    
    This is necessary because otherwise we do broken change computation
    which makes widgets far too slow because the recompute their CSS styles
    all the time.
    
    It also significantly improves startup times, because we don't
    constantly (re)validate CSS for widgets that query CSS properties all
    the time (on init, on root, on realize, and so on).

 gtk/gtkcssnode.c | 7 -------
 1 file changed, 7 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index ebc65a8d43..88c2184230 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -999,13 +999,6 @@ gtk_css_node_ensure_style (GtkCssNode                   *cssnode,
 GtkCssStyle *
 gtk_css_node_get_style (GtkCssNode *cssnode)
 {
-  if (gtk_css_node_needs_new_style (cssnode))
-    {
-      gint64 timestamp = gtk_css_node_get_timestamp (cssnode);
-
-      gtk_css_node_ensure_style (cssnode, NULL, timestamp);
-    }
-
   return cssnode->style;
 }
 


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