diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-29 19:04:05 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-29 19:37:23 +0200 |
commit | 7cfe712f4d0298cb645a602afe116698ab0fcd67 (patch) | |
tree | 51a964bf210be086634bc69bd48d3ed11debffe5 /DevTools/IPCCompiler | |
parent | 24a0354ce84c6c839930788bc772736f7c56ae18 (diff) | |
download | serenity-7cfe712f4d0298cb645a602afe116698ab0fcd67.zip |
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.
Diffstat (limited to 'DevTools/IPCCompiler')
-rw-r--r-- | DevTools/IPCCompiler/main.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/DevTools/IPCCompiler/main.cpp b/DevTools/IPCCompiler/main.cpp index b12e8328fa..252ef7dd4e 100644 --- a/DevTools/IPCCompiler/main.cpp +++ b/DevTools/IPCCompiler/main.cpp @@ -228,6 +228,7 @@ int main(int argc, char** argv) dbg() << "#include <AK/OwnPtr.h>"; dbg() << "#include <LibGfx/Color.h>"; dbg() << "#include <LibGfx/Rect.h>"; + dbg() << "#include <LibGfx/ShareableBitmap.h>"; dbg() << "#include <LibIPC/Decoder.h>"; dbg() << "#include <LibIPC/Encoder.h>"; dbg() << "#include <LibIPC/Endpoint.h>"; @@ -362,6 +363,10 @@ int main(int argc, char** argv) dbg() << " stream << rect.width();"; dbg() << " stream << rect.height();"; dbg() << " }"; + } else if (parameter.type == "Gfx::ShareableBitmap") { + dbg() << " stream << m_" << parameter.name << ".shbuf_id();"; + dbg() << " stream << m_" << parameter.name << ".width();"; + dbg() << " stream << m_" << parameter.name << ".height();"; } else { dbg() << " stream << m_" << parameter.name << ";"; } |