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

More window management work.

- Fix inverted mouse event hit test z-ordering.
- Let the RootWidget backing store simply be the display framebuffer.
This commit is contained in:
Andreas Kling 2019-01-09 03:51:34 +01:00
parent 723ff8c2ab
commit 4775fd88e3
5 changed files with 41 additions and 18 deletions

View file

@ -6,15 +6,30 @@ RetainPtr<GraphicsBitmap> GraphicsBitmap::create(const Size& size)
return adopt(*new GraphicsBitmap(size));
}
RetainPtr<GraphicsBitmap> GraphicsBitmap::create_wrapper(const Size& size, byte* data)
{
return adopt(*new GraphicsBitmap(size, data));
}
GraphicsBitmap::GraphicsBitmap(const Size& size)
: m_size(size)
{
m_data = (byte*)kmalloc(size.width() * size.height() * 4);
m_owned = true;
}
GraphicsBitmap::GraphicsBitmap(const Size& size, byte* data)
: m_size(size)
{
m_data = data;
m_owned = false;
}
GraphicsBitmap::~GraphicsBitmap()
{
kfree(m_data);
if (m_owned)
kfree(m_data);
m_data = nullptr;
}
dword* GraphicsBitmap::scanline(int y)