Closed Bug 1074944 Opened 10 years ago Closed 10 years ago

Add Inverse() functions to Moz2D Matrix classes

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: kats, Assigned: kats)

Details

Attachments

(2 files, 1 obsolete file)

Not having a Inverse() function means that we have use Invert() everywhere which doesn't chain properly, and leads to much more annoying code.
This is a little stricter than what most code does now, which is just call Invert() and ignore the return value.
Attachment #8497620 - Flags: review?(bas)
r? to nical since he reviewed the conversion from gfx3DMatrix -> Matrix4x4
Attachment #8497622 - Flags: review?(nical.bugzilla)
Forgot to qref the #include. New try push: https://tbpl.mozilla.org/?tree=Try&rev=f9de5ed9f8d9
Attachment #8497620 - Attachment is obsolete: true
Attachment #8497620 - Flags: review?(bas)
Attachment #8497632 - Flags: review?(bas)
Attachment #8497622 - Flags: review?(nical.bugzilla) → review+
Comment on attachment 8497632 [details] [diff] [review]
Part 1 - Add the Inverse() functions

Review of attachment 8497632 [details] [diff] [review]:
-----------------------------------------------------------------

Hrm, I'm not sure I agree with this. If we do go this way I'm inclined to say we should check the bool even in release builds and MOZ_CRASH when it fails. It's very dangerous from a 'potential security bug' perspective to accidentally poison our pipeline with NaN values.
Comment on attachment 8497632 [details] [diff] [review]
Part 1 - Add the Inverse() functions

Review of attachment 8497632 [details] [diff] [review]:
-----------------------------------------------------------------

I guess the original code doesn't force people to check the return value either (although they should!) and I suppose we just do a no-op when the Matrix is !invertible, so I suppose this doesn't make things any worse.
Attachment #8497632 - Flags: review?(bas) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: