LibGfx: Remove ImmutableBitmap

DecodedImageFrame now owns decoded bitmap pixels directly, so the
separate ImmutableBitmap wrapper no longer carries useful semantics.
Remove the class and pass decoded image frames or bitmaps at the
boundaries where pixels are actually required.

The Skia image cache now keys off DecodedImageFrame, matching the
display-list commands that paint decoded images. Video frames stay
owned by LibMedia, with the explicit YUV-to-bitmap conversion living
at HTMLVideoElement's decoded-frame entry point for canvas and WebGL
callers.
This commit is contained in:
Aliaksandr Kalenik
2026-05-05 14:13:30 +02:00
committed by Gregory Bertilson
parent 40f2abb7fe
commit 76c79ee522
Notes: github-actions[bot] 2026-05-05 19:40:28 +00:00
49 changed files with 128 additions and 350 deletions

View File

@@ -14,7 +14,6 @@
*/
#include <LibGfx/DecodedImageFrame.h>
#include <LibGfx/ImmutableBitmap.h>
#include <LibJS/Runtime/Date.h>
#include <LibJS/Runtime/NativeFunction.h>
#include <LibJS/Runtime/RegExpObject.h>
@@ -2290,12 +2289,10 @@ Optional<CSSPixelFraction> HTMLInputElement::intrinsic_aspect_ratio() const
return {};
}
RefPtr<Gfx::ImmutableBitmap> HTMLInputElement::current_image_bitmap_sized(Gfx::IntSize size) const
RefPtr<Gfx::DecodedImageFrame> HTMLInputElement::current_image_frame_sized(Gfx::IntSize size) const
{
if (auto image_data = this->image_data()) {
if (auto frame = image_data->frame(0, size))
return Gfx::ImmutableBitmap::create(frame->bitmap_ref());
}
if (auto image_data = this->image_data())
return image_data->frame(0, size);
return nullptr;
}
@@ -2389,7 +2386,7 @@ WebIDL::UnsignedLong HTMLInputElement::height() const
}
// ...or else the natural height and height of the image, in CSS pixels, if an image is available but not being rendered
if (auto bitmap = current_image_bitmap())
if (auto bitmap = current_image_frame())
return bitmap->height();
// ...or else 0, if the image is not available or does not have intrinsic dimensions.
@@ -2424,7 +2421,7 @@ WebIDL::UnsignedLong HTMLInputElement::width() const
}
// ...or else the natural width and height of the image, in CSS pixels, if an image is available but not being rendered
if (auto bitmap = current_image_bitmap())
if (auto bitmap = current_image_frame())
return bitmap->width();
// ...or else 0, if the image is not available or does not have intrinsic dimensions.