aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-12-05 10:59:41 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-12-07 19:44:13 +0000
commitdca35215d079d11f0138a4cd2c98b76b39524a20 (patch)
treea6cb1fdb8980766b943246e756063973b5a29a48 /render.c
parentime: 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.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/render.c b/render.c
index 24e4c6c4..565e8878 100644
--- a/render.c
+++ b/render.c
@@ -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;
}