/* * Copyright (c) 2024, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include namespace Gfx { Path Path::from_serialized_bytes(ReadonlyBytes bytes) { Gfx::Path path; path.impl().deserialize_from_bytes(bytes); return path; } NonnullOwnPtr PathImpl::create() { return PathImplSkia::create(); } PathImpl::~PathImpl() = default; } namespace IPC { template<> ErrorOr encode(Encoder& encoder, Gfx::Path const& path) { return encoder.encode(path.serialize_to_bytes()); } template<> ErrorOr decode(Decoder& decoder) { auto path_data = TRY(decoder.decode>()); return Gfx::Path::from_serialized_bytes(path_data); } }