1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibGfx+IPCCompiler: Add IPC encoders for Color and ShareableBitmap

This commit is contained in:
Andreas Kling 2020-05-12 18:52:51 +02:00
parent f8e3c8326d
commit fbda28248a
5 changed files with 19 additions and 7 deletions

View file

@ -28,6 +28,7 @@
#include <LibGfx/Bitmap.h>
#include <LibGfx/ShareableBitmap.h>
#include <LibIPC/Decoder.h>
#include <LibIPC/Encoder.h>
namespace Gfx {
@ -40,6 +41,14 @@ ShareableBitmap::ShareableBitmap(const Bitmap& bitmap)
namespace IPC {
bool encode(Encoder& encoder, const Gfx::ShareableBitmap& shareable_bitmap)
{
encoder << shareable_bitmap.shbuf_id();
encoder << shareable_bitmap.width();
encoder << shareable_bitmap.height();
return true;
}
bool decode(Decoder& decoder, Gfx::ShareableBitmap& shareable_bitmap)
{
i32 shbuf_id = 0;