Closed Bug 1046993 Opened 6 years ago Closed 6 years ago

Use more floating-point coordinates in Axis

Categories

(Core :: Panning and Zooming, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: botond, Assigned: botond)

Details

Attachments

(1 file)

Currently, gfx/layers/apz/src/Axis.{h,cpp} uses a mixture of integer and floating-point coordinates. This means we are doing rounding/truncating that could be avoided. It would be better to use floating-point coordinates throughout.
Any micro benchmarks to help us not regress performance?
Attached patch bug1046993.patchSplinter Review
This patch modifies Axis to consistently use floating-point coordinates.

I also took the opportunity to modify GetFirstTouchScreenPoint(), which was returning by reference for no good reason, to return by value.
Assignee: nobody → botond
Attachment #8476265 - Flags: review?(bugmail.mozilla)
Comment on attachment 8476265 [details] [diff] [review]
bug1046993.patch

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

Nice!
Attachment #8476265 - Flags: review?(bugmail.mozilla) → review+
(In reply to Milan Sreckovic [:milan] from comment #1)
> Any micro benchmarks to help us not regress performance?

The amount of computation we do with these values is a few operations per touch event, so I would expect any performance impact to be negligible. The new code might actually be faster (again, by a negligible amount) by avoiding some float -> int -> float round trips.

The value in this change is from the accuracy we gain by avoiding such round trips.
https://hg.mozilla.org/mozilla-central/rev/85a95286b6cf
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.