mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 17:58:11 +00:00

This turned into a huge refactoring that somehow also includes making locks recursive/reentrant.
46 lines
784 B
C++
46 lines
784 B
C++
#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));
|
|
}
|