W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2012

Re: [whatwg] Hardware accelerated canvas

From: Glenn Maynard <glenn@zewt.org>
Date: Sun, 2 Sep 2012 19:36:46 -0500
Message-ID: <CABirCh_TzabW9=sKF=htTxaxTtXcNWUJxyT8X7GkZa_2sr0R0Q@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: "whatwg@lists.whatwg.org" <whatwg@lists.whatwg.org>, Erik Möller <emoller@opera.com>
On Sun, Sep 2, 2012 at 4:24 PM, Ian Hickson <ian@hixie.ch> wrote:

> Realistically, there are too many pages that have 2D canvases that are
> drawn to once and never updated for any solution other than "don't lose
> the data" to be adopted. How exactly this is implemented is a quality of
> implementation issue.

If the choice becomes "follow the spec and don't hardware-accelerate
canvas" vs. "don't follow the spec and get orders of magnitude better
performance", I suspect I can guess the choice implementors will make
(implementors invited to speak for themselves, of course).  If I was
playing a game rendered with Canvas and one browser had GPU-acceleration
and one did not, I know for sure which one I'd choose.

It wouldn't be very hard to special-case the drawn-one-time case; take a
backing store snapshot after the first render (or the first few), eg. at
the end of the task where drawing was performed.  That would allow
restoring those one-shot canvases without imposing a huge cost on canvases
that are drawn to continuously.  It'd be a hack and wouldn't work
everywhere (or every time--you can lose the context mid-script, at least in
theory), but it would avoid most breakage while still allowing
GPU-acceleration, so I wouldn't be surprised if implementations compromised
on something like this.

Glenn Maynard
Received on Monday, 3 September 2012 00:37:13 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:45 UTC