Closed
Bug 1065031
Opened 12 years ago
Closed 12 years ago
Document and rename Moz2D Matrix's Translate, Scale and Rotate methods
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: jwatt, Assigned: jwatt)
References
Details
Attachments
(2 files)
|
4.82 KB,
patch
|
bas.schouten
:
review+
jwatt
:
checkin+
|
Details | Diff | Splinter Review |
|
31.62 KB,
patch
|
bas.schouten
:
review+
jwatt
:
checkin+
|
Details | Diff | Splinter Review |
As discussed on the gfx weekly call, we should rename Moz2D Matrix's Translate, Scale and Rotate methods to have a "Pre" prefix, and document what they do. This is because:
myMatrix * Matrix::Translation(x, y)
does not give the same result as:
myMatrix.Translate(x, y)
as might be expected (the order is in fact the opposite).
| Assignee | ||
Comment 1•12 years ago
|
||
The non-gfx/2d directory changes coming up after this is reviewed.
Attachment #8486582 -
Flags: review?(bas)
| Assignee | ||
Comment 2•12 years ago
|
||
Ignore the comment at the start of the Matrix class. I forgot to remove that.
| Assignee | ||
Comment 3•12 years ago
|
||
Comment 4•12 years ago
|
||
Comment on attachment 8486582 [details] [diff] [review]
part 1 - moz2d code
Review of attachment 8486582 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/2d/Matrix.h
@@ +129,5 @@
> + static Matrix Scaling(Float aScaleX, Float aScaleY)
> + {
> + return Matrix(aScaleX, 0.0f, 0.0f, aScaleY, 0.0f, 0.0f);
> + }
> +
nit: whitespace
Attachment #8486582 -
Flags: review?(bas) → review+
| Assignee | ||
Updated•12 years ago
|
Attachment #8486830 -
Flags: review?(bas)
Comment 5•12 years ago
|
||
Comment on attachment 8486830 [details] [diff] [review]
non-Moz2D code
Review of attachment 8486830 [details] [diff] [review]:
-----------------------------------------------------------------
Awesome.
::: gfx/layers/basic/BasicCanvasLayer.cpp
@@ +41,5 @@
> + oldTM = aDT->GetTransform();
> + Matrix newTM = oldTM;
> + newTM.PreTranslate(0.0f, mBounds.height);
> + newTM.PreScale(1.0f, -1.0f);
> + aDT->SetTransform(newTM);
nit: why not just Matrix(oldTM).PreTranslate().PreScale() like you do elsewhere?
Attachment #8486830 -
Flags: review?(bas) → review+
| Assignee | ||
Comment 6•12 years ago
|
||
Comment on attachment 8486582 [details] [diff] [review]
part 1 - moz2d code
(In reply to Bas Schouten (:bas.schouten) from comment #5)
> nit: why not just Matrix(oldTM).PreTranslate().PreScale() like you do
> elsewhere?
Mostly because that exceeded the 80 column rule. I changed it to that wish some line breaks that I think still make it clear to read.
https://hg.mozilla.org/integration/mozilla-inbound/rev/3c06063cfce3
https://hg.mozilla.org/integration/mozilla-inbound/rev/09d86eb69c01
Attachment #8486582 -
Flags: checkin+
| Assignee | ||
Updated•12 years ago
|
Attachment #8486830 -
Flags: checkin+
Comment 7•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/3c06063cfce3
https://hg.mozilla.org/mozilla-central/rev/09d86eb69c01
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in
before you can comment on or make changes to this bug.
Description
•