diff options
author | Benjamin Otte <otte@redhat.com> | 2020-01-26 04:37:17 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2020-01-28 02:17:03 +0100 |
commit | 170130f1d9c15e4274a24b9327fe01d36ad84290 (patch) | |
tree | 0a07692fba8a8b378ed08095480b7e5885fc3dd1 /gtk/gtkcsstransientnode.c | |
parent | 6aac56e144e1088565db7d29591fc0bd9e3e509d (diff) | |
download | gtk+-170130f1d9c15e4274a24b9327fe01d36ad84290.tar.gz |
css: Add fast-path for parent selector matching
Add a fast path for parent selector matching that uses a bloom filter to
quickly discard selectors that can't possibly match.
Keep in mind that we match using a bloom filter, so we might
accidentally include too many selectors when hash/bucket collisions
occur.
That's not a correctness problem though, because we'll do a real check
afterwards.
The idea for this change is taken from browsers, in particular WebKit.
Diffstat (limited to 'gtk/gtkcsstransientnode.c')
-rw-r--r-- | gtk/gtkcsstransientnode.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gtk/gtkcsstransientnode.c b/gtk/gtkcsstransientnode.c index 218358005d..5c8373c862 100644 --- a/gtk/gtkcsstransientnode.c +++ b/gtk/gtkcsstransientnode.c @@ -23,13 +23,14 @@ G_DEFINE_TYPE (GtkCssTransientNode, gtk_css_transient_node, GTK_TYPE_CSS_NODE) static GtkCssStyle * -gtk_css_transient_node_update_style (GtkCssNode *cssnode, - GtkCssChange change, - gint64 timestamp, - GtkCssStyle *style) +gtk_css_transient_node_update_style (GtkCssNode *cssnode, + const GtkCountingBloomFilter *filter, + GtkCssChange change, + gint64 timestamp, + GtkCssStyle *style) { /* This should get rid of animations */ - return GTK_CSS_NODE_CLASS (gtk_css_transient_node_parent_class)->update_style (cssnode, change, 0, style); + return GTK_CSS_NODE_CLASS (gtk_css_transient_node_parent_class)->update_style (cssnode, filter, change, 0, style); } static void |