Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-22 Thread Mike Shaver
On Mon, Mar 15, 2010 at 3:05 AM, Maciej Stachowiak wrote: > === Summary of Data === > > 1) In all browsers tested, copying to an ImageData and then back to a canvas > (two blits) is faster than a 2x scale. > 2) In all browsers tested, twice the cost of a canvas-to-canvas blit is > considerably les

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-15 Thread Oliver Hunt
On Mar 15, 2010, at 2:24 PM, Vladimir Vukicevic wrote: > If we wanted to support this across workers (and I think it would be helpful > to figure out how to do so), something like saying that if a canvas object > was passed (somehow) between workers, it would be a copy -- and internally it > co

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-15 Thread Vladimir Vukicevic
On 3/15/2010 4:22 AM, Maciej Stachowiak wrote: On Mar 15, 2010, at 3:46 AM, Philip Taylor wrote: On Mon, Mar 15, 2010 at 7:05 AM, Maciej Stachowiak wrote: Copying from one canvas to another is much faster than copying to/from ImageData. To make copying to a Worker worthwhile as a responsiven

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-15 Thread Maciej Stachowiak
On Mar 15, 2010, at 3:46 AM, Philip Taylor wrote: On Mon, Mar 15, 2010 at 7:05 AM, Maciej Stachowiak wrote: Copying from one canvas to another is much faster than copying to/ from ImageData. To make copying to a Worker worthwhile as a responsiveness improvement for rotations or downscales,

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-15 Thread Philip Taylor
On Mon, Mar 15, 2010 at 7:05 AM, Maciej Stachowiak wrote: > Copying from one canvas to another is much faster than copying to/from > ImageData. To make copying to a Worker worthwhile as a responsiveness > improvement for rotations or downscales, in addition to the OffscreenCanvas > proposal we wou

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-15 Thread Maciej Stachowiak
On Mar 15, 2010, at 12:28 AM, Jonas Sicking wrote: === Conclusions === 1) For scaling an image up 2x, copying to an ImageData and back for processing on a Worker would improve responsiveness, relative to just doing the scale on the main thread. 2) Copying from one canvas to another is much

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-15 Thread Jonas Sicking
>> I agree that the number of steps is not important for responsiveness >> or performance (though it is for complexity). However several of those >> steps seemed to involved non-trivial amount of CPU usage, that was the >> concern expressed in my initial mail. >> >> At the very least I think we hav

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-15 Thread Maciej Stachowiak
On Mar 14, 2010, at 6:22 PM, Jonas Sicking wrote: One way to do it would be to have an function somewhere, not necessarily on the 2D context, which given a Blob, returns an ImageData object. However this still results in the image being loaded twice into memory, so would only really help if yo

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-14 Thread Jonas Sicking
On Sun, Mar 14, 2010 at 1:43 AM, Maciej Stachowiak wrote: > > On Mar 13, 2010, at 12:30 PM, Jonas Sicking wrote: > >> On Sat, Mar 13, 2010 at 12:09 PM, Oliver Hunt wrote: >>> >>> On Mar 13, 2010, at 9:10 AM, Jonas Sicking wrote: There is a use case, which I suspect is quite common, for

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-14 Thread Maciej Stachowiak
On Mar 13, 2010, at 12:30 PM, Jonas Sicking wrote: On Sat, Mar 13, 2010 at 12:09 PM, Oliver Hunt wrote: On Mar 13, 2010, at 9:10 AM, Jonas Sicking wrote: There is a use case, which I suspect is quite common, for using to manipulate files on the users file system. For example when creating

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-13 Thread Jonas Sicking
On Sat, Mar 13, 2010 at 12:09 PM, Oliver Hunt wrote: > > On Mar 13, 2010, at 9:10 AM, Jonas Sicking wrote: >> There is a use case, which I suspect is quite common, for using >> to manipulate files on the users file system. For example >> when creating a photo uploader which does client side scali

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-13 Thread Oliver Hunt
On Mar 13, 2010, at 9:10 AM, Jonas Sicking wrote: > There is a use case, which I suspect is quite common, for using > to manipulate files on the users file system. For example > when creating a photo uploader which does client side scaling before > uploading the images, or for creating a web base

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-13 Thread Jonas Sicking
On Fri, Mar 12, 2010 at 10:07 PM, Maciej Stachowiak wrote: > > On Mar 12, 2010, at 6:20 PM, Jonas Sicking wrote: > > Oh, another thing to keep in mind is that if/when we add fromBlob to > > the main-thread canvas, it has to be asynchronous in order to avoid > > main thread synchronous IO. This isn

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-12 Thread Maciej Stachowiak
On Mar 12, 2010, at 6:20 PM, Jonas Sicking wrote: On Fri, Mar 12, 2010 at 4:19 PM, Jonas Sicking wrote: On Fri, Mar 12, 2010 at 3:38 PM, David Levin wrote: On Fri, Mar 12, 2010 at 2:35 PM, Jonas Sicking wrote: On Fri, Mar 12, 2010 at 12:46 PM, Oliver Hunt wrote: On Mar 12, 201

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-12 Thread Jonas Sicking
On Fri, Mar 12, 2010 at 4:19 PM, Jonas Sicking wrote: > On Fri, Mar 12, 2010 at 3:38 PM, David Levin wrote: >> >> >> On Fri, Mar 12, 2010 at 2:35 PM, Jonas Sicking wrote: >>> >>> On Fri, Mar 12, 2010 at 12:46 PM, Oliver Hunt wrote: >>> > >>> > On Mar 12, 2010, at 12:16 PM, Jonas Sicking wrote:

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-12 Thread Maciej Stachowiak
On Mar 12, 2010, at 2:35 PM, Jonas Sicking wrote: On Fri, Mar 12, 2010 at 12:46 PM, Oliver Hunt wrote: On Mar 12, 2010, at 12:16 PM, Jonas Sicking wrote: I'm not saying that the proposed API is bad. It just doesn't seem to solve the (seemingly most commonly requested) use case of rotating/

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-12 Thread Jonas Sicking
On Fri, Mar 12, 2010 at 3:38 PM, David Levin wrote: > > > On Fri, Mar 12, 2010 at 2:35 PM, Jonas Sicking wrote: >> >> On Fri, Mar 12, 2010 at 12:46 PM, Oliver Hunt wrote: >> > >> > On Mar 12, 2010, at 12:16 PM, Jonas Sicking wrote: >> >> I'm not saying that the proposed API is bad. It just doesn

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-12 Thread David Levin
On Fri, Mar 12, 2010 at 2:35 PM, Jonas Sicking wrote: > On Fri, Mar 12, 2010 at 12:46 PM, Oliver Hunt wrote: > > > > On Mar 12, 2010, at 12:16 PM, Jonas Sicking wrote: > >> I'm not saying that the proposed API is bad. It just doesn't seem to > >> solve the (seemingly most commonly requested) use

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-12 Thread Jonas Sicking
On Fri, Mar 12, 2010 at 12:46 PM, Oliver Hunt wrote: > > On Mar 12, 2010, at 12:16 PM, Jonas Sicking wrote: >> I'm not saying that the proposed API is bad. It just doesn't seem to >> solve the (seemingly most commonly requested) use case of >> rotating/scaling images. So if we want to solve those

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-12 Thread Oliver Hunt
On Mar 12, 2010, at 12:16 PM, Jonas Sicking wrote: > I'm not saying that the proposed API is bad. It just doesn't seem to > solve the (seemingly most commonly requested) use case of > rotating/scaling images. So if we want to solve those use cases we > need to either come up with a separate API fo

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-12 Thread David Levin
On Fri, Mar 12, 2010 at 12:16 PM, Jonas Sicking wrote: > On Fri, Mar 12, 2010 at 11:57 AM, David Levin wrote: > > On Mon, Feb 22, 2010 at 3:10 PM, Jonas Sicking wrote: > >> > >> What is the use case for this? It seems like in most cases you'll want > >> to display something on screen to the use

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-12 Thread Jonas Sicking
On Fri, Mar 12, 2010 at 11:57 AM, David Levin wrote: > On Mon, Feb 22, 2010 at 3:10 PM, Jonas Sicking  wrote: >> >> What is the use case for this? It seems like in most cases you'll want >> to display something on screen to the user, and so the difference >> comes down to shipping drawing commands

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-03-12 Thread David Levin
On Mon, Feb 22, 2010 at 11:57 AM, Drew Wilson wrote: > Do we feel that text APIs are, in general, difficult to implement in a > multi-thread safe manner? > On Mon, Feb 22, 2010 at 11:51 AM, Michael Nordman wrote: > The lack of support for text drawing in the worker context seems like a > shor

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-24 Thread Anne van Kesteren
On Wed, 24 Feb 2010 16:45:44 +0100, Andrew Grieve wrote: How would you do #2 efficiently? If you used toDataUr*l*(), then you have to encode a png on one side and then decode the png on the main thread. I think we might want to add some sort of API for blitting directly from an offscreen ca

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-24 Thread Andrew Grieve
Regarding the three steps of offscreen rendering: 1. Draw stuff 2. Ship pixels to main thread 3. Draw them on the screen. How would you do #2 efficiently? If you used toDataUr*l*(), then you have to encode a png on one side and then decode the png on the main thread. I think we might want to add

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-24 Thread Maciej Stachowiak
On Feb 24, 2010, at 1:35 AM, Jonas Sicking wrote: On Wed, Feb 24, 2010 at 12:14 AM, Maciej Stachowiak wrote: On Feb 24, 2010, at 12:09 AM, Maciej Stachowiak wrote: On Feb 23, 2010, at 10:04 PM, Jonas Sicking wrote: On Tue, Feb 23, 2010 at 9:57 PM, Maciej Stachowiak wrote: - Raytracin

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-24 Thread Jonas Sicking
On Wed, Feb 24, 2010 at 1:35 AM, Jonas Sicking wrote: > On Wed, Feb 24, 2010 at 12:14 AM, Maciej Stachowiak wrote: >> >> On Feb 24, 2010, at 12:09 AM, Maciej Stachowiak wrote: >> >> On Feb 23, 2010, at 10:04 PM, Jonas Sicking wrote: >> >> On Tue, Feb 23, 2010 at 9:57 PM, Maciej Stachowiak wrote:

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-24 Thread Jonas Sicking
On Wed, Feb 24, 2010 at 12:14 AM, Maciej Stachowiak wrote: > > On Feb 24, 2010, at 12:09 AM, Maciej Stachowiak wrote: > > On Feb 23, 2010, at 10:04 PM, Jonas Sicking wrote: > > On Tue, Feb 23, 2010 at 9:57 PM, Maciej Stachowiak wrote: > > - Raytracing a complex scene at high resolution. > > - Dra

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-24 Thread Maciej Stachowiak
On Feb 24, 2010, at 12:09 AM, Maciej Stachowiak wrote: On Feb 23, 2010, at 10:04 PM, Jonas Sicking wrote: On Tue, Feb 23, 2010 at 9:57 PM, Maciej Stachowiak wrote: - Raytracing a complex scene at high resolution. - Drawing a highly zoomed in high resolution portion of the Mandelbrot set

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-24 Thread Maciej Stachowiak
On Feb 23, 2010, at 10:04 PM, Jonas Sicking wrote: On Tue, Feb 23, 2010 at 9:57 PM, Maciej Stachowiak wrote: - Raytracing a complex scene at high resolution. - Drawing a highly zoomed in high resolution portion of the Mandelbrot set. To be fair though, you could compute the pixels for th

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-23 Thread Jonas Sicking
On Tue, Feb 23, 2010 at 10:04 PM, Jonas Sicking wrote: > On Tue, Feb 23, 2010 at 9:57 PM, Maciej Stachowiak wrote: >> - Raytracing a complex scene at high resolution. >> - Drawing a highly zoomed in high resolution portion of the Mandelbrot set. >> >> To be fair though, you could compute the pixe

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-23 Thread Jonas Sicking
On Tue, Feb 23, 2010 at 9:57 PM, Maciej Stachowiak wrote: > - Raytracing a complex scene at high resolution. > - Drawing a highly zoomed in high resolution portion of the Mandelbrot set. > > To be fair though, you could compute the pixels for those with just math, > there is no need to have a grap

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-23 Thread Maciej Stachowiak
On Feb 23, 2010, at 7:40 AM, Jeremy Orlow wrote: Note that doing rendering in a worker and then displaying it on the the main thread also gives you double buffering for no additional cost. This is something our teams are excited about as well. While I think the use cases presented for b

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-23 Thread Jeremy Orlow
On Tue, Feb 23, 2010 at 11:31 AM, Jeremy Orlow wrote: > On Tue, Feb 23, 2010 at 12:46 AM, Jonas Sicking wrote: > >> On Mon, Feb 22, 2010 at 4:34 PM, Jeremy Orlow >> wrote: >> > On Tue, Feb 23, 2010 at 12:05 AM, Jonas Sicking >> wrote: >> >> >> >> On Mon, Feb 22, 2010 at 3:43 PM, Jeremy Orlow

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-23 Thread Darin Fisher
On Mon, Feb 22, 2010 at 4:05 PM, Jonas Sicking wrote: > On Mon, Feb 22, 2010 at 3:43 PM, Jeremy Orlow wrote: > > On Mon, Feb 22, 2010 at 11:10 PM, Jonas Sicking > wrote: > >> > >> On Mon, Feb 22, 2010 at 11:13 AM, David Levin wrote: > >> > I've talked with some other folks on WebKit (Maciej an

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-23 Thread Jeremy Orlow
On Tue, Feb 23, 2010 at 12:46 AM, Jonas Sicking wrote: > On Mon, Feb 22, 2010 at 4:34 PM, Jeremy Orlow wrote: > > On Tue, Feb 23, 2010 at 12:05 AM, Jonas Sicking > wrote: > >> > >> On Mon, Feb 22, 2010 at 3:43 PM, Jeremy Orlow > wrote: > >> > On Mon, Feb 22, 2010 at 11:10 PM, Jonas Sicking >

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread Jonas Sicking
On Mon, Feb 22, 2010 at 4:34 PM, Jeremy Orlow wrote: > On Tue, Feb 23, 2010 at 12:05 AM, Jonas Sicking wrote: >> >> On Mon, Feb 22, 2010 at 3:43 PM, Jeremy Orlow wrote: >> > On Mon, Feb 22, 2010 at 11:10 PM, Jonas Sicking >> > wrote: >> >> >> >> On Mon, Feb 22, 2010 at 11:13 AM, David Levin wr

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread Jeremy Orlow
On Tue, Feb 23, 2010 at 12:05 AM, Jonas Sicking wrote: > On Mon, Feb 22, 2010 at 3:43 PM, Jeremy Orlow wrote: > > On Mon, Feb 22, 2010 at 11:10 PM, Jonas Sicking > wrote: > >> > >> On Mon, Feb 22, 2010 at 11:13 AM, David Levin wrote: > >> > I've talked with some other folks on WebKit (Maciej a

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread Jonas Sicking
On Mon, Feb 22, 2010 at 3:43 PM, Jeremy Orlow wrote: > On Mon, Feb 22, 2010 at 11:10 PM, Jonas Sicking wrote: >> >> On Mon, Feb 22, 2010 at 11:13 AM, David Levin wrote: >> > I've talked with some other folks on WebKit (Maciej and Oliver) about >> > having >> > a canvas that is available to worke

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread Jonas Sicking
On Mon, Feb 22, 2010 at 3:36 PM, David Levin wrote: > > > On Mon, Feb 22, 2010 at 3:10 PM, Jonas Sicking wrote: >> >> On Mon, Feb 22, 2010 at 11:13 AM, David Levin wrote: >> > I've talked with some other folks on WebKit (Maciej and Oliver) about >> > having >> > a canvas that is available to wor

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread Jeremy Orlow
On Mon, Feb 22, 2010 at 11:10 PM, Jonas Sicking wrote: > On Mon, Feb 22, 2010 at 11:13 AM, David Levin wrote: > > I've talked with some other folks on WebKit (Maciej and Oliver) about > having > > a canvas that is available to workers. They suggested some nice > > modifications to make it an off

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread David Levin
On Mon, Feb 22, 2010 at 3:10 PM, Jonas Sicking wrote: > On Mon, Feb 22, 2010 at 11:13 AM, David Levin wrote: > > I've talked with some other folks on WebKit (Maciej and Oliver) about > having > > a canvas that is available to workers. They suggested some nice > > modifications to make it an offs

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread Jonas Sicking
On Mon, Feb 22, 2010 at 11:13 AM, David Levin wrote: > I've talked with some other folks on WebKit (Maciej and Oliver) about having > a canvas that is available to workers. They suggested some nice > modifications to make it an offscreen canvas, which may be used in the > Document or in a Worker.

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread Maciej Stachowiak
On Feb 22, 2010, at 11:13 AM, David Levin wrote: I've talked with some other folks on WebKit (Maciej and Oliver) about having a canvas that is available to workers. They suggested some nice modifications to make it an offscreen canvas, which may be used in the Document or in a Worker. Co

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread Jeremy Orlow
On Mon, Feb 22, 2010 at 7:57 PM, Drew Wilson wrote: > > > On Mon, Feb 22, 2010 at 11:13 AM, David Levin wrote: > >> I've talked with some other folks on WebKit (Maciej and Oliver) about >> having a canvas that is available to workers. They suggested some nice >> modifications to make it an offsc

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread Drew Wilson
On Mon, Feb 22, 2010 at 11:13 AM, David Levin wrote: > I've talked with some other folks on WebKit (Maciej and Oliver) about > having a canvas that is available to workers. They suggested some nice > modifications to make it an offscreen canvas, which may be used in the > Document or in a Worker.

Re: [whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread Michael Nordman
The lack of support for text drawing in the worker context seems like a short sighted mistake. I understand there may be implementation issues in some browsers, but lack of text support feels like a glaring omission spec wise. On Mon, Feb 22, 2010 at 11:13 AM, David Levin wrote: > I've talked wi

[whatwg] Offscreen canvas (or canvas for web workers).

2010-02-22 Thread David Levin
I've talked with some other folks on WebKit (Maciej and Oliver) about having a canvas that is available to workers. They suggested some nice modifications to make it an offscreen canvas, which may be used in the Document or in a Worker. Proposal: Introduce an OffscreenCanvas which may be created f