summaryrefslogtreecommitdiff
path: root/gtk/gtkcsslookupprivate.h
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-01-24 22:52:38 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-01-25 01:20:17 -0500
commit4ab0e7956eb90e9d99ba686117fb1896cfc4f31a (patch)
treee202d021e0ab270ad528e9610273d9a4926e53e8 /gtk/gtkcsslookupprivate.h
parent1eec7362b91fe083599890e753e4398673b78994 (diff)
downloadgtk+-matthiasc/css-value-inner-loop.tar.gz
css: Reshuffle the inner loop of value computationmatthiasc/css-value-inner-loop
The loop over all properties in gtk_css_static_style_compute_values is the inner loop of the css value computation, we hit it thousands of times per frame. Rearrange things to make this faster, by avoiding function calls, pulling the section handling out of the separate loop, and handling the border-width special case in a neater way. Before: 50 runs, min 12.45, max 20.419, avg 15.9414 After: 50 runs, min 12.622, max 21.195, avg 15.0449
Diffstat (limited to 'gtk/gtkcsslookupprivate.h')
-rw-r--r--gtk/gtkcsslookupprivate.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/gtk/gtkcsslookupprivate.h b/gtk/gtkcsslookupprivate.h
index 34acd504c3..3e9915d4d4 100644
--- a/gtk/gtkcsslookupprivate.h
+++ b/gtk/gtkcsslookupprivate.h
@@ -37,6 +37,7 @@ typedef struct {
struct _GtkCssLookup {
guint n_set_values;
+ gboolean has_section;
GtkCssLookupValue values[GTK_CSS_PROPERTY_N_PROPERTIES];
};
@@ -49,10 +50,6 @@ void _gtk_css_lookup_set (GtkCssLookup
guint id,
GtkCssSection *section,
GtkCssValue *value);
-void _gtk_css_lookup_resolve (GtkCssLookup *lookup,
- GtkStyleProvider *provider,
- GtkCssStaticStyle *style,
- GtkCssStyle *parent_style);
G_END_DECLS