summaryrefslogtreecommitdiff
path: root/Kernel/Graphics/Console/ContiguousFramebufferConsole.h
diff options
context:
space:
mode:
Diffstat (limited to 'Kernel/Graphics/Console/ContiguousFramebufferConsole.h')
-rw-r--r--Kernel/Graphics/Console/ContiguousFramebufferConsole.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/Kernel/Graphics/Console/ContiguousFramebufferConsole.h b/Kernel/Graphics/Console/ContiguousFramebufferConsole.h
new file mode 100644
index 0000000000..bf4d458566
--- /dev/null
+++ b/Kernel/Graphics/Console/ContiguousFramebufferConsole.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2021, Sahan Fernando <sahan.h.fernando@gmail.com>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <Kernel/Graphics/Console/GenericFramebufferConsole.h>
+
+namespace Kernel::Graphics {
+
+class ContiguousFramebufferConsole final : public GenericFramebufferConsole {
+public:
+ static NonnullRefPtr<ContiguousFramebufferConsole> initialize(PhysicalAddress, size_t width, size_t height, size_t pitch);
+
+ virtual void set_resolution(size_t width, size_t height, size_t pitch) override;
+ virtual void flush() override { }
+
+private:
+ virtual u8* framebuffer_data() override
+ {
+ return m_framebuffer_region->vaddr().as_ptr();
+ }
+ OwnPtr<Region> m_framebuffer_region;
+ ContiguousFramebufferConsole(PhysicalAddress, size_t width, size_t height, size_t pitch);
+ PhysicalAddress m_framebuffer_address;
+};
+
+}