This makes the WebGL2 implementation file inherit from the WebGL1
implementation file. This is actually closer to what the IDL files
describe and allows us to not have to maintain two copies of the same
functions.
The reasoning behind this is that in the next commit some of the WebGL2
specific parameters will be moved here. This header is needed to give
us access to those defines. Note that when in WebGL1 nothing from ES3
will be used as it's locked behind WebGL2 checks (it wouldn't work
anyways as we request ES2 from ANGLE).
This is more like what the IDL files specify with two different mixins,
but the inheritance structure here is slightly different for easier
maintenance. This will also allow the WebGL2 Impl to inherit from the
WebGL1 Impl as WebGL versions don't share the functions defined in the
Overloads interfaces.
The spec actually mandates that clientWaitSync actually has a time
limit and this is a way to get it. For now just return infinity as this
is required of SpectorJS to work.
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.
After we bind the surface to the context for the first time when
allocating the backing image, it internally has a permanent reference
count above 0.
If we switch to a different context and back, the switch back will fail
because the surface has a reference count, which makes ANGLE think
we're trying to use it on a different thread.
However, we can avoid this by using surfaceless contexts, since we
don't use the default framebuffer.
Fixes multiple WebGL contexts on the page freezing.
This deduplicates a lot of sensitive pointer math by using Span, which
performs this math for us with more safety checks and with type
information.
This also allows us to use the correctly typed Span for typed arrays,
which automatically fixes srcOffset to now offset by the number of
elements instead of bytes. This goes for srcLengthOverride too.
Fixes the Rive animations on Shopify's homepage not appearing.
Fixes some Unity applications such as ArcViewer having missing
graphics.