Re: [whatwg] Adding features needed for WebGL to ImageBitmap

On Wed, 10 Jul 2013, Kenneth Russell wrote:
> 
> Some background: when uploading HTMLImageElements to WebGL it's required 
> to be able to specify certain options, such as whether to premultiply 
> the alpha channel, or perform colorspace conversion. Because it seemed 
> infeasible at the time to modify the HTML spec, these options are set 
> via the WebGL API. If they're set differently from the browser's 
> defaults (which are generally to do premultiplication, and do colorspace 
> conversion), then the WebGL implementation has to re-decode the image 
> when it's uploaded to a WebGL texture. (There's no way to know in 
> advance whether a given image is intended for upload to WebGL as opposed 
> to insertion into the document, and making image decoding lazier than it 
> currently is would introduce bad hiccups while scrolling.)

It seems like the right solution is to create a primitive for WebGL that 
represents images that are going to be used in WebGL calls. Such a 
primitive could use the same sources for images as ImageBitmap, but would 
be specifically for use with WebGL, in the same way that ImageBitmap is 
used just by the 2D Canvas API.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 10 July 2013 23:38:18 UTC