mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-18 22:05:25 -05:00
render: render_osd(): don’t re-instantiate foreground color for each glyph
This commit is contained in:
parent
5c683d2c08
commit
bf285ae00a
1 changed files with 2 additions and 0 deletions
2
render.c
2
render.c
|
|
@ -1597,6 +1597,7 @@ render_osd(struct terminal *term,
|
||||||
pixman_color_t fg = color_hex_to_pixman(_fg);
|
pixman_color_t fg = color_hex_to_pixman(_fg);
|
||||||
const int x_ofs = term->font_x_ofs;
|
const int x_ofs = term->font_x_ofs;
|
||||||
|
|
||||||
|
pixman_image_t *src = pixman_image_create_solid_fill(&fg);
|
||||||
|
|
||||||
for (size_t i = 0; i < wcslen(text); i++) {
|
for (size_t i = 0; i < wcslen(text); i++) {
|
||||||
const struct fcft_glyph *glyph = fcft_glyph_rasterize(
|
const struct fcft_glyph *glyph = fcft_glyph_rasterize(
|
||||||
|
|
@ -1615,6 +1616,7 @@ render_osd(struct terminal *term,
|
||||||
x += glyph->advance.x;
|
x += glyph->advance.x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pixman_image_unref(src);
|
||||||
pixman_image_set_clip_region32(buf->pix[0], NULL);
|
pixman_image_set_clip_region32(buf->pix[0], NULL);
|
||||||
|
|
||||||
xassert(buf->width % term->scale == 0);
|
xassert(buf->width % term->scale == 0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue