diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-09-27 17:33:45 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-09-27 17:33:45 +0000 |
| commit | 67905c600050df4e1c8a46053038a011accd9de6 (patch) | |
| tree | ac1c19b8309cb74c0c86394846fb2e2ec5662e46 /scripts | |
| parent | render: attach buffer *before* generating damage (diff) | |
render: handle compositors that does buffer swapping
Not all compositors support buffer re-use. I.e. they will call the
frame callback *before* the previous buffer has been
released. Effectively causing us to swap between two buffers.
Previously, this made us enter an infinite re-render loop, since we
considered the window 'dirty' (and in need of re-draw) when the buffer
is different from last redraw.
Now, we detect the buffer swapping case; size must match, and we must
not have any other condition that require a full repaint.
In this case, we can memcpy() the old buffer to the new one, without
dirtying the entire grid. We then update only the dirty cells (and
scroll damage).
Note that there was a bug here, where we erased the old
cursor *before* checking for a new buffer. This worked when the buffer
had *not* changed.
Now that we need to handle the case where it *has* changed, we must do
the memcpy() *before* we erase the cursor, or the re-painted cell is
lost.
This makes foot work on Plasma, without burning CPU. The memcpy() does
incur a performance penalty, but we're still (much) faster than
e.g. konsole. In fact, we're still mostly on par with Alacritty.
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
