Fast and reasonably complete (framebuffer) terminal emulator (Zig fork)

Framebuffer scroll routines optimisation

mintsuki 1c84266b 47a29288

Changed files
+4 -6
backends
+4 -6
backends/framebuffer.c
···
empty.c = ' ';
empty.fg = ctx->text_fg;
empty.bg = ctx->text_bg;
-
for (size_t i = _ctx->scroll_top_margin * _ctx->cols;
-
i < (_ctx->scroll_top_margin + 1) * _ctx->cols; i++) {
-
push_to_queue(_ctx, &empty, i % _ctx->cols, i / _ctx->cols);
+
for (size_t i = 0; i < _ctx->cols; i++) {
+
push_to_queue(_ctx, &empty, i, _ctx->scroll_top_margin);
}
}
···
empty.c = ' ';
empty.fg = ctx->text_fg;
empty.bg = ctx->text_bg;
-
for (size_t i = (_ctx->scroll_bottom_margin - 1) * _ctx->cols;
-
i < _ctx->scroll_bottom_margin * _ctx->cols; i++) {
-
push_to_queue(_ctx, &empty, i % _ctx->cols, i / _ctx->cols);
+
for (size_t i = 0; i < _ctx->cols; i++) {
+
push_to_queue(_ctx, &empty, i, _ctx->scroll_bottom_margin - 1);
}
}