mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Tear out or duplicate what's unique for WindowServer from Widgets.
This turned into a huge refactoring that somehow also includes making locks recursive/reentrant.
This commit is contained in:
parent
e655aebd70
commit
f7ca6d254d
30 changed files with 757 additions and 308 deletions
46
WindowServer/WSFrameBuffer.cpp
Normal file
46
WindowServer/WSFrameBuffer.cpp
Normal file
|
@ -0,0 +1,46 @@
|
|||
#include "WSFrameBuffer.h"
|
||||
#include <Widgets/GraphicsBitmap.h>
|
||||
#include <AK/Assertions.h>
|
||||
|
||||
WSFrameBuffer* s_the;
|
||||
|
||||
void WSFrameBuffer::initialize()
|
||||
{
|
||||
s_the = nullptr;
|
||||
}
|
||||
|
||||
WSFrameBuffer& WSFrameBuffer::the()
|
||||
{
|
||||
ASSERT(s_the);
|
||||
return *s_the;
|
||||
}
|
||||
|
||||
WSFrameBuffer::WSFrameBuffer(unsigned width, unsigned height)
|
||||
: WSScreen(width, height)
|
||||
{
|
||||
ASSERT(!s_the);
|
||||
s_the = this;
|
||||
}
|
||||
|
||||
WSFrameBuffer::WSFrameBuffer(RGBA32* data, unsigned width, unsigned height)
|
||||
: WSScreen(width, height)
|
||||
, m_data(data)
|
||||
{
|
||||
ASSERT(!s_the);
|
||||
s_the = this;
|
||||
}
|
||||
|
||||
|
||||
WSFrameBuffer::~WSFrameBuffer()
|
||||
{
|
||||
}
|
||||
|
||||
void WSFrameBuffer::show()
|
||||
{
|
||||
}
|
||||
|
||||
RGBA32* WSFrameBuffer::scanline(int y)
|
||||
{
|
||||
unsigned pitch = sizeof(RGBA32) * width();
|
||||
return reinterpret_cast<RGBA32*>(((byte*)m_data) + (y * pitch));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue