diff options
author | Timm Bäder <mail@baedert.org> | 2020-01-11 13:40:13 +0100 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2020-01-18 08:49:51 +0100 |
commit | 24d8c0a7dccc12edc97753049c1b7765dd4d5a27 (patch) | |
tree | ae438868d480f52b0d8b9eadf7ce185446b3362c /gtk/gtkcssenumvalue.c | |
parent | ba08f5e67da5dcb0bb68e23f50c37091846ce682 (diff) | |
download | gtk+-24d8c0a7dccc12edc97753049c1b7765dd4d5a27.tar.gz |
css: Set the is_computed flag for more values
With these changes, we skip roughly 85% of compute() calls during
widget-factory startup
Diffstat (limited to 'gtk/gtkcssenumvalue.c')
-rw-r--r-- | gtk/gtkcssenumvalue.c | 77 |
1 files changed, 40 insertions, 37 deletions
diff --git a/gtk/gtkcssenumvalue.c b/gtk/gtkcssenumvalue.c index 90e84834b4..d558964fc9 100644 --- a/gtk/gtkcssenumvalue.c +++ b/gtk/gtkcssenumvalue.c @@ -355,9 +355,9 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_STYLE = { }; static GtkCssValue font_style_values[] = { - { >K_CSS_VALUE_FONT_STYLE, 1, FALSE, PANGO_STYLE_NORMAL, "normal" }, - { >K_CSS_VALUE_FONT_STYLE, 1, FALSE, PANGO_STYLE_OBLIQUE, "oblique" }, - { >K_CSS_VALUE_FONT_STYLE, 1, FALSE, PANGO_STYLE_ITALIC, "italic" } + { >K_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO_STYLE_NORMAL, "normal" }, + { >K_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO_STYLE_OBLIQUE, "oblique" }, + { >K_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO_STYLE_ITALIC, "italic" } }; GtkCssValue * @@ -504,15 +504,15 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_STRETCH = { }; static GtkCssValue font_stretch_values[] = { - { >K_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_ULTRA_CONDENSED, "ultra-condensed" }, - { >K_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_EXTRA_CONDENSED, "extra-condensed" }, - { >K_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_CONDENSED, "condensed" }, - { >K_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_SEMI_CONDENSED, "semi-condensed" }, - { >K_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_NORMAL, "normal" }, - { >K_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_SEMI_EXPANDED, "semi-expanded" }, - { >K_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_EXPANDED, "expanded" }, - { >K_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_EXTRA_EXPANDED, "extra-expanded" }, - { >K_CSS_VALUE_FONT_STRETCH, 1, FALSE, PANGO_STRETCH_ULTRA_EXPANDED, "ultra-expanded" }, + { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_ULTRA_CONDENSED, "ultra-condensed" }, + { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_EXTRA_CONDENSED, "extra-condensed" }, + { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_CONDENSED, "condensed" }, + { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_SEMI_CONDENSED, "semi-condensed" }, + { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_NORMAL, "normal" }, + { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_SEMI_EXPANDED, "semi-expanded" }, + { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_EXPANDED, "expanded" }, + { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_EXTRA_EXPANDED, "extra-expanded" }, + { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_ULTRA_EXPANDED, "ultra-expanded" }, }; GtkCssValue * @@ -561,9 +561,9 @@ static const GtkCssValueClass GTK_CSS_VALUE_TEXT_DECORATION_LINE = { }; static GtkCssValue text_decoration_line_values[] = { - { >K_CSS_VALUE_TEXT_DECORATION_LINE, 1, FALSE, GTK_CSS_TEXT_DECORATION_LINE_NONE, "none" }, - { >K_CSS_VALUE_TEXT_DECORATION_LINE, 1, FALSE, GTK_CSS_TEXT_DECORATION_LINE_UNDERLINE, "underline" }, - { >K_CSS_VALUE_TEXT_DECORATION_LINE, 1, FALSE, GTK_CSS_TEXT_DECORATION_LINE_LINE_THROUGH, "line-through" }, + { >K_CSS_VALUE_TEXT_DECORATION_LINE, 1, TRUE, GTK_CSS_TEXT_DECORATION_LINE_NONE, "none" }, + { >K_CSS_VALUE_TEXT_DECORATION_LINE, 1, TRUE, GTK_CSS_TEXT_DECORATION_LINE_UNDERLINE, "underline" }, + { >K_CSS_VALUE_TEXT_DECORATION_LINE, 1, TRUE, GTK_CSS_TEXT_DECORATION_LINE_LINE_THROUGH, "line-through" }, }; GtkCssValue * @@ -612,9 +612,9 @@ static const GtkCssValueClass GTK_CSS_VALUE_TEXT_DECORATION_STYLE = { }; static GtkCssValue text_decoration_style_values[] = { - { >K_CSS_VALUE_TEXT_DECORATION_STYLE, 1, FALSE, GTK_CSS_TEXT_DECORATION_STYLE_SOLID, "solid" }, - { >K_CSS_VALUE_TEXT_DECORATION_STYLE, 1, FALSE, GTK_CSS_TEXT_DECORATION_STYLE_DOUBLE, "double" }, - { >K_CSS_VALUE_TEXT_DECORATION_STYLE, 1, FALSE, GTK_CSS_TEXT_DECORATION_STYLE_WAVY, "wavy" }, + { >K_CSS_VALUE_TEXT_DECORATION_STYLE, 1, TRUE, GTK_CSS_TEXT_DECORATION_STYLE_SOLID, "solid" }, + { >K_CSS_VALUE_TEXT_DECORATION_STYLE, 1, TRUE, GTK_CSS_TEXT_DECORATION_STYLE_DOUBLE, "double" }, + { >K_CSS_VALUE_TEXT_DECORATION_STYLE, 1, TRUE, GTK_CSS_TEXT_DECORATION_STYLE_WAVY, "wavy" }, }; GtkCssValue * @@ -720,10 +720,10 @@ static const GtkCssValueClass GTK_CSS_VALUE_DIRECTION = { }; static GtkCssValue direction_values[] = { - { >K_CSS_VALUE_DIRECTION, 1, FALSE, GTK_CSS_DIRECTION_NORMAL, "normal" }, - { >K_CSS_VALUE_DIRECTION, 1, FALSE, GTK_CSS_DIRECTION_REVERSE, "reverse" }, - { >K_CSS_VALUE_DIRECTION, 1, FALSE, GTK_CSS_DIRECTION_ALTERNATE, "alternate" }, - { >K_CSS_VALUE_DIRECTION, 1, FALSE, GTK_CSS_DIRECTION_ALTERNATE_REVERSE, "alternate-reverse" } + { >K_CSS_VALUE_DIRECTION, 1, TRUE, GTK_CSS_DIRECTION_NORMAL, "normal" }, + { >K_CSS_VALUE_DIRECTION, 1, TRUE, GTK_CSS_DIRECTION_REVERSE, "reverse" }, + { >K_CSS_VALUE_DIRECTION, 1, TRUE, GTK_CSS_DIRECTION_ALTERNATE, "alternate" }, + { >K_CSS_VALUE_DIRECTION, 1, TRUE, GTK_CSS_DIRECTION_ALTERNATE_REVERSE, "alternate-reverse" } }; GtkCssValue * @@ -952,9 +952,9 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_KERNING = { }; static GtkCssValue font_kerning_values[] = { - { >K_CSS_VALUE_FONT_KERNING, 1, FALSE, GTK_CSS_FONT_KERNING_AUTO, "auto" }, - { >K_CSS_VALUE_FONT_KERNING, 1, FALSE, GTK_CSS_FONT_KERNING_NORMAL, "normal" }, - { >K_CSS_VALUE_FONT_KERNING, 1, FALSE, GTK_CSS_FONT_KERNING_NONE, "none" } + { >K_CSS_VALUE_FONT_KERNING, 1, TRUE, GTK_CSS_FONT_KERNING_AUTO, "auto" }, + { >K_CSS_VALUE_FONT_KERNING, 1, TRUE, GTK_CSS_FONT_KERNING_NORMAL, "normal" }, + { >K_CSS_VALUE_FONT_KERNING, 1, TRUE, GTK_CSS_FONT_KERNING_NONE, "none" } }; GtkCssValue * @@ -1009,9 +1009,9 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_VARIANT_POSITION = { }; static GtkCssValue font_variant_position_values[] = { - { >K_CSS_VALUE_FONT_VARIANT_POSITION, 1, FALSE, GTK_CSS_FONT_VARIANT_POSITION_NORMAL, "normal" }, - { >K_CSS_VALUE_FONT_VARIANT_POSITION, 1, FALSE, GTK_CSS_FONT_VARIANT_POSITION_SUB, "sub" }, - { >K_CSS_VALUE_FONT_VARIANT_POSITION, 1, FALSE, GTK_CSS_FONT_VARIANT_POSITION_SUPER, "super" } + { >K_CSS_VALUE_FONT_VARIANT_POSITION, 1, TRUE, GTK_CSS_FONT_VARIANT_POSITION_NORMAL, "normal" }, + { >K_CSS_VALUE_FONT_VARIANT_POSITION, 1, TRUE, GTK_CSS_FONT_VARIANT_POSITION_SUB, "sub" }, + { >K_CSS_VALUE_FONT_VARIANT_POSITION, 1, TRUE, GTK_CSS_FONT_VARIANT_POSITION_SUPER, "super" } }; GtkCssValue * @@ -1066,13 +1066,13 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_VARIANT_CAPS = { }; static GtkCssValue font_variant_caps_values[] = { - { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_NORMAL, "normal" }, - { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_SMALL_CAPS, "small-caps" }, - { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_ALL_SMALL_CAPS, "all-small-caps" }, - { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_PETITE_CAPS, "petite-caps" }, - { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_ALL_PETITE_CAPS, "all-petite-caps" }, - { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_UNICASE, "unicase" }, - { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, FALSE, GTK_CSS_FONT_VARIANT_CAPS_TITLING_CAPS, "titling-caps" } + { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_NORMAL, "normal" }, + { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_SMALL_CAPS, "small-caps" }, + { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_ALL_SMALL_CAPS, "all-small-caps" }, + { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_PETITE_CAPS, "petite-caps" }, + { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_ALL_PETITE_CAPS, "all-petite-caps" }, + { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_UNICASE, "unicase" }, + { >K_CSS_VALUE_FONT_VARIANT_CAPS, 1, TRUE, GTK_CSS_FONT_VARIANT_CAPS_TITLING_CAPS, "titling-caps" } }; GtkCssValue * @@ -1127,8 +1127,8 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_VARIANT_ALTERNATE = { }; static GtkCssValue font_variant_alternate_values[] = { - { >K_CSS_VALUE_FONT_VARIANT_ALTERNATE, 1, FALSE, GTK_CSS_FONT_VARIANT_ALTERNATE_NORMAL, "normal" }, - { >K_CSS_VALUE_FONT_VARIANT_ALTERNATE, 1, FALSE, GTK_CSS_FONT_VARIANT_ALTERNATE_HISTORICAL_FORMS, "historical-forms" } + { >K_CSS_VALUE_FONT_VARIANT_ALTERNATE, 1, TRUE, GTK_CSS_FONT_VARIANT_ALTERNATE_NORMAL, "normal" }, + { >K_CSS_VALUE_FONT_VARIANT_ALTERNATE, 1, TRUE, GTK_CSS_FONT_VARIANT_ALTERNATE_HISTORICAL_FORMS, "historical-forms" } }; GtkCssValue * @@ -1271,6 +1271,7 @@ _gtk_css_font_variant_ligature_value_new (GtkCssFontVariantLigature ligatures) value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_VARIANT_LIGATURE); value->value = ligatures; value->name = NULL; + value->is_computed = TRUE; return value; } @@ -1374,6 +1375,7 @@ _gtk_css_font_variant_numeric_value_new (GtkCssFontVariantNumeric numeric) value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_VARIANT_NUMERIC); value->value = numeric; value->name = NULL; + value->is_computed = TRUE; return value; } @@ -1517,6 +1519,7 @@ _gtk_css_font_variant_east_asian_value_new (GtkCssFontVariantEastAsian east_asia value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_FONT_VARIANT_EAST_ASIAN); value->value = east_asian; value->name = NULL; + value->is_computed = TRUE; return value; } |