[webkit-dev] Adding blending mode to WebKit canvas

Rik Cabanier cabanier at gmail.com
Wed Nov 14 19:50:38 PST 2012


On Wed, Nov 14, 2012 at 5:55 PM, Maciej Stachowiak <mjs at apple.com> wrote:

>
> On Nov 14, 2012, at 5:19 PM, Rik Cabanier <cabanier at gmail.com> wrote:
>
>
>
> I send the question to the fx list.
> Tab Atkins brought up that we could extend the 'globalCompositeOperator'
> so it also takes a comma separate list of a blend and a compositing
> operation.
>
> Calling:
>
> mycontext.globalCompositeOperator = 'multiply';
>
> would be identical to:
>
> mycontext.globalCompositeOperator = 'multiply, source-over';
>
>
> This would make Canvas support blending and compositing and can be
> implemented with no compatibility issues later.
>
> Does this ease your concern about the difference between Canvas and CSS?
>
>
> That still seems inconsistent between canvas and CSS to me. CSS will have
> two completely separate properties, not one that takes a comma-separated
> list, right? Why is one attribute with a comma-separated list superior for
> canvas but two properties are superior for CSS?
>

There have been requests to allow blending to be transitionable. This would
be hard to accomplish with a comma separated list since it would imply that
compositing is transitionable too.


>
> Other concerns:
> - Taking a comma-separated list misleadingly implies that it can have an
> arbitrary number of components in arbitrary order, which is not the case.
>

Maybe 'list' is not the best word. Other CSS properties have similar
constructs (ie border-image [1])


> - Compared to having a separate property, this makes it hard to
> feature-test whether blend modes are supported.
>

I don't believe that is the case. A user can set and read the property. If
it comes back with the same value, he knows it's supported.


>
> I can join the fx list to discuss this directly if you think that would
> help.
>
>
Yes, that would be most helpful!

thanks!
Rik


1: http://www.w3.org/TR/2010/WD-css3-background-20100612/#the-border-image
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20121114/9b8772bd/attachment.html>


More information about the webkit-dev mailing list