LibGfx+LibWeb: Add DecodedImageFrame

Decoded image data should not continue to traffic in ImmutableBitmap now
that the bitmap wrapper is being retired. Introduce DecodedImageFrame as
the paintable decoded-image unit and store a Bitmap plus ColorSpace in
it directly.

Thread the new frame type through decoded image data, display-list
image commands, filters, canvas drawImage, patterns, WebGL texture
upload, and CSS/SVG image consumers. ImmutableBitmap remains only at
the legacy boundaries that still need it, such as HTML video snapshots
and callers that explicitly ask for a bitmap snapshot.

This keeps color-space ownership with the decoded frame while making
the expensive or legacy ImmutableBitmap path explicit at the few call
sites that still need it.
This commit is contained in:
Aliaksandr Kalenik
2026-05-05 13:52:33 +02:00
committed by Gregory Bertilson
parent 3c25d080b1
commit 40f2abb7fe
Notes: github-actions[bot] 2026-05-05 19:40:35 +00:00
53 changed files with 368 additions and 214 deletions

View File

@@ -354,4 +354,15 @@ RefPtr<Gfx::ImmutableBitmap> HTMLVideoElement::bitmap() const
return bitmap_or_error.release_value();
}
Gfx::ColorSpace const* HTMLVideoElement::current_frame_color_space() const
{
auto const& sink = selected_video_track_sink();
if (sink == nullptr)
return nullptr;
auto current_frame = sink->current_frame();
if (!current_frame)
return nullptr;
return &current_frame->color_space();
}
}