aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-05-05 12:59:53 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-05-17 15:58:29 +0000
commit8d09ba5bd2f8843232d25fc93acfcccd3513f1bd (patch)
tree1ae98c589113c48b63e783c6db8e996bf192cb9a
parentMerge branch 'reflow-performane-no-new-row-initialization' (diff)
box-drawing: include pixman image in the buffer we’re passing around
-rw-r--r--box-drawing.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/box-drawing.c b/box-drawing.c
index 5701bf46..2e387582 100644
--- a/box-drawing.c
+++ b/box-drawing.c
@@ -20,6 +20,7 @@ enum thickness {
struct buf {
uint8_t *data;
+ pixman_image_t *pix;
int width;
int height;
int stride;
@@ -2278,11 +2279,13 @@ box_drawing(const struct terminal *term, wchar_t wc)
{
int width = term->cell_width;
int height = term->cell_height;
- int stride = stride_for_format_and_width(PIXMAN_a1, width);
+ pixman_format_code_t fmt = PIXMAN_a1; /* TODO: use a8 when antialiasing=true */
+
+ int stride = stride_for_format_and_width(fmt, width);
uint8_t *data = xcalloc(height * stride, 1);
pixman_image_t *pix = pixman_image_create_bits_no_clear(
- PIXMAN_a1, width, height, (uint32_t*)data, stride);
+ fmt, width, height, (uint32_t*)data, stride);
if (pix == NULL) {
errno = ENOMEM;
@@ -2292,6 +2295,7 @@ box_drawing(const struct terminal *term, wchar_t wc)
struct buf buf = {
.data = data,
+ .pix = pix,
.width = width,
.height = height,
.stride = stride,