summaryrefslogtreecommitdiff
path: root/WindowServer/WSScreen.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-01-18 05:41:15 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-01-18 05:41:15 +0100
commit9454c5dd5254c9cd75b1b039da0cadb8c020ae38 (patch)
tree40f92b7548d028a3722d63bdf115680fa158cfa5 /WindowServer/WSScreen.h
parentbb28c143fdfd1116ff05f229631091948ba0747e (diff)
downloadserenity-9454c5dd5254c9cd75b1b039da0cadb8c020ae38.zip
WindowServer: Merge WSFrameBuffer into WSScreen.
Diffstat (limited to 'WindowServer/WSScreen.h')
-rw-r--r--WindowServer/WSScreen.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/WindowServer/WSScreen.h b/WindowServer/WSScreen.h
index 240660ac40..5fa88dcb29 100644
--- a/WindowServer/WSScreen.h
+++ b/WindowServer/WSScreen.h
@@ -2,14 +2,17 @@
#include <Widgets/Rect.h>
#include <Widgets/Size.h>
+#include <Widgets/Color.h>
#include <Kernel/Keyboard.h>
class WSScreen {
public:
+ WSScreen(RGBA32*, unsigned width, unsigned height);
~WSScreen();
int width() const { return m_width; }
int height() const { return m_height; }
+ RGBA32* scanline(int y);
static WSScreen& the();
@@ -29,6 +32,8 @@ protected:
WSScreen(unsigned width, unsigned height);
private:
+ RGBA32* m_framebuffer { nullptr };
+
int m_width { 0 };
int m_height { 0 };
@@ -37,3 +42,8 @@ private:
bool m_right_mouse_button_pressed { false };
};
+inline RGBA32* WSScreen::scanline(int y)
+{
+ size_t pitch = sizeof(RGBA32) * width();
+ return reinterpret_cast<RGBA32*>(((byte*)m_framebuffer) + (y * pitch));
+}