1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:54:57 +00:00
serenity/Kernel/Devices/GPU/Console/BootFramebufferConsole.h
Liav A 9ee098b119 Kernel: Move all Graphics-related code into Devices/GPU directory
Like the HID, Audio and Storage subsystem, the Graphics subsystem (which
handles GPUs technically) exposes unix device files (typically in /dev).
To ensure consistency across the repository, move all related files to a
new directory under Kernel/Devices called "GPU".

Also remove the redundant "GPU" word from the VirtIO driver directory,
and the word "Graphics" from GraphicsManagement.{h,cpp} filenames.
2023-06-06 00:40:32 +02:00

45 lines
1.3 KiB
C++

/*
* Copyright (c) 2022, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <Kernel/Devices/GPU/Console/GenericFramebufferConsole.h>
#include <Kernel/Forward.h>
namespace Kernel::Graphics {
class BootFramebufferConsole : public GenericFramebufferConsoleImpl {
public:
virtual void clear(size_t x, size_t y, size_t length) override;
virtual void write(size_t x, size_t y, char ch, Color background, Color foreground, bool critical = false) override;
using GenericFramebufferConsoleImpl::write;
virtual void enable() override;
virtual void disable() override;
virtual void flush(size_t, size_t, size_t, size_t) override { }
virtual void set_resolution(size_t, size_t, size_t) override { }
u8* unsafe_framebuffer_data() { return m_framebuffer_data; }
BootFramebufferConsole(PhysicalAddress framebuffer_addr, size_t width, size_t height, size_t pitch);
private:
virtual void set_cursor(size_t x, size_t y) override;
virtual void hide_cursor() override;
virtual void show_cursor() override;
protected:
virtual void clear_glyph(size_t x, size_t y) override;
virtual u8* framebuffer_data() override;
OwnPtr<Memory::Region> m_framebuffer;
u8* m_framebuffer_data {};
mutable Spinlock<LockRank::None> m_lock {};
};
}