From b22999f1e7b39c1341caf797a98facb9010f89cf Mon Sep 17 00:00:00 2001 From: trimental Date: Mon, 1 Oct 2018 05:54:08 +0800 Subject: Drop terminal lock before rendering The terminal lock is now dropped before rendering by storing all grid cells before clearing the screen. This frees the terminal to do other things since the lock is now free, which lead to a performance benefit with high throughput applications. --- src/renderer/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/renderer/mod.rs') diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index b461db0c..bcc896ef 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -374,7 +374,7 @@ pub struct RenderApi<'a> { current_atlas: &'a mut usize, program: &'a mut ShaderProgram, config: &'a Config, - visual_bell_intensity: f32 + visual_bell_intensity: f32, } #[derive(Debug)] @@ -799,7 +799,7 @@ impl<'a> RenderApi<'a> { }) .collect::>(); - self.render_cells(cells.into_iter(), glyph_cache); + self.render_cells(cells.iter(), glyph_cache); } #[inline] @@ -817,12 +817,12 @@ impl<'a> RenderApi<'a> { } } - pub fn render_cells( + pub fn render_cells<'b, I>( &mut self, cells: I, glyph_cache: &mut GlyphCache ) - where I: Iterator + where I: Iterator { for cell in cells { // Get font key for cell -- cgit