Open kangax opened 10 years ago
@jhondge @asturur I just did some basic testing and Path2D is indeed significantly faster than the current method when drawing a complex path.
yes it is without doubt quicker and saves memory and time from our parsing and caching of arcs.
If someone wants to make a pr to have both of them i m happy to review it.
one difficulty is how to accurately detect full browser support for Path2D. Apparently Edge only has partial support, and doesn't allow parsing of svg path strings.
https://stackoverflow.com/questions/53787259/detect-when-path2d-with-svg-path-string-is-supported
Well there are 2 things at stake here, speed and code semplification. Now in my mind there was always the idea to simply SVG paths, since we can't draw the A segments and we need to parse them in multiple C segments.
Also SVG can have the lowercase and uppercase commands.
If you want to fiddle with path commands, having everything uppercase and not having As is easier.
So we could anyway support path2d after semplifying the paths and manually adding them to the Path2D object. That would give us speed anyway but more code more than less of it.
http://blogs.adobe.com/webplatform/2014/04/01/new-canvas-features/
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.