mirror of
https://github.com/mintsuki/flanterm
synced 2024-11-30 08:33:21 +03:00
Terminal optimization option added : flanterm_toggle_masking() (#9)
* Terminal optimization option added : flanterm_toggle_masking() * Terminal optimization option added * error correction --------- Co-authored-by: ernestbedight <bob@bedight.localdomain>
This commit is contained in:
parent
845df221dd
commit
f946bd77ab
@ -476,7 +476,7 @@ static void plot_char(struct flanterm_context *_ctx, struct flanterm_fb_char *c,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void plot_char_fast(struct flanterm_context *_ctx, struct flanterm_fb_char *old, struct flanterm_fb_char *c, size_t x, size_t y) {
|
static void plot_char_masked(struct flanterm_context *_ctx, struct flanterm_fb_char *old, struct flanterm_fb_char *c, size_t x, size_t y) {
|
||||||
struct flanterm_fb_context *ctx = (void *)_ctx;
|
struct flanterm_fb_context *ctx = (void *)_ctx;
|
||||||
|
|
||||||
if (x >= _ctx->cols || y >= _ctx->rows) {
|
if (x >= _ctx->cols || y >= _ctx->rows) {
|
||||||
@ -765,11 +765,16 @@ static void flanterm_fb_double_buffer_flush(struct flanterm_context *_ctx) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
struct flanterm_fb_char *old = &ctx->grid[offset];
|
struct flanterm_fb_char *old = &ctx->grid[offset];
|
||||||
if (q->c.bg == old->bg && q->c.fg == old->fg) {
|
#ifdef FLANTERM_FB_ENABLE_MASKING
|
||||||
plot_char_fast(_ctx, old, &q->c, q->x, q->y);
|
if (q->c.bg == old->bg && q->c.fg == old->fg) {
|
||||||
} else {
|
plot_char_masked(_ctx, old, &q->c, q->x, q->y);
|
||||||
|
} else {
|
||||||
|
plot_char(_ctx, &q->c, q->x, q->y);
|
||||||
|
}
|
||||||
|
#else
|
||||||
plot_char(_ctx, &q->c, q->x, q->y);
|
plot_char(_ctx, &q->c, q->x, q->y);
|
||||||
}
|
#endif
|
||||||
|
|
||||||
ctx->grid[offset] = q->c;
|
ctx->grid[offset] = q->c;
|
||||||
ctx->map[offset] = NULL;
|
ctx->map[offset] = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user