1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:37:35 +00:00

Start working on a GUI kernel API.

This commit is contained in:
Andreas Kling 2019-01-13 01:59:38 +01:00
parent becc2c7fa5
commit 8f8c8d1ca3
17 changed files with 150 additions and 11 deletions

View file

@ -1,4 +1,5 @@
#include "GraphicsBitmap.h"
#include "EventLoop.h"
#include <AK/kmalloc.h>
#ifdef SERENITY
@ -21,7 +22,9 @@ GraphicsBitmap::GraphicsBitmap(const Size& size)
, m_pitch(size.width() * sizeof(RGBA32))
{
#ifdef SERENITY
m_region = current->allocate_region(LinearAddress(), size.width() * size.height() * sizeof(RGBA32), "GraphicsBitmap", true, true, true);
// FIXME: Oh god this is so horrible.
Process* server_process = EventLoop::main().running() ? &EventLoop::main().server_process() : current;
m_region = server_process->allocate_region(LinearAddress(), size.width() * size.height() * sizeof(RGBA32), "GraphicsBitmap", true, true, true);
m_data = (RGBA32*)m_region->linearAddress.asPtr();
m_owned = false;
#else