Log render times + don't dirty cells under a hidden cursor
This commit is contained in:
parent
0bcdbb4210
commit
8dd05ab64e
12
src/main.rs
12
src/main.rs
|
@ -269,6 +269,8 @@ impl Graphics {
|
|||
}
|
||||
|
||||
pub fn redraw(&mut self, term: &Term<TermListener>, context: &mut GraphicsContext<Window>) {
|
||||
let start = std::time::Instant::now();
|
||||
|
||||
let (width, height) = {
|
||||
let size = context.window().inner_size();
|
||||
(size.width as usize, size.height as usize)
|
||||
|
@ -328,8 +330,6 @@ impl Graphics {
|
|||
let term_coords = (term_row, term_col);
|
||||
|
||||
if (term_row + 1) * self.cell_height < height && (term_col + 1) * self.cell_width < width {
|
||||
self.cell_cache.remove(&term_coords);
|
||||
|
||||
let mut px_row = term_row * width * self.cell_height + term_col * self.cell_width;
|
||||
|
||||
use alacritty_terminal::ansi::CursorShape;
|
||||
|
@ -372,9 +372,17 @@ impl Graphics {
|
|||
}
|
||||
CursorShape::Hidden => {}
|
||||
}
|
||||
|
||||
if content.cursor.shape != CursorShape::Hidden {
|
||||
self.cell_cache.remove(&term_coords);
|
||||
}
|
||||
}
|
||||
|
||||
let copy_start = std::time::Instant::now();
|
||||
context.set_buffer(&buffer, width as u16, height as u16);
|
||||
log::debug!("buffer copy time: {:?}", copy_start.elapsed());
|
||||
|
||||
log::debug!("redraw() time: {:?}", start.elapsed());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue