[whatwg] Hardware accelerated canvas

Jussi Kalliokoski jussi.kalliokoski at gmail.com
Tue Sep 4 12:17:31 PDT 2012

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

Maybe I'm just missing something.


On Tue, Sep 4, 2012 at 9:51 PM, Kornel Lesiński <kornel at geekhood.net> wrote:

> On Tue, 04 Sep 2012 17:43:11 +0100, Boris Zbarsky <bzbarsky at 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

More information about the whatwg mailing list