From: Timm Bäder Date: Sat, 11 Jan 2020 11:56:40 +0000 (+0100) Subject: cssvalue: Don't call compute() for already computed css values X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~20^2~288 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ba08f5e67da5dcb0bb68e23f50c37091846ce682;p=gtk4.git cssvalue: Don't call compute() for already computed css values As per the previous commit, this is unnecessary. Even with the small amount of css values we mark as is_computed, we already skip computing over 60% of them like this during the startup of the widget factory. --- diff --git a/gtk/gtkcssvalue.c b/gtk/gtkcssvalue.c index 25554be6b3..87deca7545 100644 --- a/gtk/gtkcssvalue.c +++ b/gtk/gtkcssvalue.c @@ -140,6 +140,9 @@ _gtk_css_value_compute (GtkCssValue *value, GtkCssStyle *style, GtkCssStyle *parent_style) { + if (gtk_css_value_is_computed (value)) + return _gtk_css_value_ref (value); + return value->class->compute (value, property_id, provider, style, parent_style); }