Closed Bug 1065526 Opened 10 years ago Closed 10 years ago

Add a Copy() method to Moz2D Matrix

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla35

People

(Reporter: jwatt, Assigned: jwatt)

Details

Attachments

(2 files)

As discussed on IRC, let's add a Copy() method to Matrix to allow:

  dt->SetTransform(Matrix(dt->GetTransform()).Foo(...));

to be written as:

  dt->SetTransform(dt->GetTransform().Copy().Foo(...));

which I think makes it marginally easier to spot that we're modifying the existing transform. This is a really common usage pattern so I think it's worth it, although it may seem a little unnecessary to some.
Attachment #8487432 - Flags: review?(bas)
Attached patch patch gfxMatrixSplinter Review
Attachment #8487433 - Flags: review?(bas)
Comment on attachment 8487432 [details] [diff] [review]
patch Moz2D Matrix

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

I wonder if we should use FORCEINLINE if we're going to use this a lot.
Attachment #8487432 - Flags: review?(bas) → review+
Comment on attachment 8487433 [details] [diff] [review]
patch gfxMatrix

I'll add MOZ_ALWAYS_INLINE to both patches.
Attachment #8487433 - Attachment is patch: true
https://hg.mozilla.org/mozilla-central/rev/f758f49893e5
https://hg.mozilla.org/mozilla-central/rev/1c30f59cc34b
Assignee: nobody → jwatt
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Attachment #8487433 - 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: