aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-11-28 14:13:11 -0800
committerJoe Wilm <joe@jwilm.com>2016-12-11 20:23:41 -0800
commit30bee80a6902eb09c51bed9c9f54c7617c4d53db (patch)
tree187853fdf17d3382595be8a416e604c6f2bea0f0 /src/main.rs
parent941818d88ebc1f0d90ef9b1ef7d1313174afb36b (diff)
downloadr-alacritty-30bee80a6902eb09c51bed9c9f54c7617c4d53db.tar.gz
r-alacritty-30bee80a6902eb09c51bed9c9f54c7617c4d53db.tar.bz2
r-alacritty-30bee80a6902eb09c51bed9c9f54c7617c4d53db.zip
Refactor cell selection out of renderer
The terminal now has a `renderable_cells()` function that returns a `RenderableCellIter` iterator. This allows reuse of the cell selection code by multiple renderers, makes it testable, and makes it independently optimizable. The render API now takes an `Iterator<Item=IndexedCell>` to support both the new renderable cells iterator and the `render_string()` method which generates its own iterator. The `vim_large_window_scoll` ref test was added here because it provides a nice large and busy grid to benchmark the cell selection with.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index fbf1eaca..aaa20953 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -361,8 +361,10 @@ impl Display {
let size_info = terminal.size_info().clone();
self.renderer.with_api(&size_info, |mut api| {
+ api.clear();
+
// Draw the grid
- api.render_grid(&terminal.render_grid(), glyph_cache);
+ api.render_grid(terminal.renderable_cells(), glyph_cache);
});
}