aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-06-02 22:14:55 -0700
committerJoe Wilm <joe@jwilm.com>2016-06-02 22:14:55 -0700
commit2e51d92a92d5c95139c064182a9a6e2e8b2ee590 (patch)
treec005798301f0322507971f45ad1bbf33913277d3 /src/main.rs
parent2f98871b029eef0631e8e3a70928b8d219940a02 (diff)
downloadalacritty-2e51d92a92d5c95139c064182a9a6e2e8b2ee590.tar.gz
alacritty-2e51d92a92d5c95139c064182a9a6e2e8b2ee590.zip
Use texture atlas for glyphs
This dramatically reduces the number of BindTexture calls needed when rendering the grid. Draw times for a moderately full terminal of the default size are ~1ms with this patch.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 9e9a6e86..b6a36330 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -104,9 +104,11 @@ fn main() {
let mut grid = Grid::new(num_rows as usize, num_cols as usize);
+ let mut renderer = QuadRenderer::new(width, height);
+
let mut glyph_cache = HashMap::new();
for c in INIT_LIST.chars() {
- let glyph = Glyph::new(&rasterizer.get_glyph(&desc, font_size, c));
+ let glyph = renderer.load_glyph(&rasterizer.get_glyph(&desc, font_size, c));
glyph_cache.insert(c, glyph);
}
@@ -124,7 +126,6 @@ fn main() {
}
});
- let mut renderer = QuadRenderer::new(width, height);
let mut terminal = Term::new(tty, grid);
let mut meter = Meter::new();