diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-18 05:41:15 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-18 05:41:15 +0100 |
commit | 9454c5dd5254c9cd75b1b039da0cadb8c020ae38 (patch) | |
tree | 40f92b7548d028a3722d63bdf115680fa158cfa5 /WindowServer/WSScreen.h | |
parent | bb28c143fdfd1116ff05f229631091948ba0747e (diff) | |
download | serenity-9454c5dd5254c9cd75b1b039da0cadb8c020ae38.zip |
WindowServer: Merge WSFrameBuffer into WSScreen.
Diffstat (limited to 'WindowServer/WSScreen.h')
-rw-r--r-- | WindowServer/WSScreen.h | 10 |
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)); +} |