LibWeb/WebGL: Implement tex(Sub)Image2D with TexImageSource

This commit is contained in:
Luke Wilde 2024-12-24 18:55:22 +00:00 committed by Alexander Kalenik
parent f66f01ce53
commit b6bc5912d6
Notes: github-actions[bot] 2025-01-08 14:59:19 +00:00
4 changed files with 69 additions and 9 deletions

View file

@ -210,7 +210,7 @@ JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM& vm, IDL::Effect
// then remove from S all other entries.
else if (value.is_object() && is<JS::DataView>(value.as_object())
&& has_overload_with_argument_type_or_subtype_matching(overloads, i, [](IDL::Type const& type) {
if (type.is_plain() && (type.name() == "DataView" || type.name() == "BufferSource"))
if (type.is_plain() && (type.name() == "DataView" || type.name() == "BufferSource" || type.name() == "ArrayBufferView"))
return true;
if (type.is_object())
return true;
@ -228,7 +228,7 @@ JS::ThrowCompletionOr<ResolvedOverload> resolve_overload(JS::VM& vm, IDL::Effect
// then remove from S all other entries.
else if (value.is_object() && value.as_object().is_typed_array()
&& has_overload_with_argument_type_or_subtype_matching(overloads, i, [&](IDL::Type const& type) {
if (type.is_plain() && (type.name() == static_cast<JS::TypedArrayBase const&>(value.as_object()).element_name() || type.name() == "BufferSource"))
if (type.is_plain() && (type.name() == static_cast<JS::TypedArrayBase const&>(value.as_object()).element_name() || type.name() == "BufferSource" || type.name() == "ArrayBufferView"))
return true;
if (type.is_object())
return true;