- From: Jussi Kalliokoski <jussi.kalliokoski@gmail.com>
- Date: Tue, 4 Sep 2012 22:17:31 +0300
- To: Kornel Lesiński <kornel@geekhood.net>
- Cc: whatwg@lists.whatwg.org
This might be a silly idea, but what about this: When all references to the context are lost (garbage collected), simply store the image on the canvas and make it behave like it was just an image. This would lose all the state of the context, but since the problem seems to be mostly with things like graphing and stuff like that, it might not be a problem, since if the reference to the context was lost, it seems to imply that it won't be needed anymore and what's left is just a static image. Maybe I'm just missing something. Cheers, Jussi On Tue, Sep 4, 2012 at 9:51 PM, Kornel Lesiński <kornel@geekhood.net> wrote: > On Tue, 04 Sep 2012 17:43:11 +0100, Boris Zbarsky <bzbarsky@mit.edu> > wrote: > > 5) Save command stream. >> 6) Have a way for pages to explicitly snapshot a canvas. >> 7) Require opt in for hardware accelerated rendering. >> >> Any others? >> >> Of the above, I don't think #5 and #7 are realistic, for what it's worth. >> I haven't put enough thought into the rest yet to decide what I think >> about them. >> > > Would a mix of #5 and snapshotting work? > > 1. create a (fixed-size?) append-only buffer for drawing commands, > 2. log all drawing commands until the buffer is full or a > non-cheaply-serializable command (e.g. draw of <video>) is executed, > 3. snapshot, > 4. empty the buffer > 5. goto 2 > > That could make readbacks much less frequent. Would this still be a > prohibitively expensive solution? > > -- > regards, Kornel >
Received on Tuesday, 4 September 2012 19:17:59 UTC