Instead of making the extension objects request the OpenGL extensions
themselves, we can do it here since we already store that information
to be able to compute the list of available extensions. As bonus points
this makes it impossible to forget to request an OpenGL extension when
implementing a new WebGL one.
Since we moved to using a hash map in the previous commits we get
a quite easy way to check if a certain extension is enabled without
having to create a seperate method for each one.
Instead of manually listing out all the extensions which leads to
a bunch of if cases that are more or less the same, lets replace all
the fields with a hash map and introduces a factory field in the
already existing list of extensions. This allows us to neatly compact
the `get_extension` and makes implementing more extensions trivialy
easy.
This allows us to move the list of possible extensions to the WebGL
context class, which will need it in a later commit. It also makes
`OpenGLContext` more specialized towards only handling OpenGL itself.
This saves us from having our own color conversion code, which was
taking up a fair amount of time in VideoDataProvider. With this change,
we should be able to play high resolution videos without interruptions
on machines where the CPU can keep up with decoding.
In order to make this change, ImmutableBitmap is now able to be
constructed with YUV data instead of an RBG bitmap. It holds onto a
YUVData instance that stores the buffers of image data, since Skia
itself doesn't take ownership of them.
In order to support greater than 8 bits of color depth, we normalize
the 10- or 12-bit color values into a 16-bit range.
This factors the conversion logic to be independent from WebGL code,
allowing us to write unit tests for it that can run in CI (since WebGL
can't run in CI).
It's not correct to multiply the number of components by the number of
bytes, since compact formats such as 4_4_4_4 have 4 components but
_always_ stored in 2 bytes, not 8 if you were to do such a
multiplication.
Fixes textures on Google Maps having large blank stripes.
When this is true, we have to vertically flip TexImageSource provided
images before uploading them.
Fixes several graphical glitches on Google Maps.
Fixes globe being upside down on Shopify's homepage.
Likely fixes more websites.
Resulting in a massive rename across almost everywhere! Alongside the
namespace change, we now have the following names:
* JS::NonnullGCPtr -> GC::Ref
* JS::GCPtr -> GC::Ptr
* JS::HeapFunction -> GC::Function
* JS::CellImpl -> GC::Cell
* JS::Handle -> GC::Root