diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-12-05 10:59:41 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-12-07 19:44:13 +0000 |
| commit | dca35215d079d11f0138a4cd2c98b76b39524a20 (patch) | |
| tree | a6cb1fdb8980766b943246e756063973b5a29a48 /render.c | |
| parent | ime: commit text using search_add_chars() while in scrollback search mode (diff) | |
render: search: render colorized glyphs (emojis) correctly
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -2184,12 +2184,20 @@ render_search_box(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 + glyph->x, y + font_baseline(term) - glyph->y, + if (unlikely(pixman_image_get_format(glyph->pix) == PIXMAN_a8r8g8b8)) { + /* Glyph surface is a pre-rendered image (typically a color emoji...) */ + pixman_image_composite32( + PIXMAN_OP_OVER, glyph->pix, NULL, buf->pix[0], 0, 0, 0, 0, + x + glyph->x, y + font_baseline(term) - glyph->y, + glyph->width, glyph->height); + } else { + 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 + glyph->x, y + font_baseline(term) - glyph->y, glyph->width, glyph->height); - pixman_image_unref(src); + pixman_image_unref(src); + } x += term->cell_width; } |
