Kernel/Console: Factor out framebuffer offset and support glyph_spacing

This allows the 9px width of Cathode to be preserved without increasing
the bitmap size.
This commit is contained in:
MacDue 2022-06-08 11:15:30 +01:00 committed by Andreas Kling
parent adef79b793
commit 805a3d5b29
Notes: sideshowbarker 2024-07-17 10:54:57 +09:00
2 changed files with 26 additions and 14 deletions

View file

@ -18,7 +18,7 @@ public:
virtual size_t bytes_per_base_glyph() const override;
virtual size_t chars_per_line() const override;
virtual size_t max_column() const override { return m_width / m_pixels_per_column; }
virtual size_t max_column() const override { return m_width / (m_pixels_per_column + m_glyph_spacing); }
virtual size_t max_row() const override { return m_height / m_pixels_per_row; }
virtual bool is_hardware_paged_capable() const override { return false; }
@ -48,7 +48,10 @@ protected:
virtual u8* framebuffer_data() = 0;
size_t framebuffer_pitch() const { return m_pitch; }
virtual void clear_glyph(size_t x, size_t y);
u32* framebuffer_offset(size_t x, size_t y);
void flush_glyph(size_t x, size_t y);
size_t const m_glyph_spacing { 1 };
size_t const m_pixels_per_column { 8 };
size_t const m_pixels_per_row { 16 };