sixel: add local function sixel_insert()

Replace all tll_push_*() calls with calls to this function.
This commit is contained in:
Daniel Eklöf 2020-06-28 08:37:25 +02:00
parent deb61d20d8
commit 247e0c42d3
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

10
sixel.c
View file

@ -87,6 +87,12 @@ sixel_erase(struct terminal *term, struct sixel *sixel)
sixel_destroy(sixel);
}
static void
sixel_insert(struct terminal *term, struct sixel sixel)
{
tll_push_back(term->grid->sixel_images, sixel);
}
/* Row numbers are absolute */
static void
sixel_delete_at_point(struct terminal *term, int row, int col)
@ -284,7 +290,7 @@ sixel_overwrite(struct terminal *term, struct sixel *six,
PIXMAN_a8r8g8b8,
imgs[i].width, imgs[i].height,
imgs[i].data, imgs[i].width * sizeof(uint32_t));
tll_push_front(term->grid->sixel_images, imgs[i]);
sixel_insert(term, imgs[i]);
}
}
@ -464,7 +470,7 @@ sixel_unhook(struct terminal *term)
term_formfeed(term);
render_refresh(term);
tll_push_back(term->grid->sixel_images, image);
sixel_insert(term, image);
pixel_row_idx += height;
pixel_rows_left -= height;