diff options
author | Hugo Osvaldo Barrera <hugo@barrera.io> | 2022-07-01 12:23:04 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2022-07-01 13:05:58 +0200 |
commit | 80e386fd97c0da00970f0acc007574151048cfbf (patch) | |
tree | df11d53184b20e3f1afe86b8272420349fd9b552 /sway/tree/container.c | |
parent | Reject font values that are invalid for pango (diff) | |
download | sway-80e386fd97c0da00970f0acc007574151048cfbf.tar.gz sway-80e386fd97c0da00970f0acc007574151048cfbf.tar.zst sway-80e386fd97c0da00970f0acc007574151048cfbf.zip |
Reuse parsed PangoFontDescription
Avoids parsing the configured font each time text is rendered.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 09766ce5..04ef965f 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c | |||
@@ -520,7 +520,7 @@ static void render_titlebar_text_texture(struct sway_output *output, | |||
520 | to_cairo_subpixel_order(output->wlr_output->subpixel)); | 520 | to_cairo_subpixel_order(output->wlr_output->subpixel)); |
521 | } | 521 | } |
522 | cairo_set_font_options(c, fo); | 522 | cairo_set_font_options(c, fo); |
523 | get_text_size(c, config->font, &width, NULL, &baseline, scale, | 523 | get_text_size(c, config->font_description, &width, NULL, &baseline, scale, |
524 | config->pango_markup, "%s", text); | 524 | config->pango_markup, "%s", text); |
525 | cairo_surface_destroy(dummy_surface); | 525 | cairo_surface_destroy(dummy_surface); |
526 | cairo_destroy(c); | 526 | cairo_destroy(c); |
@@ -554,7 +554,7 @@ static void render_titlebar_text_texture(struct sway_output *output, | |||
554 | class->text[2], class->text[3]); | 554 | class->text[2], class->text[3]); |
555 | cairo_move_to(cairo, 0, config->font_baseline * scale - baseline); | 555 | cairo_move_to(cairo, 0, config->font_baseline * scale - baseline); |
556 | 556 | ||
557 | render_text(cairo, config->font, scale, pango_markup, "%s", text); | 557 | render_text(cairo, config->font_description, scale, pango_markup, "%s", text); |
558 | 558 | ||
559 | cairo_surface_flush(surface); | 559 | cairo_surface_flush(surface); |
560 | unsigned char *data = cairo_image_surface_get_data(surface); | 560 | unsigned char *data = cairo_image_surface_get_data(surface); |