[gtk/css-lookup-caching: 84/96] cssnode: Reused cached lookups
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/css-lookup-caching: 84/96] cssnode: Reused cached lookups
- Date: Fri, 14 Feb 2020 02:20:27 +0000 (UTC)
commit c0682f3046d1138d7b3167f350df30f3c38e3457
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Feb 10 19:32:25 2020 -0500
cssnode: Reused cached lookups
When we determine that the lookup won't change,
reuse the cached lookup by passing it to
to gtk_css_static_style_new_compute.
gtk/gtkcssnode.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index 389eb4d722..c4c9c79909 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -364,6 +364,7 @@ gtk_css_node_create_style (GtkCssNode *cssnode,
const GtkCssNodeDeclaration *decl;
GtkCssStyle *style;
GtkCssChange style_change;
+ GtkCssLookup *lookup;
style_change = gtk_css_static_style_get_change (GTK_CSS_STATIC_STYLE (static_style));
@@ -378,13 +379,19 @@ gtk_css_node_create_style (GtkCssNode *cssnode,
created_styles++;
- if (change & GTK_CSS_CHANGE_NEEDS_RECOMPUTE)
+ if ((change & GTK_CSS_CHANGE_SOURCE) == 0 &&
+ (change & style_change) == 0)
+ lookup = gtk_css_static_style_get_lookup (GTK_CSS_STATIC_STYLE (static_style));
+ else
+ lookup = NULL;
+
+ if ((change & GTK_CSS_CHANGE_NEEDS_RECOMPUTE) != 0)
style_change = 0;
style = gtk_css_static_style_new_compute (gtk_css_node_get_style_provider (cssnode),
filter,
cssnode,
- NULL,
+ lookup,
style_change);
store_in_global_parent_cache (cssnode, decl, style);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]