ImageDecoder+LibWeb: Perform initial alpha conversion in ImageDecoder

This change moves the initial alpha premultiplication step for all
decoded images from WebContent to the ImageDecoder process. This
doesn't reduce the overall amount of work, but it can make sites with a
lot of images more responsive.
This commit is contained in:
Tim Ledbetter 2025-11-06 10:23:54 +00:00 committed by Andreas Kling
parent 30d9584746
commit f6f238d15c
Notes: github-actions[bot] 2025-11-06 16:57:48 +00:00
2 changed files with 2 additions and 1 deletions

View file

@ -160,7 +160,7 @@ void SharedResourceRequest::handle_successful_fetch(URL::URL const& url_string,
Vector<AnimatedBitmapDecodedImageData::Frame> frames;
for (auto& frame : result.frames) {
frames.append(AnimatedBitmapDecodedImageData::Frame {
.bitmap = Gfx::ImmutableBitmap::create(*frame.bitmap, Gfx::AlphaType::Premultiplied, result.color_space),
.bitmap = Gfx::ImmutableBitmap::create(*frame.bitmap, result.color_space),
.duration = static_cast<int>(frame.duration),
});
}