[whatwg] Canvas: clarification of compositing operations needed
jamesr at google.com
Wed Jul 28 15:10:10 PDT 2010
On Wed, Jul 28, 2010 at 2:46 PM, Tab Atkins Jr. <jackalmage at gmail.com>wrote:
> On Wed, Jul 28, 2010 at 2:43 PM, David Flanagan <david at davidflanagan.com>
> > Firefox and Chrome disagree about the implementation of the
> > destination-atop, source-in, destination-in, and source-out compositing
> > operators. Test code is attached.
I don't think your attachment made it through.
some of the differences, although it does not cover all cases.
> > Chrome doesn't touch any destination pixels that are not underneath the
> > source pixels. Firefox, on the other hand, treats the entire canvas
> > the clipping region) as the destination and if you use the destination-in
> > operator, for example, will erase any pixels outside of whatever you are
> > drawing.
> > I suspect, based on the reference to an "infinite transparent black
> > in 220.127.116.11.13 Drawing model that Firefox gets this right and Chrome gets
> > wrong, but it would be nice to have that confirmed.
> > I suggest clarifying 18.104.22.168.3 Compositing to mention that the
> > operation takes place on all pixels within the clipping region, and that
> > some compositing operators clear large portions of the canvas.
> The spec is completely clear on this matter - Firefox is right,
> Chrome/Safari are wrong. They do it wrongly because that's how
> CoreGraphics, their graphics library, does things natively.
The spec is certainly clear but that does not make the behavior it specifies
good. I find the spec's behavior pretty bizarre and Microsoft has expressed
a preference for the Safari/Chrome interpretation:
although that thread did not get much discussion. For example, I think
drawing a 20x20 image into a 500x500 canvas without scaling with a
globalCompositeOperation of 'copy' should result in only the 20x20 region
being cleared out, not the entire canvas.
In informal discussions I got the impression that most folks would be happy
to standardize on something closer to the Safari/Chrome model if it could be
specified exactly. In particular, there has to be a precise definition of
what region the compositing operation should apply in.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the whatwg