sixel: get rid of an ‘imul’ in sixel_add()

By storing the current row’s byte offset into the backing image in the
terminal struct.

This replaces the ‘imul’ with a load, which can potentially be
slow. But, this data should already be in the cache.
This commit is contained in:
Daniel Eklöf 2021-03-06 22:05:40 +01:00
parent dfdb42138d
commit 8c65c68b73
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 5 additions and 2 deletions

View file

@ -521,6 +521,7 @@ struct terminal {
} state;
struct coord pos; /* Current sixel coordinate */
size_t row_byte_ofs; /* Byte position into image, for current row */
int color_idx; /* Current palette index */
int max_col; /* Largest column index we've seen (aka the image width) */
uint32_t *private_palette; /* Private palette, used when private mode 1070 is enabled */