[webkit-dev] New web-facing canvas feature: "opaque" attribute

Kenneth Russell kbr at google.com
Fri Mar 15 15:23:17 PDT 2013

On Fri, Mar 15, 2013 at 1:35 AM, Maciej Stachowiak <mjs at apple.com> wrote:

> On Mar 15, 2013, at 1:19 AM, Gregg Tavares <gman at google.com> wrote:
> I don't understand the opposition to "alpha"
> You set colors in Canvas2d with rgb or rgba. That 'a' in rgba stands for
> alpha.
> You can set a global alpha for drawing with context.globalAlpha
> You read data from getImageData that returns red, green, blue, alpha
> You write data to putImageData wit red, green, blue, alpha
> I think made the case for why "alpha: false" is confusing and ambiguous.
> It does not disable any of the above features, so far as I know.
> I also don't understand why if getContext("webgl", { alpha: false }) has
> been shipping for 3 years there's a need to make it different on canvas 2d?
> Is there a nontrivial amount of content depending on it? That would be
> more relevant precedent than merely being in the code base.

How would one determine that? Searching for "getcontext webgl alpha false"
returns many web pages on the topic, but doesn't seem to find JavaScript
source code.

For one high-profile example, Angry Birds HD for the browser uses this
flag; it uncovered a bug in the Mac OS X OpenGL driver on AMD GPUs.


> Picking a different name or picking a different method (a function, an
> attribute on canvas or context) seems like bikeshedding rather than some
> functional objection.
> Besides naming, some of the suggested alternatives make a functional
> difference.
> Regards,
> Maciej
> P.S. One thing I'd like to know - if an opaque alpha/false canvas is
> itself composited (maybe CSS opacity is set on an ancestor), is it still
> somehow magically forced to ignore alpha, or does it composite as usual? If
> it's not forced opaque in the face of ancestor compositing, then I think
> that breaks the premise of using opaqueness as a trigger for subpixel
> anti-aliasing, which I thought was one of the main points of this. Note
> that opacity can change, so you can't just check CSS opacity of ancestors
> at the time of drawing into the canvas.
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130315/8dd3a1ad/attachment.html>

More information about the webkit-dev mailing list