mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
LibGfx+ImageDecoder: Use RefPtr<Bitmap> instead of optional
Simplify the list of bitmaps a bit by changing `Optional<NonnullRefPtr<Bitmap>>` into `RefPtr<Bitmap>`. No functional changes.
This commit is contained in:
parent
19bee8393d
commit
e4a5be0206
Notes:
github-actions[bot]
2025-03-22 16:50:52 +00:00
Author: https://github.com/gmta
Commit: e4a5be0206
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3705
4 changed files with 11 additions and 12 deletions
|
@ -76,13 +76,13 @@ void Client::did_decode_image(i64 image_id, bool is_animated, u32 loop_count, Gf
|
|||
image.frames.ensure_capacity(bitmaps.size());
|
||||
image.color_space = move(color_space);
|
||||
for (size_t i = 0; i < bitmaps.size(); ++i) {
|
||||
if (!bitmaps[i].has_value()) {
|
||||
if (!bitmaps[i]) {
|
||||
dbgln("ImageDecoderClient: Invalid bitmap for request {} at index {}", image_id, i);
|
||||
promise->reject(Error::from_string_literal("Invalid bitmap"));
|
||||
return;
|
||||
}
|
||||
|
||||
image.frames.empend(bitmaps[i].release_value(), durations[i]);
|
||||
image.frames.empend(bitmaps[i].release_nonnull(), durations[i]);
|
||||
}
|
||||
|
||||
promise->resolve(move(image));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue