Userland: Remove remaining callers of synchronous ImageDecoder API

Most of these now just await the image decoding, equivalent (ish) to
the old behavior. A more async-aware refactor should happen some time
in the future.
This commit is contained in:
Andrew Kaster 2024-04-19 16:10:57 -06:00 committed by Andrew Kaster
commit 1c3f11a5a6
Notes: sideshowbarker 2024-07-16 21:39:23 +09:00
7 changed files with 21 additions and 41 deletions

View file

@ -60,16 +60,6 @@ NonnullRefPtr<Core::Promise<DecodedImage>> Client::decode_image(ReadonlyBytes en
return promise;
}
Optional<DecodedImage> Client::decode_image(ReadonlyBytes encoded_data, Optional<Gfx::IntSize> ideal_size, Optional<ByteString> mime_type)
{
auto promise = decode_image(
encoded_data, [](auto) -> ErrorOr<void> { return {}; }, [](Error&) -> void {}, ideal_size, mime_type);
auto result = promise->await();
if (result.is_error())
return {};
return result.release_value();
}
void Client::did_decode_image(i64 image_id, bool is_animated, u32 loop_count, Vector<Gfx::ShareableBitmap> const& bitmaps, Vector<u32> const& durations, Gfx::FloatPoint scale)
{
VERIFY(!bitmaps.is_empty());