From e2e28db7deb762830bf3a3d178a561b8e683ff8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 22 Jul 2021 23:27:10 +0200 Subject: [PATCH] render: render_osd(): fix rendering of color bitmap glyphs --- render.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/render.c b/render.c index d5e7a7d6..1f8c5809 100644 --- a/render.c +++ b/render.c @@ -1606,12 +1606,17 @@ render_osd(struct terminal *term, if (glyph == NULL) continue; - pixman_image_t *src = pixman_image_create_solid_fill(&fg); - pixman_image_composite32( - PIXMAN_OP_OVER, src, glyph->pix, buf->pix[0], 0, 0, 0, 0, - x + x_ofs + glyph->x, y + term->font_y_ofs + font->ascent - glyph->y, - glyph->width, glyph->height); - pixman_image_unref(src); + if (pixman_image_get_format(glyph->pix) == PIXMAN_a8r8g8b8) { + pixman_image_composite32( + PIXMAN_OP_OVER, glyph->pix, NULL, buf->pix[0], 0, 0, 0, 0, + x + x_ofs + glyph->x, y + term->font_y_ofs + font->ascent - glyph->y, + glyph->width, glyph->height); + } else { + pixman_image_composite32( + PIXMAN_OP_OVER, src, glyph->pix, buf->pix[0], 0, 0, 0, 0, + x + x_ofs + glyph->x, y + term->font_y_ofs + font->ascent - glyph->y, + glyph->width, glyph->height); + } x += glyph->advance.x; }