mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
LibIPC+LibGfx: Pass the IPC::Decoder to decoding helpers
Instead of passing the BufferStream, pass the Decoder. I'd like to stop using BufferStream eventually anyway, so it's good to get it out of any API's where it's in currently.
This commit is contained in:
parent
01ff36a2f4
commit
24a0354ce8
9 changed files with 26 additions and 19 deletions
|
@ -28,6 +28,7 @@
|
|||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/Rect.h>
|
||||
#include <LibIPC/Decoder.h>
|
||||
|
||||
namespace Gfx {
|
||||
|
||||
|
@ -145,13 +146,13 @@ const LogStream& operator<<(const LogStream& stream, const Rect& value)
|
|||
|
||||
namespace IPC {
|
||||
|
||||
bool decode(BufferStream& stream, Gfx::Rect& rect)
|
||||
bool decode(Decoder& decoder, Gfx::Rect& rect)
|
||||
{
|
||||
Gfx::Point point;
|
||||
Gfx::Size size;
|
||||
if (!decode(stream, point))
|
||||
if (!decoder.decode(point))
|
||||
return false;
|
||||
if (!decode(stream, size))
|
||||
if (!decoder.decode(size))
|
||||
return false;
|
||||
rect = { point, size };
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue