RESOLVED FIXED 24648
Optimize TransformationMatrix
https://bugs.webkit.org/show_bug.cgi?id=24648
Summary Optimize TransformationMatrix
Simon Fraser (smfr)
Reported 2009-03-17 10:48:08 PDT
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.
Attachments
Patch, changelog (4.58 KB, patch)
2009-04-02 00:01 PDT, Simon Fraser (smfr)
mitz: review+
Patch to optimize map functions for translations (4.44 KB, patch)
2009-04-02 18:37 PDT, Simon Fraser (smfr)
mitz: review+
Simon Fraser (smfr)
Comment 1 2009-04-02 00:01:19 PDT
Created attachment 29183 [details] Patch, changelog
Simon Fraser (smfr)
Comment 2 2009-04-02 09:26:22 PDT
Comment on attachment 29183 [details] Patch, changelog Landed in http://trac.webkit.org/changeset/42172 Keeping bug open for further optimization.
Simon Fraser (smfr)
Comment 3 2009-04-02 18:37:56 PDT
Created attachment 29214 [details] Patch to optimize map functions for translations
mitz
Comment 4 2009-04-03 11:10:27 PDT
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.
Simon Fraser (smfr)
Comment 5 2009-04-03 11:58:12 PDT
Last patch checked in as http://trac.webkit.org/changeset/42207 I think this is enough for now.
Xan Lopez
Comment 6 2009-04-04 06:25:01 PDT
(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.
Simon Fraser (smfr)
Comment 7 2009-04-04 13:12:07 PDT
Ah, I guess it will. I need to call the FloatPoint version.
Simon Fraser (smfr)
Comment 8 2009-04-04 13:26:17 PDT
Note You need to log in before you can comment on or make changes to this bug.