simon-git: putty (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Thu Jul 15 20:19:36 BST 2021
TL;DR:
7a25599d Fix terminal redraw slowdown in presence of true colour.
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2021-07-15 20:19:36
commit 7a25599d8452c29bf32a5cd7de5968acb15732cd
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=7a25599d8452c29bf32a5cd7de5968acb15732cd;hp=640e46a11254f553c9835b4e9a6f60578c6adc95
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Jul 15 20:02:55 2021 +0100
Fix terminal redraw slowdown in presence of true colour.
When do_paint breaks up a line of terminal text into contiguous runs
of characters to treat the same, one of the criteria it uses is, 'Does
this character even need redrawing? (or is it already displayed
correctly from the previous redraw?)' When we encounter a character
that matches its previous value, we end the previous run of
characters, so that we can skip the one we've just encountered.
That check was not taking account of the 'truecolour' field of the
termchar it was checking. So it would sometimes falsely believe the
character to be equivalent to its previously drawn value, even when in
fact it was not, and hence insert a run break, anticipating that the
previous character needed drawing and the current one did not.
This didn't cause a _wrong_ redraw, because there's a separate loop
further on which re-checks whether to actually draw things, which
didn't make the same error. So the character that loop #1 thought
didn't need a redraw, loop #2 knew _did_ need a redraw, and hence,
everything did get redrawn.
But by the time loop #2 is running, it's too late to change the run
boundaries. So everything does get redrawn, but in much smaller chunks
than it could have been. The net effect was that if the screen was
filled with text displayed in true colour, and you changed it to the
_same_ text in a different colour, then the whole terminal would be
redrawn in one-character increments instead of the usual behaviour of
folding together runs that can be drawn in one go.
Thanks to Bradley Smith for debugging this very confusing issue!
terminal.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
More information about the tartarus-commits
mailing list