mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
Paper over annoying race in GraphicsBitmap instantiation.
This works for now. This has to be done quite differently when I eventually move the WindowServer to userspace.
This commit is contained in:
parent
36e0ab3f18
commit
3ad0ec9b1b
Notes:
sideshowbarker
2024-07-19 16:00:56 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3ad0ec9b1bf
1 changed files with 3 additions and 3 deletions
|
@ -20,13 +20,13 @@ GraphicsBitmap::GraphicsBitmap(Process& process, const Size& size)
|
|||
{
|
||||
size_t size_in_bytes = size.width() * size.height() * sizeof(RGBA32);
|
||||
auto vmo = VMObject::create_anonymous(size_in_bytes);
|
||||
m_client_region = process.allocate_region_with_vmo(LinearAddress(), size_in_bytes, vmo.copyRef(), 0, "GraphicsBitmap (shared)", true, true);
|
||||
m_client_region = process.allocate_region_with_vmo(LinearAddress(), size_in_bytes, vmo.copyRef(), 0, "GraphicsBitmap (client)", true, true);
|
||||
m_client_region->commit(process);
|
||||
|
||||
{
|
||||
auto& server = WSEventLoop::the().server_process();
|
||||
ProcessInspectionHandle composer_handle(server);
|
||||
m_server_region = server.allocate_region_with_vmo(LinearAddress(), size_in_bytes, move(vmo), 0, "GraphicsBitmap (shared)", true, true);
|
||||
InterruptDisabler disabler;
|
||||
m_server_region = server.allocate_region_with_vmo(LinearAddress(), size_in_bytes, move(vmo), 0, "GraphicsBitmap (server)", true, true);
|
||||
}
|
||||
m_data = (RGBA32*)m_server_region->linearAddress.asPtr();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue