Closed Bug 962826 Opened 9 years ago Closed 9 years ago

Multiply by DPI inside AsyncPanZoomController::GetTouchStartTolerance

Categories

(Core :: Panning and Zooming, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: kats, Assigned: snigdhaagarwal93)

Details

(Whiteboard: [mentor=botond][lang=c++][good first bug])

Attachments

(1 file, 2 obsolete files)

At [1], we call GetTouchStartTolerance and multiply it by the DPI (from the tree manager). At [2] we use gTouchStartTolerance multiplied by the DPI (which is the exact same thing). It would be cleaner to move the DPI multiplication inside GetTouchStartTolerance, and to use the helper function at [2] instead of using gTouchStartTolerance directly. This is purely refactoring, should be a straightforward change for a first-time contributor.

[1] http://mxr.mozilla.org/mozilla-central/source/gfx/layers/ipc/GestureEventListener.cpp?rev=d1d7d42059c8#108
[2] http://mxr.mozilla.org/mozilla-central/source/gfx/layers/ipc/AsyncPanZoomController.cpp?rev=d1d7d42059c8#594
Stealing mentorship.
Whiteboard: [mentor=kats][lang=c++][good first bug] → [mentor=botond][lang=c++][good first bug]
Attachment #8364981 - Flags: review?(botond)
Attachment #8364981 - Attachment description: patch3.patch → GetTouchStartTolerance() returns the product now
(In reply to snigdhaagarwal93 from comment #2)
> Created attachment 8364981 [details] [diff] [review]
> GetTouchStartTolerance() returns the product now

Thanks for working on this! It looks like the attached patch is empty though - could you reupload it please?
Sorry for the empty patch earlier. 
This one has all the changes.
Attachment #8364981 - Attachment is obsolete: true
Attachment #8364981 - Flags: review?(botond)
Attachment #8365506 - Flags: review?(botond)
Comment on attachment 8365506 [details] [diff] [review]
GetTouchStartTolerance() returns the product now

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

Thanks for the patch! I have one small suggestion:

::: gfx/layers/ipc/GestureEventListener.cpp
@@ +103,5 @@
>    case MultiTouchInput::MULTITOUCH_MOVE: {
>      // If we move too much, bail out of the tap.
>      ScreenIntPoint delta = event.mTouches[0].mScreenPoint - mTouchStartPosition;
>      if (mTouches.Length() == 1 &&
> +        NS_hypot(delta.x, delta.y) > mAsyncPanZoomController->GetTouchStartTolerance())

Since we're cleaning up this code anyways, let's clean up one more thing: GetTouchStartTolerance() is a static method of AsyncPanZoomController, so there is no need to call it through an instance. Let's call it as "AsyncPanZoomController::GetTouchStartTolerance()" instead.
Updated Patch.
Attachment #8365506 - Attachment is obsolete: true
Attachment #8365506 - Flags: review?(botond)
Attachment #8367905 - Flags: review?(botond)
Comment on attachment 8367905 [details] [diff] [review]
Object call to GetTouchStartTolerance() removed

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

Great, thanks!

You can have the patch be committed by adding "checkin-needed" to the Keywords field of the bug.
Attachment #8367905 - Flags: review?(botond) → review+
(In reply to Botond Ballo [:botond] from comment #7)
> You can have the patch be committed by adding "checkin-needed" to the
> Keywords field of the bug.

Just realized you might not have the permission to do that, so I added the flag for you.
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/dd8a9796aa31

Please use your full name in the Mercurial commit information :)
Assignee: nobody → snigdhaagarwal93
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/dd8a9796aa31
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.