[whatwg] Canvas: clarification of compositing operations needed

Robert O'Callahan robert at ocallahan.org
Thu Jul 29 20:48:37 PDT 2010


On Thu, Jul 29, 2010 at 10:09 AM, Oliver Hunt <oliver at apple.com> wrote:

> This is the way the webkit canvas implementation has always worked, firefox
> implemented this incorrectly, and the spec was based off of that
> implementation.
>

I don't think "the spec was based off of that implementation" is true, since
Firefox never matched the spec (certain operators such as "copy" were
treated as source-bounded, because cairo does it that way, just like CG)
until I fixed that relatively recently.

Additionally the webkit behaviour is more powerful than the spec behaviour
> as the spec behaviour can be emulated trivially on top of the webkit model,
> but vice versa is much harder and much more expensive.
>

They're both pretty easy to emulate in terms of the other. But I agree that
emulating an unbounded operator in terms of the source-bounded operator has
a higher performance penalty, since the easy implementation is to use a
temporary surface, where as to emulate source-bounded using unbounded you
just do some extra clipping.

As it happens, I'm expecting to see a proposal on public-canvas-api sometime
soon that makes all composition source-bounded and has acceptable text
defining the shape affected by the composition operation. It's tricky
though, especially regarding shadows. But since I agree source-boundedness
is more intuitive for authors, I'm open to changing Firefox to support it.

Rob
-- 
"Now the Bereans were of more noble character than the Thessalonians, for
they received the message with great eagerness and examined the Scriptures
every day to see if what Paul said was true." [Acts 17:11]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100730/5e4f38a3/attachment-0002.htm>


More information about the whatwg mailing list