Frågan var alltså hur EaselJS hanterar omrenderingen av Display Objects vid förändringar. Jag kunde inte ge något vettigt svar på den frågan så jag passade den vidare till Grant Skinner som står bakom CreateJS:
“That’s a great question. EaselJS does not automatically handle “dirty rects”, it rerenders the full canvas each frame. A large part of the reason for this is that it is EXTREMELY expensive to do bounds calculations on vector content in javascript. I’ve done some partial implementations, and it very quickly became clear that the cost of calculating dirty rects is much higher than the cost of rendering everything in almost every case.
That said, we do provide the .cache() mechanism to give you have some control over rendering. Similar to cache as bitmap in Flash, you can cache any display object, and as you have already discovered, it will pre-render it to a separate cacheCanvas. Then when the stage redraws, it can simply draw the cache, instead of re-rendering the display list (handy for complex vectors or Containers with lots of content in them that don’t change frequently).
Hope that makes sense.
One of the goals for EaselJS v0.5.0 is to also provide a SpriteSheetBuilder class, that will let you assemble spritesheets at run time (so you can have the file size benefit of vector graphics, with the performance of sprite sheets).
Cheers,
Grant.”