diff options
author | Liav A <liavalb@gmail.com> | 2021-05-28 13:11:34 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-06-03 16:16:22 +0100 |
commit | e8d85b06943aee3829dc82c6dc06d7475d29bbf4 (patch) | |
tree | c43338b8e7de955ac2632fccdb2595837caed357 | |
parent | 01d7c1b7229acf33daf1570d45be4297f0788c03 (diff) | |
download | serenity-e8d85b06943aee3829dc82c6dc06d7475d29bbf4.zip |
Kernel/Graphics: Remove unused overloaded write methods of Console
If we happen to print a string, we could use a StringView instead. For
now, let's remove them entirely.
-rw-r--r-- | Kernel/Graphics/Console/Console.h | 2 | ||||
-rw-r--r-- | Kernel/Graphics/Console/FramebufferConsole.cpp | 8 | ||||
-rw-r--r-- | Kernel/Graphics/Console/FramebufferConsole.h | 2 | ||||
-rw-r--r-- | Kernel/Graphics/Console/TextModeConsole.cpp | 33 | ||||
-rw-r--r-- | Kernel/Graphics/Console/TextModeConsole.h | 2 |
5 files changed, 1 insertions, 46 deletions
diff --git a/Kernel/Graphics/Console/Console.h b/Kernel/Graphics/Console/Console.h index 448f1c7df6..67d7ef2407 100644 --- a/Kernel/Graphics/Console/Console.h +++ b/Kernel/Graphics/Console/Console.h @@ -56,9 +56,7 @@ public: virtual void clear(size_t x, size_t y, size_t length) const = 0; virtual void write(size_t x, size_t y, char ch, Color background, Color foreground) const = 0; - virtual void write(size_t x, size_t y, String, Color background, Color foreground) const = 0; virtual void write(size_t x, size_t y, char ch) const = 0; - virtual void write(size_t x, size_t y, String) const = 0; virtual void write(char ch) const = 0; virtual ~Console() { } diff --git a/Kernel/Graphics/Console/FramebufferConsole.cpp b/Kernel/Graphics/Console/FramebufferConsole.cpp index 5c960913c9..041e605ad0 100644 --- a/Kernel/Graphics/Console/FramebufferConsole.cpp +++ b/Kernel/Graphics/Console/FramebufferConsole.cpp @@ -339,18 +339,10 @@ void FramebufferConsole::write(size_t x, size_t y, char ch, Color background, Co } } -void FramebufferConsole::write(size_t, size_t, String, Color, Color) const -{ - TODO(); -} void FramebufferConsole::write(size_t x, size_t y, char ch) const { write(x, y, ch, m_default_background_color, m_default_foreground_color); } -void FramebufferConsole::write(size_t, size_t, String) const -{ - TODO(); -} void FramebufferConsole::write(char ch) const { diff --git a/Kernel/Graphics/Console/FramebufferConsole.h b/Kernel/Graphics/Console/FramebufferConsole.h index 7e141cef9a..b1ec3b98dc 100644 --- a/Kernel/Graphics/Console/FramebufferConsole.h +++ b/Kernel/Graphics/Console/FramebufferConsole.h @@ -33,9 +33,7 @@ public: virtual void clear(size_t x, size_t y, size_t length) const override; virtual void write(size_t x, size_t y, char ch, Color background, Color foreground) const override; - virtual void write(size_t x, size_t y, String cstring, Color background, Color foreground) const override; virtual void write(size_t x, size_t y, char ch) const override; - virtual void write(size_t x, size_t y, String) const override; virtual void write(char ch) const override; virtual void enable() override; diff --git a/Kernel/Graphics/Console/TextModeConsole.cpp b/Kernel/Graphics/Console/TextModeConsole.cpp index 847f899ffe..68e0860f72 100644 --- a/Kernel/Graphics/Console/TextModeConsole.cpp +++ b/Kernel/Graphics/Console/TextModeConsole.cpp @@ -132,22 +132,7 @@ void TextModeConsole::write(size_t x, size_t y, char ch) const m_y = 0; } } -void TextModeConsole::write(size_t x, size_t y, String cstring) const -{ - ScopedSpinLock lock(m_vga_lock); - auto* buf = (u16*)(m_current_vga_window + (x * 2) + (y * width() * 2)); - u16 color_mask = (m_default_foreground_color << 8) | (m_default_background_color << 12); - for (size_t index = 0; index < cstring.length(); index++) { - buf[index] = color_mask | cstring[index]; - } - m_x = x + cstring.length(); - if (m_x >= max_column()) { - m_x = 0; - m_y = y + 1; - if (m_y >= max_row()) - m_y = 0; - } -} + void TextModeConsole::write(size_t x, size_t y, char ch, Color background, Color foreground) const { ScopedSpinLock lock(m_vga_lock); @@ -161,22 +146,6 @@ void TextModeConsole::write(size_t x, size_t y, char ch, Color background, Color m_y = 0; } } -void TextModeConsole::write(size_t x, size_t y, String cstring, Color background, Color foreground) const -{ - ScopedSpinLock lock(m_vga_lock); - auto* buf = (u16*)(m_current_vga_window + (x * 2) + (y * width() * 2)); - u16 color_mask = foreground << 8 | background << 12; - for (size_t index = 0; index < cstring.length(); index++) { - buf[index] = color_mask | cstring[index]; - } - m_x = x + cstring.length(); - if (m_x >= max_column()) { - m_x = 0; - m_y = y + 1; - if (m_y >= max_row()) - m_y = 0; - } -} void TextModeConsole::clear_vga_row(u16 row) { diff --git a/Kernel/Graphics/Console/TextModeConsole.h b/Kernel/Graphics/Console/TextModeConsole.h index c465b63f39..7366f73987 100644 --- a/Kernel/Graphics/Console/TextModeConsole.h +++ b/Kernel/Graphics/Console/TextModeConsole.h @@ -26,9 +26,7 @@ public: virtual void show_cursor() override; virtual void clear(size_t x, size_t y, size_t length) const override; virtual void write(size_t x, size_t y, char ch) const override; - virtual void write(size_t x, size_t y, String cstring) const override; virtual void write(size_t x, size_t y, char ch, Color background, Color foreground) const override; - virtual void write(size_t x, size_t y, String, Color background, Color foreground) const override; virtual void write(char ch) const override; virtual void enable() override { } |