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 m...@apple.com 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

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

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 have a skewed

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

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 m...@apple.com 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

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 m...@apple.com 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

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 m...@apple.com wrote: Copying from one canvas to another is much faster than copying to/from ImageData. To make copying to a Worker worthwhile

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 could

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 oli...@apple.com 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 canvas to manipulate files on the users file system.

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 m...@apple.com wrote: On Mar 13, 2010, at 12:30 PM, Jonas Sicking wrote: On Sat, Mar 13, 2010 at 12:09 PM, Oliver Hunt oli...@apple.com wrote: On Mar 13, 2010, at 9:10 AM, Jonas Sicking wrote: There is a use case, which I suspect is quite

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 m...@apple.com 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.

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 canvas 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

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 oli...@apple.com 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 canvas to manipulate files on the users file system. For example when creating a photo uploader which does

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 atwil...@google.com 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 micha...@google.com wrote: The lack of support for text drawing in the

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 le...@google.com wrote: On Mon, Feb 22, 2010 at 3:10 PM, Jonas Sicking jo...@sicking.cc 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

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 jo...@sicking.cc wrote: On Fri, Mar 12, 2010 at 11:57 AM, David Levin le...@google.com wrote: On Mon, Feb 22, 2010 at 3:10 PM, Jonas Sicking jo...@sicking.cc wrote: What is the use case for this? It seems like in most cases you'll want to

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 for

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 oli...@apple.com 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

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 jo...@sicking.cc wrote: On Fri, Mar 12, 2010 at 12:46 PM, Oliver Hunt oli...@apple.com 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

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 le...@google.com wrote: On Fri, Mar 12, 2010 at 2:35 PM, Jonas Sicking jo...@sicking.cc wrote: On Fri, Mar 12, 2010 at 12:46 PM, Oliver Hunt oli...@apple.com wrote: On Mar 12, 2010, at 12:16 PM, Jonas Sicking wrote: I'm not saying that the

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 oli...@apple.com 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 4:19 PM, Jonas Sicking jo...@sicking.cc wrote: On Fri, Mar 12, 2010 at 3:38 PM, David Levin le...@google.com wrote: On Fri, Mar 12, 2010 at 2:35 PM, Jonas Sicking jo...@sicking.cc wrote: On Fri, Mar 12, 2010 at 12:46 PM, Oliver Hunt oli...@apple.com wrote: On Mar

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 jo...@sicking.cc wrote: On Fri, Mar 12, 2010 at 3:38 PM, David Levin le...@google.com wrote: On Fri, Mar 12, 2010 at 2:35 PM, Jonas Sicking jo...@sicking.cc wrote: On Fri, Mar 12, 2010 at

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 m...@apple.com 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

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 m...@apple.com wrote: - Raytracing a complex scene at high resolution. - Drawing a highly zoomed in high resolution portion of the

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 m...@apple.com 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 m...@apple.com wrote: - Raytracing a complex scene at high

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 jo...@sicking.cc wrote: On Wed, Feb 24, 2010 at 12:14 AM, Maciej Stachowiak m...@apple.com 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

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 m...@apple.com 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

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 Anne van Kesteren
On Wed, 24 Feb 2010 16:45:44 +0100, Andrew Grieve agri...@google.com 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

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 jo...@sicking.cc wrote: On Mon, Feb 22, 2010 at 4:34 PM, Jeremy Orlow jor...@chromium.org wrote: On Tue, Feb 23, 2010 at 12:05 AM, Jonas Sicking jo...@sicking.cc wrote: On Mon, Feb 22, 2010 at 3:43 PM, Jeremy Orlow jor...@chromium.org

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 jo...@sicking.cc wrote: On Mon, Feb 22, 2010 at 3:43 PM, Jeremy Orlow jor...@chromium.org wrote: On Mon, Feb 22, 2010 at 11:10 PM, Jonas Sicking jo...@sicking.cc wrote: On Mon, Feb 22, 2010 at 11:13 AM, David Levin le...@google.com wrote:

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 jor...@chromium.org wrote: On Tue, Feb 23, 2010 at 12:46 AM, Jonas Sicking jo...@sicking.cc wrote: On Mon, Feb 22, 2010 at 4:34 PM, Jeremy Orlow jor...@chromium.org wrote: On Tue, Feb 23, 2010 at 12:05 AM, Jonas Sicking jo...@sicking.cc wrote:

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

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 m...@apple.com 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

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 jo...@sicking.cc wrote: On Tue, Feb 23, 2010 at 9:57 PM, Maciej Stachowiak m...@apple.com 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

[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

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 le...@google.com wrote:

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

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.

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

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 jo...@sicking.cc wrote: On Mon, Feb 22, 2010 at 11:13 AM, David Levin le...@google.com 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

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 le...@google.com wrote: On Mon, Feb 22, 2010 at 3:10 PM, Jonas Sicking jo...@sicking.cc wrote: On Mon, Feb 22, 2010 at 11:13 AM, David Levin le...@google.com wrote: I've talked with some other folks on WebKit (Maciej and Oliver) about having

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 jor...@chromium.org wrote: On Mon, Feb 22, 2010 at 11:10 PM, Jonas Sicking jo...@sicking.cc wrote: On Mon, Feb 22, 2010 at 11:13 AM, David Levin le...@google.com wrote: I've talked with some other folks on WebKit (Maciej and Oliver) about having

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 jo...@sicking.cc wrote: On Mon, Feb 22, 2010 at 3:43 PM, Jeremy Orlow jor...@chromium.org wrote: On Mon, Feb 22, 2010 at 11:10 PM, Jonas Sicking jo...@sicking.cc wrote: On Mon, Feb 22, 2010 at 11:13 AM, David Levin le...@google.com wrote:

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 jor...@chromium.org wrote: On Tue, Feb 23, 2010 at 12:05 AM, Jonas Sicking jo...@sicking.cc wrote: On Mon, Feb 22, 2010 at 3:43 PM, Jeremy Orlow jor...@chromium.org wrote: On Mon, Feb 22, 2010 at 11:10 PM, Jonas Sicking jo...@sicking.cc wrote: