display: where needed, use slow blanking, but elsewhere do it much faster

Where the row needs to be filled with spaces with the attributes that
were set (title bar, prompt bar, and browser highlight), use printw().
But when the row needs to be actually cleared, use the much faster
clrtoeol().

This reduces the time needed to clear a full row with 95 percent.
master
Benno Schulenberg 2019-06-25 08:28:10 +02:00
parent e6c629951f
commit f3a441043d
3 changed files with 6 additions and 5 deletions

View File

@ -532,7 +532,7 @@ void browser_refresh(void)
the_column = col;
}
blank_row(edit, row, col, longest);
mvwprintw(edit, row, col, "%*s", longest, " ");
/* If the name is too long, we display something like "...ename". */
if (dots)

View File

@ -394,7 +394,7 @@ void draw_the_promptbar(void)
/* Color the promptbar over its full width. */
wattron(bottomwin, interface_color_pair[TITLE_BAR]);
blank_statusbar();
mvwprintw(bottomwin, 0, 0, "%*s", COLS, " ");
mvwaddstr(bottomwin, 0, 0, prompt);
waddch(bottomwin, ':');
@ -697,7 +697,7 @@ int do_yesno_prompt(bool all, const char *msg)
/* Color the statusbar over its full width and display the question. */
wattron(bottomwin, interface_color_pair[TITLE_BAR]);
blank_statusbar();
mvwprintw(bottomwin, 0, 0, "%*s", COLS, " ");
mvwaddnstr(bottomwin, 0, 0, msg, actual_x(msg, COLS - 1));
wattroff(bottomwin, interface_color_pair[TITLE_BAR]);
wnoutrefresh(bottomwin);

View File

@ -1794,13 +1794,14 @@ const keystruct *get_shortcut(int *kbinput)
* current attributes. */
void blank_row(WINDOW *win, int y, int x, int n)
{
mvwprintw(win, y, x, "%*s", n, " ");
wmove(win, y, 0);
wclrtoeol(win);
}
/* Blank the first line of the top portion of the window. */
void blank_titlebar(void)
{
blank_row(topwin, 0, 0, COLS);
mvwprintw(topwin, 0, 0, "%*s", COLS, " ");
}
/* Blank all the lines of the middle portion of the window, i.e. the