mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-11 01:57:00 +00:00
![Lee Salzman](/assets/img/avatar_default.png)
TransformedCopyToBuilder is called any time in Canvas2D the transform is modified and then a path op is used. On cases that repeatedly change the transform while building paths, this leads to fairly significant expense in repeatedly copying the path contents as well as allocating and deallocating paths. To work around this, a new primitive TransformedMoveToBuilder is provided that allows in-place transforming of the path contents. Because paths that are "finished" and referenced externally can't be safely modified, extra static methods (i.e. ToBuilder) are added to guarantee that there are no other refs to the path before modifying its contents. One snag is that ArcParams could previously not handle transforms, so it is modified to allow a transform to be supplied to an Arc op, which is only flattened out when it is streamed to a sink. Differential Revision: https://phabricator.services.mozilla.com/D225548