Closed Bug 1065127 Opened 6 years ago Closed 6 years ago
Avoid matrix multiplication in lots of places by using factory constructors and the matrix adjusting methods
Right now the pattern: Matrix().Translate(x, y) is being used in a lot of places. The same is true for the Scale and Rotate methods. This is resulting in us doing lots of floating-point multiplications, when instead we should just be using Matrix's static factory methods to create such translations/scales/rotations.
Summary: Avoid Moz2D matrix multiplications in lots of places by using the factory constructors instead → Avoid matrix multiplication in lots of places by using factory constructors and the matrix adjusting methods
I've also fixed up gfxMatrix instances in my patch. And I've gone further than conversions just to the factory methods, and used the Translate(), Scale() and Rotate() methods where that further cuts the number of floating-point multiplications.
Attachment #8486803 - Flags: review?(bas) → review+
Comment on attachment 8486803 [details] [diff] [review] patch https://hg.mozilla.org/integration/mozilla-inbound/rev/e6b766d8a815
Attachment #8486803 - Flags: checkin+
(In reply to Jonathan Watt [:jwatt] from comment #3) > Comment on attachment 8486803 [details] [diff] [review] > patch > > https://hg.mozilla.org/integration/mozilla-inbound/rev/e6b766d8a815 sorry had to back this out for bustage like https://tbpl.mozilla.org/php/getParsedLog.php?id=47775227&tree=Mozilla-Inbound
https://hg.mozilla.org/integration/mozilla-inbound/rev/335f38ba4490 (Somehow I put a change that belonged in a later commit in my Try push into that earlier commit by mistake.)
Should Matrix even have a no-arg constructor if it encourages comment 0 usage.
If we removed it we'd want an Identity() static factory method, and I'm not sure people would abuse that any less. :/
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in before you can comment on or make changes to this bug.