mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 17:37:33 +02:00
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:
committed by
Gregory Bertilson
parent
3c25d080b1
commit
40f2abb7fe
Notes:
github-actions[bot]
2026-05-05 19:40:35 +00:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/40f2abb7fe7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/9249 Reviewed-by: https://github.com/Zaggy1024 ✅
@@ -13,6 +13,7 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGfx/DecodedImageFrame.h>
|
||||
#include <LibGfx/ImmutableBitmap.h>
|
||||
#include <LibJS/Runtime/Date.h>
|
||||
#include <LibJS/Runtime/NativeFunction.h>
|
||||
@@ -2291,8 +2292,10 @@ Optional<CSSPixelFraction> HTMLInputElement::intrinsic_aspect_ratio() const
|
||||
|
||||
RefPtr<Gfx::ImmutableBitmap> HTMLInputElement::current_image_bitmap_sized(Gfx::IntSize size) const
|
||||
{
|
||||
if (auto image_data = this->image_data())
|
||||
return image_data->bitmap(0, size);
|
||||
if (auto image_data = this->image_data()) {
|
||||
if (auto frame = image_data->frame(0, size))
|
||||
return Gfx::ImmutableBitmap::create(frame->bitmap_ref());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user