LibWeb: Add OffscreenCanvas to IDL types

Add OffscreenCanvas to TexImageSource and CanvasImageSource.
Implement all the necessary features to make it work in all cases where
these types are used.
This commit is contained in:
Totto16 2025-03-06 23:41:31 +01:00 committed by Andrew Kaster
parent 2ad3ce5d37
commit f1a096d6e4
Notes: github-actions[bot] 2025-06-30 15:47:37 +00:00
8 changed files with 35 additions and 9 deletions

View file

@ -42,6 +42,12 @@ static void default_source_size(CanvasImageSource const& image, float& source_wi
source_height = source->video_height();
}
},
[&source_width, &source_height](GC::Root<OffscreenCanvas> const& source) {
auto const bitmap = source->bitmap();
source_width = bitmap->width();
source_height = bitmap->height();
},
[&source_width, &source_height](GC::Root<HTMLCanvasElement> const& source) {
if (source->surface()) {
source_width = source->surface()->size().width();