From 0fd3793a963015e8f91021e35dbb2169d15c3211 Mon Sep 17 00:00:00 2001 From: Ayose Date: Wed, 10 Mar 2021 20:21:36 +0000 Subject: Add Sixel support Fixes #910 --- alacritty/src/display/mod.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'alacritty/src/display/mod.rs') diff --git a/alacritty/src/display/mod.rs b/alacritty/src/display/mod.rs index d4c5c274..5e958f03 100644 --- a/alacritty/src/display/mod.rs +++ b/alacritty/src/display/mod.rs @@ -479,7 +479,7 @@ impl Display { /// This call may block if vsync is enabled. pub fn draw( &mut self, - terminal: MutexGuard<'_, Term>, + mut terminal: MutexGuard<'_, Term>, message_buffer: &MessageBuffer, config: &Config, search_state: &SearchState, @@ -502,6 +502,8 @@ impl Display { let vi_mode = terminal.mode().contains(TermMode::VI); let vi_mode_cursor = if vi_mode { Some(terminal.vi_mode_cursor) } else { None }; + let graphics_queues = terminal.graphics_take_queues(); + // Drop terminal as early as possible to free lock. drop(terminal); @@ -509,7 +511,12 @@ impl Display { api.clear(background_color); }); + if let Some(graphics_queues) = graphics_queues { + self.renderer.graphics_run_updates(graphics_queues, &size_info); + } + let mut lines = RenderLines::new(); + let mut graphics_list = renderer::graphics::RenderList::default(); // Draw grid. { @@ -532,12 +539,17 @@ impl Display { // Update underline/strikeout. lines.update(&cell); + // Track any graphic present in the cell. + graphics_list.update(&cell); + // Draw the cell. api.render_cell(cell, glyph_cache); } }); } + self.renderer.graphics_draw(graphics_list, &size_info); + let mut rects = lines.rects(&metrics, &size_info); if let Some(vi_mode_cursor) = vi_mode_cursor { -- cgit