[whatwg] [canvas] globalCompositeOperation poorly defined

L. David Baron dbaron at dbaron.org
Thu Jun 22 18:50:39 PDT 2006


The values of globalCompositeOperation are very poorly defined:
  http://www.whatwg.org/specs/web-apps/current-work/#globalcompositeoperation
Some math is probably needed; prose alone seems unlikely to be
sufficient.

I made a quick test at:
  http://dbaron.org/tests/canvas/composite-operations

Trunk Mozilla and Opera 9 do not interoperate on at least the following
(ignoring differences that could be attributed to rounding):
  source-atop
  source-over (the default!)
  destination-atop
  lighter
  darker
  xor

(Safari seems to show the colors as either random noise (latest for
10.3/PPC) or blank (latest for 10.4/Intel).)

Looking at Mozilla's code, it implements "copy" and "source-over" as the
same thing; from the code I'd guess that "source-over" was the incorrect
one, and this test seems to agree.

-David

-- 
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20060622/aca43799/attachment-0001.pgp>


More information about the whatwg mailing list