1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:37:35 +00:00

Kernel+LibVT: Add function for deleting a range of characters

Previously, this was done by telling the client to put a space at each
character in the range. This was inefficient, because a large number of
function calls took place and incorrect, as the ANSI standard dictates
that character attributes should be cleared as well.

The newly added `clear_in_line` function solves this issue. It performs
just one bounds check when it's called and can be implemented as a
pretty tight loop.
This commit is contained in:
Daniel Bertalan 2021-06-05 11:12:00 +02:00 committed by Andreas Kling
parent 8f8fd9c5a8
commit 7419569a2b
7 changed files with 60 additions and 53 deletions

View file

@ -217,10 +217,12 @@ protected:
void scroll_up(u16 region_top, u16 region_bottom, size_t count);
void scroll_down(u16 region_top, u16 region_bottom, size_t count);
void put_character_at(unsigned row, unsigned column, u32 ch);
void clear_in_line(u16 row, u16 first_column, u16 last_column);
#else
virtual void scroll_up(u16 region_top, u16 region_bottom, size_t count) = 0;
virtual void scroll_down(u16 region_top, u16 region_bottom, size_t count) = 0;
virtual void put_character_at(unsigned row, unsigned column, u32 ch) = 0;
virtual void clear_in_line(u16 row, u16 first_column, u16 last_column) = 0;
#endif
void unimplemented_control_code(u8);