aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyose <ayosec@gmail.com>2022-10-16 23:22:33 +0100
committerAyose <ayosec@gmail.com>2022-10-16 23:22:33 +0100
commit396002cc0e650055e3535e7a88463650bb5ee8ee (patch)
treeb734a75ec4e03acef06e1bc5ffa56f3230d617ea
parent2eb9812849bc849cb634e2d9ada3dfa231603d43 (diff)
downloadr-alacritty-396002cc0e650055e3535e7a88463650bb5ee8ee.tar.gz
r-alacritty-396002cc0e650055e3535e7a88463650bb5ee8ee.tar.bz2
r-alacritty-396002cc0e650055e3535e7a88463650bb5ee8ee.zip
Set graphics limit per cell.
The limit per grid is increased to `1000`, and a new limit per cell is added, set to `20`.
-rw-r--r--alacritty/src/renderer/graphics/mod.rs2
-rw-r--r--alacritty_terminal/src/term/mod.rs8
2 files changed, 9 insertions, 1 deletions
diff --git a/alacritty/src/renderer/graphics/mod.rs b/alacritty/src/renderer/graphics/mod.rs
index 9a22e871..a6b601b2 100644
--- a/alacritty/src/renderer/graphics/mod.rs
+++ b/alacritty/src/renderer/graphics/mod.rs
@@ -23,7 +23,7 @@ mod draw;
mod shader;
/// Max. number of textures stored in the GPU.
-const MAX_TEXTURES_COUNT: usize = 100;
+const MAX_TEXTURES_COUNT: usize = 1000;
pub use draw::RenderList;
diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs
index d54d9998..a35fade2 100644
--- a/alacritty_terminal/src/term/mod.rs
+++ b/alacritty_terminal/src/term/mod.rs
@@ -44,6 +44,9 @@ const TITLE_STACK_MAX_DEPTH: usize = 4096;
/// Default tab interval, corresponding to terminfo `it` value.
const INITIAL_TABSTOPS: usize = 8;
+/// Max. number of graphics stored in a single cell.
+const MAX_GRAPHICS_PER_CELL: usize = 20;
+
bitflags! {
pub struct TermMode: u32 {
const NONE = 0;
@@ -2159,6 +2162,11 @@ impl<T: EventListener> Handler for Term<T> {
cell_height as usize,
) =>
{
+ // Ensure that we don't exceed the graphics limit per cell.
+ while old_graphics.len() >= MAX_GRAPHICS_PER_CELL {
+ drop(old_graphics.remove(0));
+ }
+
old_graphics.push(graphic_cell);
old_graphics
},