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. Expected: Two triangles that look the same Actual: 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.
<rdar://problem/53942867>
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: https://github.com/KhronosGroup/WebGL/commit/fd4489e57bb17b276dc575d0f8b6681d9c2ebcc8
Thanks nkronlage@ for creating the test. Let me block the shipment of WebGL 2.0 in Safari on fixing this as well.