aboutsummaryrefslogtreecommitdiff
path: root/tmux.h
diff options
context:
space:
mode:
authornicm <nicm>2017-02-08 16:45:18 +0000
committernicm <nicm>2017-02-08 16:45:18 +0000
commit13a0b6bb3fe05454cace81f5ec7624f6fd9021a5 (patch)
tree5b61257ae5a17983cc848ca01c1364d77f7dff7e /tmux.h
parentd4b006b9faf001de41560db2e8fb890c654598e2 (diff)
downloadrtmux-13a0b6bb3fe05454cace81f5ec7624f6fd9021a5.tar.gz
rtmux-13a0b6bb3fe05454cace81f5ec7624f6fd9021a5.tar.bz2
rtmux-13a0b6bb3fe05454cace81f5ec7624f6fd9021a5.zip
Collect sequences of printable ASCII characters and process them
together instead of handling them one by one. This is significantly faster. Sequences are terminated when we reach the end of the line, fill the internal buffer, or a different character is seen by the input parser (an escape sequence, or UTF-8). Rather than writing collected sequences out immediately, hold them until it is necessary (another screen modification, or we consume all available data). This means we can discard changes that would have no effect (for example, lines that would just be scrolled off the screen or cleared). This reduces the total amount of data we write out to the terminal - not important for fast terminals, but a big help with slow (like xterm).
Diffstat (limited to 'tmux.h')
-rw-r--r--tmux.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/tmux.h b/tmux.h
index f9f60e6a..06142164 100644
--- a/tmux.h
+++ b/tmux.h
@@ -651,17 +651,18 @@ struct screen {
bitstr_t *tabs;
- bitstr_t *dirty;
- u_int dirtysize;
-
struct screen_sel sel;
};
/* Screen write context. */
+struct screen_write_collect_item;
+struct screen_write_collect_line;
struct screen_write_ctx {
struct window_pane *wp;
struct screen *s;
- u_int dirty;
+
+ struct screen_write_collect_item *item;
+ struct screen_write_collect_line *list;
u_int cells;
u_int written;
@@ -1042,7 +1043,7 @@ struct tty {
struct grid_cell cell;
- int last_wp;
+ int last_wp;
struct grid_cell last_cell;
#define TTY_NOCURSOR 0x1
@@ -1643,6 +1644,7 @@ void tty_write(void (*)(struct tty *, const struct tty_ctx *),
struct tty_ctx *);
void tty_cmd_alignmenttest(struct tty *, const struct tty_ctx *);
void tty_cmd_cell(struct tty *, const struct tty_ctx *);
+void tty_cmd_cells(struct tty *, const struct tty_ctx *);
void tty_cmd_clearendofline(struct tty *, const struct tty_ctx *);
void tty_cmd_clearendofscreen(struct tty *, const struct tty_ctx *);
void tty_cmd_clearline(struct tty *, const struct tty_ctx *);
@@ -1911,6 +1913,8 @@ void grid_clear_history(struct grid *);
const struct grid_line *grid_peek_line(struct grid *, u_int);
void grid_get_cell(struct grid *, u_int, u_int, struct grid_cell *);
void grid_set_cell(struct grid *, u_int, u_int, const struct grid_cell *);
+void grid_set_cells(struct grid *, u_int, u_int, const struct grid_cell *,
+ const char *, size_t);
void grid_clear(struct grid *, u_int, u_int, u_int, u_int, u_int);
void grid_clear_lines(struct grid *, u_int, u_int, u_int);
void grid_move_lines(struct grid *, u_int, u_int, u_int, u_int);
@@ -1925,6 +1929,8 @@ u_int grid_reflow(struct grid *, struct grid *, u_int);
void grid_view_get_cell(struct grid *, u_int, u_int, struct grid_cell *);
void grid_view_set_cell(struct grid *, u_int, u_int,
const struct grid_cell *);
+void grid_view_set_cells(struct grid *, u_int, u_int,
+ const struct grid_cell *, const char *, size_t);
void grid_view_clear_history(struct grid *, u_int);
void grid_view_clear(struct grid *, u_int, u_int, u_int, u_int, u_int);
void grid_view_scroll_region_up(struct grid *, u_int, u_int);
@@ -1983,6 +1989,9 @@ void screen_write_clearendofscreen(struct screen_write_ctx *, u_int);
void screen_write_clearstartofscreen(struct screen_write_ctx *, u_int);
void screen_write_clearscreen(struct screen_write_ctx *, u_int);
void screen_write_clearhistory(struct screen_write_ctx *);
+void screen_write_collect_end(struct screen_write_ctx *);
+void screen_write_collect_add(struct screen_write_ctx *,
+ const struct grid_cell *);
void screen_write_cell(struct screen_write_ctx *, const struct grid_cell *);
void screen_write_setselection(struct screen_write_ctx *, u_char *, u_int);
void screen_write_rawstring(struct screen_write_ctx *, u_char *, u_int);