mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
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:
parent
651e78fedb
commit
1c3f11a5a6
Notes:
sideshowbarker
2024-07-16 21:39:23 +09:00
Author: https://github.com/ADKaster
Commit: 1c3f11a5a6
Pull-request: https://github.com/SerenityOS/serenity/pull/24028
Reviewed-by: https://github.com/LucasChollet
Reviewed-by: https://github.com/awesomekling
7 changed files with 21 additions and 41 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue