mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-23 00:19:18 +00:00
LibWeb/WebGL: Define Uint32List exactly like in the spec
Same fix as d54cab60 but applied for Uint32List.
This commit is contained in:
parent
c75a8fab3b
commit
ffc05a9ca9
Notes:
github-actions[bot]
2025-09-30 16:36:42 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: ffc05a9ca9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6354
Reviewed-by: https://github.com/gmta ✅
5 changed files with 17 additions and 23 deletions
|
|
@ -21,6 +21,7 @@ class WebGLRenderingContextBase {
|
|||
public:
|
||||
using Float32List = Variant<GC::Root<JS::Float32Array>, Vector<float>>;
|
||||
using Int32List = Variant<GC::Root<JS::Int32Array>, Vector<WebIDL::Long>>;
|
||||
using Uint32List = Variant<GC::Root<JS::Uint32Array>, Vector<WebIDL::UnsignedLong>>;
|
||||
|
||||
virtual GC::Cell const* gc_cell() const = 0;
|
||||
virtual void visit_edges(JS::Cell::Visitor&) = 0;
|
||||
|
|
@ -39,6 +40,13 @@ public:
|
|||
return int32_list.get<Vector<int>>();
|
||||
return int32_list.get<GC::Root<JS::Int32Array>>()->data();
|
||||
}
|
||||
|
||||
static Span<u32> span_from_uint32_list(Uint32List& int32_list)
|
||||
{
|
||||
if (int32_list.has<Vector<u32>>())
|
||||
return int32_list.get<Vector<u32>>();
|
||||
return int32_list.get<GC::Root<JS::Uint32Array>>()->data();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue