aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-05-02 20:14:48 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-05-02 20:14:48 +0000
commitef637fb5e8922531d9f0e6c03dbd1bd117289dc2 (patch)
tree4f66019eb296eff245a7e7965122fae66c5d64c2
parentvt: use signed integers to correctly detect when we're done (diff)
render: don't re-instantiate the foreground pixman source
-rw-r--r--render.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/render.c b/render.c
index f2fa6c36..328f793b 100644
--- a/render.c
+++ b/render.c
@@ -422,6 +422,8 @@ render_cell(struct terminal *term, pixman_image_t *pix,
if (cell->wc == 0 || cell->attrs.conceal)
goto draw_cursor;
+ pixman_image_t *clr_pix = pixman_image_create_solid_fill(&fg);
+
if (glyph != NULL) {
if (unlikely(pixman_image_get_format(glyph->pix) == PIXMAN_a8r8g8b8)) {
/* Glyph surface is a pre-rendered image (typically a color emoji...) */
@@ -433,12 +435,10 @@ render_cell(struct terminal *term, pixman_image_t *pix,
}
} else {
/* Glyph surface is an alpha mask */
- pixman_image_t *src = pixman_image_create_solid_fill(&fg);
pixman_image_composite32(
- PIXMAN_OP_OVER, src, glyph->pix, pix, 0, 0, 0, 0,
+ PIXMAN_OP_OVER, clr_pix, glyph->pix, pix, 0, 0, 0, 0,
x + glyph->x, y + font_baseline(term) - glyph->y,
glyph->width, glyph->height);
- pixman_image_unref(src);
}
}
@@ -452,17 +452,16 @@ render_cell(struct terminal *term, pixman_image_t *pix,
if (g == NULL)
continue;
- pixman_image_t *src = pixman_image_create_solid_fill(&fg);
pixman_image_composite32(
- PIXMAN_OP_OVER, src, g->pix, pix, 0, 0, 0, 0,
+ PIXMAN_OP_OVER, clr_pix, g->pix, pix, 0, 0, 0, 0,
/* Some fonts use a negative offset, while others use a
* "normal" offset */
x + (g->x < 0 ? term->cell_width : 0) + g->x,
y + font_baseline(term) - g->y,
g->width, g->height);
- pixman_image_unref(src);
}
#endif
+ pixman_image_unref(clr_pix);
/* Underline */
if (cell->attrs.underline) {