Re: [css-compositing] blending in canvas

On Thu, Nov 15, 2012 at 2:46 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> On Thu, Nov 15, 2012 at 2:36 PM, Rik Cabanier <cabanier@gmail.com> wrote:
> > Maciej still objects because he feels that this is a substantial
> difference
> > between CSS and Canvas.
> >
> > I think we have a couple of choices:
> > 1. Keep globalCompositeOperator for blending and compositing but
> collapses
> > the 2 CSS properties into one that takes the same arguments as
> > globalCompositeOperator
> > 2. Keep the 2 CSS properties but split the Canvas properties into
> > globalCompositeOperator and globalBlendOperator
> > 3. Don't change anything and live with them being different.
> > 4. Don't change anything but also define a new CSS shorthand that
> combines
> > blending and compositing. Canvas is compatible with this shorthand.
> >
> > I'm unsure what approach we should take.
> > option 2 has the issue that we can't implement this correctly in the near
> > term.
> > option 1 has the issue that transitionable blending will be more
> confusing
> > in the future.
> > option 4 should cover all concerns but introduces yet another keyword.
>
> I like option 4, actually.  The existing blending/compositing
> properties have pretty long names (and the names use inconsistent
> conjugation, which is a bug that should be fixed).


Is the the -ing of alpha-compositing vs blend-mode?
If so, I will fix the spec.


> They'll usually be
> set together, but I can see use-cases for animating them separately.
> This suggests a shorthand property.
>
> The email Dirk just sent, where he proposes an at-rule for defining
> custom filters, uses the name "mix" for a descriptor that sets both
> blending and compositing at the same time.  I don't know if it's too
> short, but I like it.
>

Are you suggesting a new css keyword 'mix: blend-mode composite-mode' or a
new value for a css keyword that combines compositing and blending?
So:

alpha-compositing: <compositing mode>
blend-mode: <blend mode>
mix: <blend mode>  <compositing mode>  <- matches canvas'
globalCompositeOperator

Or

composite: <compositing mode> | <blend mode> | mix(<blend
mode>, <compositing mode>) <- matches canvas' globalCompositeOperator

Rik

Received on Thursday, 15 November 2012 23:41:00 UTC