render: render_osd(): fix rendering of color bitmap glyphs

This commit is contained in:
Daniel Eklöf 2021-07-22 23:27:10 +02:00
parent bf285ae00a
commit e2e28db7de
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1606,12 +1606,17 @@ render_osd(struct terminal *term,
if (glyph == NULL) if (glyph == NULL)
continue; continue;
pixman_image_t *src = pixman_image_create_solid_fill(&fg); if (pixman_image_get_format(glyph->pix) == PIXMAN_a8r8g8b8) {
pixman_image_composite32( pixman_image_composite32(
PIXMAN_OP_OVER, src, glyph->pix, buf->pix[0], 0, 0, 0, 0, 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, x + x_ofs + glyph->x, y + term->font_y_ofs + font->ascent - glyph->y,
glyph->width, glyph->height); glyph->width, glyph->height);
pixman_image_unref(src); } 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; x += glyph->advance.x;
} }