1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:27:35 +00:00

Move WindowServer to userspace.

This is a monster patch that required changing a whole bunch of things.
There are performance and stability issues all over the place, but it works.
Pretty cool, I have to admit :^)
This commit is contained in:
Andreas Kling 2019-02-17 00:13:47 +01:00
parent 0b1b21d622
commit 640360e958
41 changed files with 325 additions and 463 deletions

View file

@ -4,7 +4,7 @@
#include <AK/Assertions.h>
#include <AK/StdLibExtras.h>
#ifdef USERLAND
#ifdef LIBGUI
#include <LibGUI/GWidget.h>
#include <LibGUI/GWindow.h>
#include <LibGUI/GEventLoop.h>
@ -22,7 +22,7 @@ Painter::Painter(GraphicsBitmap& bitmap)
m_clip_rect = { { 0, 0 }, bitmap.size() };
}
#ifdef USERLAND
#ifdef LIBGUI
Painter::Painter(GWidget& widget)
: m_font(&widget.font())
{
@ -30,7 +30,6 @@ Painter::Painter(GWidget& widget)
request.type = WSAPI_ClientMessage::Type::GetWindowBackingStore;
request.window_id = widget.window()->window_id();
auto response = GEventLoop::main().sync_request(request, WSAPI_ServerMessage::DidGetWindowBackingStore);
m_backing_store_id = response.backing.backing_store_id;
m_target = GraphicsBitmap::create_with_shared_buffer(response.backing.shared_buffer_id, response.backing.size);
ASSERT(m_target);
@ -50,15 +49,7 @@ Painter::Painter(GWidget& widget)
Painter::~Painter()
{
#ifdef USERLAND
m_target = nullptr;
if (m_backing_store_id) {
WSAPI_ClientMessage request;
request.type = WSAPI_ClientMessage::Type::ReleaseWindowBackingStore;
request.backing.backing_store_id = m_backing_store_id;
GEventLoop::main().post_message_to_server(request);
}
#endif
}
void Painter::fill_rect_with_draw_op(const Rect& a_rect, Color color)