Kernel: Add fast fill method to framebuffer device

This makes `clear` much faster when running without kvm!
This commit is contained in:
2025-07-01 13:53:19 +03:00
parent c2d09b64ca
commit fb7e9719a1
3 changed files with 10 additions and 3 deletions

View File

@@ -140,6 +140,14 @@ namespace Kernel
reinterpret_cast<uint32_t*>(m_video_buffer->vaddr())[y * m_width + x] = rgb;
}
void FramebufferDevice::fill(uint32_t rgb)
{
static_assert(BANAN_FB_BPP == 32);
auto* video_buffer_u32 = reinterpret_cast<uint32_t*>(m_video_buffer->vaddr());
for (uint32_t i = 0; i < m_width * m_height; i++)
video_buffer_u32[i] = rgb;
}
void FramebufferDevice::scroll(int32_t rows, uint32_t rgb)
{
if (rows == 0)