Closed
Bug 1065127
Opened 11 years ago
Closed 11 years ago
Avoid matrix multiplication in lots of places by using factory constructors and the matrix adjusting methods
Categories
(Core :: Graphics, defect)
Core
Graphics
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: jwatt, Assigned: jwatt)
References
Details
(Keywords: perf)
Attachments
(1 file)
|
31.34 KB,
patch
|
bas.schouten
:
review+
jwatt
:
checkin+
|
Details | Diff | Splinter Review |
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.
| Assignee | ||
Updated•11 years ago
|
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
| Assignee | ||
Comment 1•11 years ago
|
||
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.
| Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8486803 -
Flags: review?(bas)
Updated•11 years ago
|
Attachment #8486803 -
Flags: review?(bas) → review+
| Assignee | ||
Comment 3•11 years ago
|
||
Comment on attachment 8486803 [details] [diff] [review]
patch
https://hg.mozilla.org/integration/mozilla-inbound/rev/e6b766d8a815
Attachment #8486803 -
Flags: checkin+
Comment 4•11 years ago
|
||
(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
| Assignee | ||
Comment 5•11 years ago
|
||
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.)
Comment 6•11 years ago
|
||
Should Matrix even have a no-arg constructor if it encourages comment 0 usage.
| Assignee | ||
Comment 7•11 years ago
|
||
If we removed it we'd want an Identity() static factory method, and I'm not sure people would abuse that any less. :/
Comment 8•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in
before you can comment on or make changes to this bug.
Description
•