diff options
author | Joe Wilm <joe@jwilm.com> | 2017-02-11 12:49:40 -0800 |
---|---|---|
committer | Joe Wilm <jwilm@users.noreply.github.com> | 2017-02-11 14:18:05 -0800 |
commit | 908ea5543a40b772d2336e2ce981aae61dc6b2d7 (patch) | |
tree | 65c265378a75e214a0bc05f74de8c50156cc8dee /src/display.rs | |
parent | d2e8a0cd103a4923d296136ac499ce026fdd625a (diff) | |
download | alacritty-908ea5543a40b772d2336e2ce981aae61dc6b2d7.tar.gz alacritty-908ea5543a40b772d2336e2ce981aae61dc6b2d7.zip |
Move color list to Term struct
The color list needs to be updated by the parser, and this isn't
possible if it's on the config. This change makes sense semantically as
well since it's really part of the terminal state.
This is in preparation for OSC color parsing.
Diffstat (limited to 'src/display.rs')
-rw-r--r-- | src/display.rs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/display.rs b/src/display.rs index 9bfe7339..5946b33b 100644 --- a/src/display.rs +++ b/src/display.rs @@ -19,7 +19,6 @@ use std::sync::mpsc; use parking_lot::{MutexGuard}; use Rgb; -use ansi::Color; use cli; use config::Config; use font::{self, Rasterize}; @@ -120,7 +119,6 @@ impl Display { } pub fn update_config(&mut self, config: &Config) { - self.renderer.update_config(config); self.render_timer = config.render_timer(); } @@ -151,7 +149,7 @@ impl Display { let rasterizer = font::Rasterizer::new(dpi.x(), dpi.y(), dpr, config.use_thin_strokes())?; // Create renderer - let mut renderer = QuadRenderer::new(config, size)?; + let mut renderer = QuadRenderer::new(size)?; // Initialize glyph cache let glyph_cache = { @@ -280,6 +278,9 @@ impl Display { { let glyph_cache = &mut self.glyph_cache; + let size_info = *terminal.size_info(); + let visual_bell_intensity = terminal.visual_bell.intensity(); + // Draw grid { let _sampler = self.meter.sampler(); @@ -289,23 +290,20 @@ impl Display { // // TODO I wonder if the renderable cells iter could avoid the // mutable borrow - let size_info = *terminal.size_info(); - self.renderer.with_api(config, &size_info, |mut api| { - api.set_visual_bell(terminal.visual_bell.intensity() as f32); - + self.renderer.with_api(config, &size_info, visual_bell_intensity, |mut api| { api.clear(); // Draw the grid - api.render_cells(terminal.renderable_cells(selection), glyph_cache); + api.render_cells(terminal.renderable_cells(config, selection), glyph_cache); }); } // Draw render timer if self.render_timer { let timing = format!("{:.3} usec", self.meter.average()); - let color = Color::Spec(Rgb { r: 0xd5, g: 0x4e, b: 0x53 }); - self.renderer.with_api(config, terminal.size_info(), |mut api| { - api.render_string(&timing[..], glyph_cache, &color); + let color = Rgb { r: 0xd5, g: 0x4e, b: 0x53 }; + self.renderer.with_api(config, &size_info, visual_bell_intensity, |mut api| { + api.render_string(&timing[..], glyph_cache, color); }); } } |