Re: SVG API for canvas

(2014/06/11 16:15), Dirk Schulze wrote:
> However, I think we can both agree that the current Blink/WebKit code still has the potential for significant optimizations. At the moment we compute the value for each frame even in simple cases and still try to synchronize with other potential animations and check for event handlers. All that overhead is not part of your scripted version.

I don't think anyone's really tried to optimize SMIL so it's hard to 
compare current browser implementations of SMIL to JS.

In Gecko there's a long list of significant optimizations we *could* 
make to SMIL but we've never bothered since it has never had enough 
usage to be a priority.

For example, we queue up events even when no-one is listening for them 
and for animations that iterate quickly--or when you have a lot of short 
animations like in the demo--that amounts to a *lot* of busy work.

Theoretically, though, the range of optimizations that *could* be done 
for SMIL are different to JS. For example, we could run some SMIL 
animations off the main thread. For JS though I can't see that happening 
except for canvas animations run in workers (or when using the Web 
Animations API).

The best chance I can see of SMIL implementations actually getting those 
kind of optimizations though, is if it gets rebased in terms of Web 
Animations primitives (or if IE implements it and it gets more usage).

 > From looking at examples on the web, it is unclear if the sandwich 
model is really what authors are looking for.

The sandwich model basically just means "additive animation", i.e. the 
following works:

   <div class="spin swell">

I don't see why that would require a big performance hit.

> Btw. the complexity doesn’t get lower with the Web Animations spec. Its concept of players, variable timelines and easing functions probably makes it more complex. We will see what impact that has on performance once there are first implementations. Of course SMIL would benefit of such an implementation as well and both would probably have the same performance characteristics.

What are variable timelines?

Easing functions = animation-timing-function aka keySplines/calcMode. 
There's nothing new there.

Best regards,


Received on Wednesday, 11 June 2014 07:47:05 UTC