Bug 95909 - Refactoring SVG's Path datastructures
Summary: Refactoring SVG's Path datastructures
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 420+
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2012-09-05 16:45 PDT by Philip Rogers
Modified: 2012-09-05 21:58 PDT (History)
5 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Philip Rogers 2012-09-05 16:45:22 PDT
SVGPathByteStream is a datastructure with the following performance characteristics:
insert - O(n)
append - O(n)
replace - O(n)
modify any element - O(n)

In SVGPathUtilities we have methods for syncing SVGPathSegLists, SVGPathByteStream, and the string representation of a path. Modifying a PathSeg from a PathSegList requires rebuilding the entire byte stream (with the possible exception of append, see wkbug.com/94048). Once we have a PathSegList, updating the bytestream does not seem like the right approach. Instead, we should use a vector-backed datastructure (insert O(1), append O(1), replace O(1), modify O(1)) or go directly to the Path data itself.