We should make a pass over TransformationMatrix and optimize it to reduce copying. For example, translate() and translate3d() could easily be optimized. multiply() could be factored with multLeft() to avoid matrix copies, and more.
Created attachment 29183 [details] Patch, changelog
Comment on attachment 29183 [details] Patch, changelog Landed in http://trac.webkit.org/changeset/42172 Keeping bug open for further optimization.
Created attachment 29214 [details] Patch to optimize map functions for translations
Comment on attachment 29214 [details] Patch to optimize map functions for translations > + return FloatPoint(static_cast<float>(p.x() + m_matrix[3][0]), static_cast<float>(p.y() + m_matrix[3][1])); I slightly prefer casting the matrix element to float rather than casting the coordinate to double, adding in doubles, and casting the result down to float. r=me either way.
Last patch checked in as http://trac.webkit.org/changeset/42207 I think this is enough for now.
(In reply to comment #5) > Last patch checked in as http://trac.webkit.org/changeset/42207 > > I think this is enough for now. > // Like the version above, except that it rounds the mapped point to the nearest integer value. - IntPoint mapPoint(const IntPoint&) const; + IntPoint mapPoint(const IntPoint& p) const + { + return roundedIntPoint(mapPoint(p)); + } Won't this call itself until the stack blows up? Because I'm getting exactly this with your patch in reddit.com for example.
Ah, I guess it will. I need to call the FloatPoint version.
Fixed mapPoint in http://trac.webkit.org/changeset/42228