Speed up back color erase -- no more loop over all cells

This commit is contained in:
Keith Winstein
2011-02-10 20:32:39 -05:00
parent 0fb343292a
commit 7d1013681f
5 changed files with 47 additions and 74 deletions
+1 -5
View File
@@ -10,10 +10,6 @@ std::string Display::new_frame( Framebuffer &f )
{
FrameState frame;
/* fill in background color on any cells that have been reset
or created since last time */
f.back_color_erase();
char tmp[ 64 ];
/* has window title changed? */
@@ -77,7 +73,7 @@ std::string Display::new_frame( Framebuffer &f )
&& (!f.get_row( frame.y )->wrap)
&& (!initialized || last_frame.get_row( frame.y )->wrap) ) {
frame.x = last_x;
last_frame.get_cell( frame.y, frame.x )->reset();
last_frame.reset_cell( last_frame.get_cell( frame.y, frame.x ) );
snprintf( tmp, 64, "\033[%d;%dH\033[K", frame.y + 1, frame.x + 1 );
frame.append( tmp );