Add a Copy() method to Moz2D Matrix

RESOLVED FIXED in mozilla35

Status

()

Core
Graphics
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: jwatt, Assigned: jwatt)

Tracking

Trunk
mozilla35
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

4 years ago
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.
(Assignee)

Comment 1

4 years ago
Created attachment 8487432 [details] [diff] [review]
patch Moz2D Matrix
Attachment #8487432 - Flags: review?(bas)
(Assignee)

Comment 2

4 years ago
Created attachment 8487433 [details] [diff] [review]
patch gfxMatrix
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+
(Assignee)

Comment 4

4 years ago
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
Last Resolved: 4 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.