mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:37:35 +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
|
@ -31,6 +31,7 @@
|
|||
#include <AK/Vector.h>
|
||||
#include <LibGfx/Color.h>
|
||||
#include <LibGfx/SystemTheme.h>
|
||||
#include <LibIPC/Decoder.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
@ -386,11 +387,10 @@ const LogStream& operator<<(const LogStream& stream, Color value)
|
|||
return stream << value.to_string();
|
||||
}
|
||||
|
||||
bool IPC::decode(BufferStream& stream, Color& color)
|
||||
bool IPC::decode(IPC::Decoder& decoder, Color& color)
|
||||
{
|
||||
u32 rgba = 0;
|
||||
stream >> rgba;
|
||||
if (stream.handle_read_failure())
|
||||
if (!decoder.decode(rgba))
|
||||
return false;
|
||||
color = Color::from_rgba(rgba);
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue