diff options
author | Joe Wilm <joe@jwilm.com> | 2016-06-04 15:30:17 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-06-04 15:30:17 -0700 |
commit | 2f058bd053f52307bdbf3709209418ac26871678 (patch) | |
tree | 0609a8a3c1976d0e0bdaeede352a55d9c14cb13f /src/text.rs | |
parent | f944b517fa8bea6eae62eb25fbabe1308d16ed55 (diff) | |
download | r-alacritty-2f058bd053f52307bdbf3709209418ac26871678.tar.gz r-alacritty-2f058bd053f52307bdbf3709209418ac26871678.tar.bz2 r-alacritty-2f058bd053f52307bdbf3709209418ac26871678.zip |
Optimize rendering
This moves some logic that was previously being done per-character into
the vertex shader. At this time, we've traded CPU computation for
additional gl::Uniform2f calls. This is only a marginal improvement.
However, this patch positions the renderer well for instanced drawing,
and that will be a huge performance win.
Diffstat (limited to 'src/text.rs')
-rw-r--r-- | src/text.rs | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/text.rs b/src/text.rs index 2a04c4be..5086a3a4 100644 --- a/src/text.rs +++ b/src/text.rs @@ -108,10 +108,11 @@ impl Rasterizer { } RasterizedGlyph { - top: glyph.bitmap_top() as usize, - left: glyph.bitmap_left() as usize, - width: glyph.bitmap().width() as usize / 3, - height: glyph.bitmap().rows() as usize, + c: c, + top: glyph.bitmap_top(), + left: glyph.bitmap_left(), + width: glyph.bitmap().width() / 3, + height: glyph.bitmap().rows(), buf: packed, } } @@ -119,10 +120,11 @@ impl Rasterizer { #[derive(Debug)] pub struct RasterizedGlyph { - pub width: usize, - pub height: usize, - pub top: usize, - pub left: usize, + pub c: char, + pub width: i32, + pub height: i32, + pub top: i32, + pub left: i32, pub buf: Vec<u8>, } |