On Fri, Mar 15, 2013 at 9:19 AM, Gregg Tavares <g...@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 > > So why name an option that effectively removes the alpha something not > called "alpha"? I have no better idea what "opaque" means. As far as I > know it just means blending won't happen during compositing but alpha still > exists when I draw and when I read from the canvas. That seems more > confusing to me. > > 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? > 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. There's a solution, it has existed and been shipping > in WebKit for 3 years. Can't we just go with that? Developers will be no > more confused by this than whether drawImage is drawImage(img, x, y) or > drawImage(x, y, img). You look up once in a while. > > As far as the spec goes, the effect of setting alpha:false is as if every > draw operation ended with > > dest = RGBA | 0x000000FF > > That means everything works as speced. getImageData will pull out RGBA but > A will always be 255. Every draw call including putImageData follows the > rule above. How that effects compositing is not a normative part of the > spec. It's just something UAs happen to know they can do. > For what it's worth, I'm with Greg on this. First of all, this is not needed for other elements, only canvas - other elements have enough information about whether or not they're opaque since they're fully declarative. So I don't see value in trying to extend the solution to areas where the problem doesn't exist. Second, having an "alpha" option and other options on drawing buffers is really a standard feature in toolkits, libraries, windowing systems etc. - it feels natural and not like an optimization hack.
_______________________________________________ webkit-dev mailing list webkit-dev@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-dev