Last Comment Bug 706615 - Panning motion slows, then jerks
: Panning motion slows, then jerks
Status: VERIFIED FIXED
:
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: unspecified
: ARM Android
: P1 normal (vote)
: ---
Assigned To: Chris Lord [:cwiiis]
:
Mentors:
: 706833 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-11-30 12:20 PST by Johnathan Nightingale [:johnath]
Modified: 2012-01-09 11:12 PST (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed
11+


Attachments
WIP patch. (13.77 KB, patch)
2011-11-30 22:36 PST, Patrick Walton (:pcwalton)
chrislord.net: feedback+
Details | Diff | Splinter Review
Fix jerk after fling (6.96 KB, patch)
2011-12-01 11:19 PST, Chris Lord [:cwiiis]
bugmail: review+
Details | Diff | Splinter Review

Description Johnathan Nightingale [:johnath] 2011-11-30 12:20:18 PST
Our current panning code seems to have ease-out/deceleration physics where it comes to a rest as the panning action completes. However, rather than coming to rest, it decelerates towards zero, and then jumps to a final position a bit further along the panning path.

It seems like we'd want panning to smoothly come to a stop - the jerk at the end feels wrong.

Dupe? Phone-specific? (I'm on a galaxy s2, latest nightly)
Comment 1 Patrick Walton (:pcwalton) 2011-11-30 13:17:16 PST
I'm pretty sure this is due to some combination of Gecko being slow to paint, CPU contention between Gecko and the compositor, and texture upload. Taking this bug since it's basically what I've been working on for the past few days.
Comment 2 Patrick Walton (:pcwalton) 2011-11-30 17:18:20 PST
Actually, I think this specific bug is a regression that some of kats' work introduced. CC-ing him.
Comment 3 Patrick Walton (:pcwalton) 2011-11-30 20:34:43 PST
The problem is changeset 4e745f151abd (bug 705114).
Comment 4 Patrick Walton (:pcwalton) 2011-11-30 21:14:06 PST
Yeah, this is a massive pain. If we can't rely on devices having sane touch events, I guess we should just use the system gesture detectors, which presumably have been tested by the manufacturer.
Comment 5 Patrick Walton (:pcwalton) 2011-11-30 22:36:59 PST
Created attachment 578182 [details] [diff] [review]
WIP patch.

Here's a WIP patch. Should basically be a rebased version of your (Cwiiis') patch from earlier that switched to gesture detectors. This regresses clicking on links, so it can't land as is, but it should be the basic idea.
Comment 6 Chris Lord [:cwiiis] 2011-12-01 03:25:44 PST
Comment on attachment 578182 [details] [diff] [review]
WIP patch.

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

Good other than what's noted below. I'd have thought that combined with wesj's patch in bug #704579 that just went in, this should solve that tapping links no longer works.

::: mobile/android/base/ui/PanZoomController.java
@@ +249,3 @@
>          if (mState == PanZoomState.PANNING_LOCKED) {
>              // check to see if we should break the axis lock
> +            double angle = Math.atan2(distanceY, distanceX);    // range [-pi, pi]

This is not equivalent to what was there before - distanceX,distanceY are the distances moved since the last call to onScroll, where this expects the distance moved since the first touch event.

@@ -454,5 @@
>              PLUS,       // Overscrolled in the positive direction
>              BOTH,       // Overscrolled in both directions (page is zoomed to smaller than screen)
>          }
>  
> -        public float firstTouchPos;             /* Position of the first touch event on the current drag. */

We probably still want firstTouchPos for the comment above.
Comment 7 Mark Finkle (:mfinkle) (use needinfo?) 2011-12-01 08:37:40 PST
*** Bug 706833 has been marked as a duplicate of this bug. ***
Comment 8 Chris Lord [:cwiiis] 2011-12-01 10:37:12 PST
Taking this - will have a fix soon.
Comment 9 Chris Lord [:cwiiis] 2011-12-01 11:19:56 PST
Created attachment 578333 [details] [diff] [review]
Fix jerk after fling

This patch fixes the issue for me on my Galaxy Nexus.
Comment 10 Chris Lord [:cwiiis] 2011-12-01 11:28:31 PST
http://hg.mozilla.org/projects/birch/rev/559d132a200e
Comment 11 Aaron Train [:aaronmt] 2011-12-02 07:03:36 PST
Samsung Galaxy SII (Android 2.3.4)
20111202040206
http://hg.mozilla.org/projects/birch/rev/e2a54aafac18

Note You need to log in before you can comment on or make changes to this bug.