Closed Bug 985470 Opened 10 years ago Closed 10 years ago

Replace the Moz2D Matrix().Translate() calls with Matrix::Translation() for better perf

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: jwatt, Assigned: jwatt)

Details

Attachments

(1 file)

We should replace the Moz2D Matrix().Translate() calls with Matrix::Translation() for better perf.
Attached patch patchSplinter Review
Attachment #8393501 - Flags: review?(matt.woodrow)
Comment on attachment 8393501 [details] [diff] [review]
patch

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

::: gfx/2d/FilterNodeSoftware.cpp
@@ +1108,5 @@
>      return nullptr;
>    }
>  
> +  Matrix transform = Matrix::Translation(srcRect.x, srcRect.y) * mMatrix *
> +                     Matrix::Translation(-aRect.x, -aRect.y);

For best performance you'd want to implement PreTranslate() and use that plus Translate() since we can do significantly less work in those cases.
Attachment #8393501 - Flags: review?(matt.woodrow) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/2cbac6fa8499

(In reply to Matt Woodrow (:mattwoodrow) from comment #2)
> For best performance you'd want to implement PreTranslate() and use that
> plus Translate() since we can do significantly less work in those cases.

PreXXX() makes the code ugly and harder to follow. We can get the same wins with some type tricks to make the compiler do the work we want while still keeping the code looking nice. I plan on doing that as a follow-up.
https://hg.mozilla.org/mozilla-central/rev/2cbac6fa8499
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
You need to log in before you can comment on or make changes to this bug.