If the EXIF orientation is present in an Image, WebGLRenderingContext.texImage2D() needs to draw this image into an ImageBuffer, makes a temporary Image object from the ImageBuffer then draw this temporary image to the WebGL texture. Drawing an image to an ImageBuffer respects the EXIF orientation of the original image. WebGLRenderingContext also does the same trick when drawing an SVGImage.
Created attachment 385453 [details] Patch
<rdar://problem/57370489>
Created attachment 385821 [details] Patch
Created attachment 385838 [details] Patch
Comment on attachment 385838 [details] Patch r=me
(Looks like Simon reviewed already so never mind.)
Comment on attachment 385838 [details] Patch Clearing flags on attachment: 385838 Committed r253610: <https://trac.webkit.org/changeset/253610>
All reviewed patches have been landed. Closing bug.