W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2013

Re: [whatwg] Enabling LCD Text and antialiasing in canvas

From: Gregg Tavares <gman@google.com>
Date: Wed, 13 Mar 2013 11:48:28 -0700
Message-ID: <CAKZ+BNq0Lk9fU4bChd6B-TwDVRanzPcLRamKVfLEbfg-M7U1Mg@mail.gmail.com>
To: "Robert O'Callahan" <robert@ocallahan.org>
Cc: Stephen White <senorblanco@chromium.org>, WHAT Working Group <whatwg@whatwg.org>, Ian Hickson <ian@hixie.ch>, Rik Cabanier <cabanier@gmail.com>
Sorry for only mentioning this so late but is there any chance to steer
this to be more inline with WebGL?

WebGL already has the option to have an opaque canvas using context
creation parameters. In WebGL it's

   gl = canvas.getContext("webgl", {alpha: false});

If we go forward with an "opaque" attribute now you have 2 conflicting

   canvas.opaque = true;
   gl = canvas.getContext("webgl", {alpha: true});

Who wins that conflict? Yea, I know we could come up with rules. (&& the 2
settings, etc...)

But, there are other context creation attributes we'd like to see on a 2d
canvas. One that comes to mind is 'preserveDrawingBuffer'.
preserveDrawingBuffer: false in WebGL means that the canvas is double
buffered. This is a performance win since most browsers using GPU
compositing need to copy the contents of the canvas when compositing.
Setting preseverDrawingBuffer: false (which is the default in WebGL) means
the browser can double buffer and avoid the copy. We'd like to see that
same attribute for 2D canvas/contexts to get the same perf benefit for
canvas games, etc.

So, given we want more creation attributes and given WebGL already has a
way to declare opaqueness why not follow the existing method and add
context creation parameters to 2d canvas to solve this issue rather than
make a new and conflicting 'opaque' attribute?
Received on Wednesday, 13 March 2013 18:48:55 UTC

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