mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibGfx+LibIPC: Add Gfx::ShareableBitmap, a bitmap for easy IPC usage
With this patch, it's now possible to pass a Gfx::ShareableBitmap in an IPC message. As long as the message itself is synchronous, the bitmap will be adopted by the receiving end, and disowned by the sender nicely without any accounting effort like we've had to do in the past. Use this in NotificationServer to allow sending arbitrary bitmaps as icons instead of paths-to-icons.
This commit is contained in:
parent
24a0354ce8
commit
7cfe712f4d
Notes:
sideshowbarker
2024-07-19 08:04:01 +09:00
Author: https://github.com/awesomekling
Commit: 7cfe712f4d
17 changed files with 115 additions and 17 deletions
|
@ -53,7 +53,7 @@ DragOperation::Outcome DragOperation::exec()
|
|||
Gfx::Size bitmap_size;
|
||||
RefPtr<Gfx::Bitmap> shared_bitmap;
|
||||
if (m_bitmap) {
|
||||
shared_bitmap = m_bitmap->to_shareable_bitmap();
|
||||
shared_bitmap = m_bitmap->to_bitmap_backed_by_shared_buffer();
|
||||
shared_bitmap->shared_buffer()->share_with(WindowServerConnection::the().server_pid());
|
||||
bitmap_id = shared_bitmap->shbuf_id();
|
||||
bitmap_size = shared_bitmap->size();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue