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

2013-07-18 Thread Justin Novosad
To help us iterate further, I've attempted to capture the essence of this thread on the whatwg wiki, using the problem solving template. I tried to capture the main ideas that we seem to agree on so far and I started to think about how to handle special cases. http://wiki.whatwg.org/wiki/ImageBitm

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

2013-07-18 Thread Justin Novosad
On Thu, Jul 18, 2013 at 5:45 AM, Mark Callow wrote: > On 2013/07/18 16:34, K. Gadd wrote: > > > > I understand the rationale behind gregg's suggestion for flipY, but > > ultimately don't know if that one makes any sense in a HTML5 context. It > > basically only exists because of the annoying disag

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

2013-07-18 Thread Mark Callow
On 2013/07/18 16:34, K. Gadd wrote: > > I understand the rationale behind gregg's suggestion for flipY, but > ultimately don't know if that one makes any sense in a HTML5 context. It > basically only exists because of the annoying disagreement between APIs > like OpenGL and other APIs like HTML5 Ca

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

2013-07-18 Thread K. Gadd
To respond on the topic of WebGL/ImageBitmap integration - and in particular some of the features requested earlier in the thread. Apologies if I missed a post where this stuff was already addressed directly; I couldn't follow this thread easily because of how much context was stripped out of repli

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

2013-07-16 Thread Kenneth Russell
On Tue, Jul 16, 2013 at 7:16 AM, Justin Novosad wrote: > > > > On Tue, Jul 16, 2013 at 12:25 AM, Mark Callow > wrote: >> >> On 2013/07/15 10:46, Justin Novosad wrote: >> >> But to circle back to your point, I agree that an exception is a good idea >> to avoid having to hold a triplicate copy in R

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

2013-07-16 Thread Justin Novosad
On Tue, Jul 16, 2013 at 12:25 AM, Mark Callow wrote: > On 2013/07/15 10:46, Justin Novosad wrote: > > But to circle back to your point, I agree that an exception is a good idea > to avoid having to hold a triplicate copy in RAM, or having to redecode all > the time. Better to force the dev to mak

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

2013-07-16 Thread Mark Callow
On 2013/07/15 10:46, Justin Novosad wrote: > But to circle back to your point, I agree that an exception is a good idea > to avoid having to hold a triplicate copy in RAM, or having to redecode all > the time. Better to force the dev to make additional copies explicitly if > needed than to make a p

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

2013-07-14 Thread Justin Novosad
On Sun, Jul 14, 2013 at 4:34 PM, Rik Cabanier wrote: > > > On Fri, Jul 12, 2013 at 7:18 AM, Justin Novosad wrote: > >> Thanks Ken, that makes it much clearer to me. >> >> The main concern I have with all this is the potential for OOM crashes. >> I'm happy as long as the spec remains vague about

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

2013-07-14 Thread Rik Cabanier
On Fri, Jul 12, 2013 at 7:18 AM, Justin Novosad wrote: > Thanks Ken, that makes it much clearer to me. > > The main concern I have with all this is the potential for OOM crashes. > I'm happy as long as the spec remains vague about what "undue latency" > means, so we still have the possibility of

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

2013-07-14 Thread Rik Cabanier
On Thu, Jul 11, 2013 at 1:24 PM, Kenneth Russell wrote: > On Thu, Jul 11, 2013 at 8:29 AM, Justin Novosad wrote: > > > > > > On Wed, Jul 10, 2013 at 9:37 PM, Rik Cabanier > wrote: > >> > >> On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson wrote: > >> > >> > On Wed, 10 Jul 2013, Kenneth Russell wro

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

2013-07-12 Thread Justin Novosad
Thanks Ken, that makes it much clearer to me. The main concern I have with all this is the potential for OOM crashes. I'm happy as long as the spec remains vague about what "undue latency" means, so we still have the possibility of gracefully degrading performance in low memory conditions by evic

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

2013-07-11 Thread Kenneth Russell
On Thu, Jul 11, 2013 at 8:29 AM, Justin Novosad wrote: > > > On Wed, Jul 10, 2013 at 9:37 PM, Rik Cabanier wrote: >> >> On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson wrote: >> >> > On Wed, 10 Jul 2013, Kenneth Russell wrote: >> > > >> > > ImageBitmap can cleanly address all of the desired use cas

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

2013-07-11 Thread Rik Cabanier
On Thu, Jul 11, 2013 at 8:29 AM, Justin Novosad wrote: > > > On Wed, Jul 10, 2013 at 9:37 PM, Rik Cabanier wrote: > >> On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson wrote: >> >> > On Wed, 10 Jul 2013, Kenneth Russell wrote: >> > > >> > > ImageBitmap can cleanly address all of the desired use cas

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

2013-07-11 Thread Justin Novosad
On Wed, Jul 10, 2013 at 9:37 PM, Rik Cabanier wrote: > On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson wrote: > > > On Wed, 10 Jul 2013, Kenneth Russell wrote: > > > > > > ImageBitmap can cleanly address all of the desired use cases simply by > > > adding an optional dictionary of options. > > > >

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

2013-07-10 Thread Rik Cabanier
On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson wrote: > On Wed, 10 Jul 2013, Kenneth Russell wrote: > > > > ImageBitmap can cleanly address all of the desired use cases simply by > > adding an optional dictionary of options. > > I don't think that's true. The options only make sense for WebGL -- >

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

2013-07-10 Thread Kenneth Russell
On Wed, Jul 10, 2013 at 5:13 PM, Peter Kasting wrote: > On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson wrote: >> >> (The other two options don't make much sense to me even for GL. If you >> don't want a color space, don't set one. If you don't want an alpha >> channel, don't set one. You control th

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

2013-07-10 Thread Peter Kasting
On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson wrote: > (The other two options don't make much sense to me even for GL. If you > don't want a color space, don't set one. If you don't want an alpha > channel, don't set one. You control the image, after all.) I only have a small amount of graphics

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

2013-07-10 Thread Ian Hickson
On Wed, 10 Jul 2013, Kenneth Russell wrote: > > ImageBitmap can cleanly address all of the desired use cases simply by > adding an optional dictionary of options. I don't think that's true. The options only make sense for WebGL -- flipping which pixel is the first pixel, for example, doesn't do

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

2013-07-10 Thread Kenneth Russell
On Wed, Jul 10, 2013 at 4:37 PM, Ian Hickson wrote: > 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 conv

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

2013-07-10 Thread Ian Hickson
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 m

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

2013-07-10 Thread Kenneth Russell
(Replying on behalf of Gregg, who unfortunately isn't at Google any more) On Wed, Jul 10, 2013 at 3:17 PM, Ian Hickson wrote: > On Wed, 19 Jun 2013, Gregg Tavares wrote: >> >> In order for ImageBitmap to be useful for WebGL we need more options > > ImageBitmap is trying to just be a generic HTMLI

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

2013-07-10 Thread Ian Hickson
On Wed, 19 Jun 2013, Gregg Tavares wrote: > > In order for ImageBitmap to be useful for WebGL we need more options ImageBitmap is trying to just be a generic HTMLImageElement, that is, a bitmap image. It's not trying to be anything more than that. Based on some of these questions, though, maybe

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

2013-06-19 Thread Rik Cabanier
On Wed, Jun 19, 2013 at 4:47 PM, Gregg Tavares wrote: > > > > On Wed, Jun 19, 2013 at 4:03 PM, Rik Cabanier wrote: > >> >> >> On Wed, Jun 19, 2013 at 3:24 PM, Gregg Tavares wrote: >> >>> >>> >>> >>> On Wed, Jun 19, 2013 at 3:13 PM, Rik Cabanier wrote: >>> On Wed, Jun 19, 2013 at 2:47

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

2013-06-19 Thread Gregg Tavares
On Wed, Jun 19, 2013 at 4:03 PM, Rik Cabanier wrote: > > > On Wed, Jun 19, 2013 at 3:24 PM, Gregg Tavares wrote: > >> >> >> >> On Wed, Jun 19, 2013 at 3:13 PM, Rik Cabanier wrote: >> >>> >>> On Wed, Jun 19, 2013 at 2:47 PM, Gregg Tavares wrote: >>> In order for ImageBitmap to be useful fo

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

2013-06-19 Thread Rik Cabanier
On Wed, Jun 19, 2013 at 3:24 PM, Gregg Tavares wrote: > > > > On Wed, Jun 19, 2013 at 3:13 PM, Rik Cabanier wrote: > >> >> On Wed, Jun 19, 2013 at 2:47 PM, Gregg Tavares wrote: >> >>> In order for ImageBitmap to be useful for WebGL we need more options >>> >>> Specifically >>> >>> premultiplied

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

2013-06-19 Thread Rik Cabanier
On Wed, Jun 19, 2013 at 3:24 PM, Gregg Tavares wrote: > > > > On Wed, Jun 19, 2013 at 3:13 PM, Rik Cabanier wrote: > >> >> On Wed, Jun 19, 2013 at 2:47 PM, Gregg Tavares wrote: >> >>> In order for ImageBitmap to be useful for WebGL we need more options >>> >>> Specifically >>> >>> premultiplied

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

2013-06-19 Thread Gregg Tavares
On Wed, Jun 19, 2013 at 3:13 PM, Rik Cabanier wrote: > > On Wed, Jun 19, 2013 at 2:47 PM, Gregg Tavares wrote: > >> In order for ImageBitmap to be useful for WebGL we need more options >> >> Specifically >> >> premultipliedAlpha: true/false (default true) >> Nearly all GL games use non-premultip

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

2013-06-19 Thread Rik Cabanier
On Wed, Jun 19, 2013 at 2:47 PM, Gregg Tavares wrote: > In order for ImageBitmap to be useful for WebGL we need more options > > Specifically > > premultipliedAlpha: true/false (default true) > Nearly all GL games use non-premultipiled alpha textures. So all those > games people want to port to W

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

2013-06-19 Thread Tab Atkins Jr.
On Wed, Jun 19, 2013 at 2:47 PM, Gregg Tavares wrote: > If it was up to me I'd make createImageBitmap take on object with > properties so that new options can be added later as in > > createImageBitmap(src, callback, { >premultipliedAlpha: false, >colorspaceConversion: false, >

[whatwg] Adding features needed for WebGL to ImageBitmap

2013-06-19 Thread Gregg Tavares
In order for ImageBitmap to be useful for WebGL we need more options Specifically premultipliedAlpha: true/false (default true) Nearly all GL games use non-premultipiled alpha textures. So all those games people want to port to WebGL will require non-premultipied textures. Often in games the alph