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

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 Canvas

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 callow.m...@artspark.co.jpwrote: 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

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.

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

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 callow.m...@artspark.co.jpwrote: 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

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 ju...@google.com wrote: On Tue, Jul 16, 2013 at 12:25 AM, Mark Callow callow.m...@artspark.co.jp 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

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 k...@google.com wrote: On Thu, Jul 11, 2013 at 8:29 AM, Justin Novosad ju...@google.com wrote: On Wed, Jul 10, 2013 at 9:37 PM, Rik Cabanier caban...@gmail.com wrote: On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson i...@hixie.ch wrote:

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 ju...@google.com 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

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 caban...@gmail.com wrote: On Fri, Jul 12, 2013 at 7:18 AM, Justin Novosad ju...@google.com 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

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

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 caban...@gmail.com wrote: On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson i...@hixie.ch 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

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 ju...@google.com wrote: On Wed, Jul 10, 2013 at 9:37 PM, Rik Cabanier caban...@gmail.com wrote: On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson i...@hixie.ch wrote: On Wed, 10 Jul 2013, Kenneth Russell wrote: ImageBitmap can cleanly

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-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 i...@hixie.ch 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

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

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 i...@hixie.ch 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

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 Peter Kasting
On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson i...@hixie.ch 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

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 pkast...@google.com wrote: On Wed, Jul 10, 2013 at 5:07 PM, Ian Hickson i...@hixie.ch 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

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 i...@hixie.ch 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

[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

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 g...@google.com 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,

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 g...@google.com 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

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 caban...@gmail.com wrote: On Wed, Jun 19, 2013 at 2:47 PM, Gregg Tavares g...@google.com wrote: In order for ImageBitmap to be useful for WebGL we need more options Specifically premultipliedAlpha: true/false (default true) Nearly all GL

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 g...@google.com wrote: On Wed, Jun 19, 2013 at 3:13 PM, Rik Cabanier caban...@gmail.com wrote: On Wed, Jun 19, 2013 at 2:47 PM, Gregg Tavares g...@google.com wrote: In order for ImageBitmap to be useful for WebGL we need more options

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 g...@google.com wrote: On Wed, Jun 19, 2013 at 3:13 PM, Rik Cabanier caban...@gmail.com wrote: On Wed, Jun 19, 2013 at 2:47 PM, Gregg Tavares g...@google.com wrote: In order for ImageBitmap to be useful for WebGL we need more options

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 caban...@gmail.com wrote: On Wed, Jun 19, 2013 at 3:24 PM, Gregg Tavares g...@google.com wrote: On Wed, Jun 19, 2013 at 3:13 PM, Rik Cabanier caban...@gmail.com wrote: On Wed, Jun 19, 2013 at 2:47 PM, Gregg Tavares g...@google.com wrote:

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 g...@google.com wrote: On Wed, Jun 19, 2013 at 4:03 PM, Rik Cabanier caban...@gmail.com wrote: On Wed, Jun 19, 2013 at 3:24 PM, Gregg Tavares g...@google.com wrote: On Wed, Jun 19, 2013 at 3:13 PM, Rik Cabanier caban...@gmail.comwrote: