summaryrefslogtreecommitdiff
path: root/SharedGraphics/GraphicsBitmap.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-01-21 05:18:28 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-01-21 05:18:28 +0100
commit76a28817931e6826a6f406a6b677082aa8c4f949 (patch)
tree58e294d5a6fc36de2bb89a1bc92645b3998a9b91 /SharedGraphics/GraphicsBitmap.cpp
parentd1af5c97ca18d48700ccf7d939f9911a43a9c2eb (diff)
downloadserenity-76a28817931e6826a6f406a6b677082aa8c4f949.zip
Mark the two Regions used GraphicsBitmaps as explicitly shared.
This fixes a goofy problem where forking a GUI process would cowify the GraphicsBitmap for everyone making a hue confusing mess.
Diffstat (limited to 'SharedGraphics/GraphicsBitmap.cpp')
-rw-r--r--SharedGraphics/GraphicsBitmap.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/SharedGraphics/GraphicsBitmap.cpp b/SharedGraphics/GraphicsBitmap.cpp
index 00dcd3707a..3da6cce03c 100644
--- a/SharedGraphics/GraphicsBitmap.cpp
+++ b/SharedGraphics/GraphicsBitmap.cpp
@@ -21,12 +21,14 @@ 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 (client)", true, true);
+ m_client_region->set_shared(true);
m_client_region->commit(process);
{
auto& server = WSEventLoop::the().server_process();
InterruptDisabler disabler;
m_server_region = server.allocate_region_with_vmo(LinearAddress(), size_in_bytes, move(vmo), 0, "GraphicsBitmap (server)", true, true);
+ m_server_region->set_shared(true);
}
m_data = (RGBA32*)m_server_region->linearAddress.asPtr();
}