Calling .toDataURL() on a WebGL canvas that has premultipliedAlpha set to false results in an image that upside down.
See https://jsfiddle.net/oagpgo80/ for an example. It renders a triangle in a canvas (left) and calls toDataURL and puts the result in an <img> on the right.
Two triangles that look the same
The right triangle (the image created from toDataURL) is upside down.
How is it possible that such a simply bug hasn't been fixed in more than 3 years? This is still broken.
Is this something that switching to ANGLE will fix?
It probably won't automatically fix it - I suspect this code path uses glReadPixels to read back the framebuffer, and that the bug is in common CPU-side code. I'm surprised there isn't a WebGL conformance test to catch this. Someone should add one to https://github.com/KhronosGroup/WebGL .
I've added a conformance test for this to the WebGL suite:
Thanks nkronlage@ for creating the test. Let me block the shipment of WebGL 2.0 in Safari on fixing this as well.