Open Bug 1543195 Opened 6 years ago Updated 3 years ago

Fling destination prediction used for snapping is way off on Android

Categories

(Core :: Panning and Zooming, defect, P3)

Other Branch
All
Android
defect

Tracking

()

People

(Reporter: kats, Unassigned)

Details

Found while investigating bug 1541644. In ScrollSnapToDestination we predict the final position after a fling is complete and use that to figure out where to snap to, if scroll snapping is enabled. However on Android I think there's a mismatch in the physics between this predicted destination and what the AndroidFlingPhysics actually computes. With various loggings enabled, for example, I see this:

APZC: 0xb8016000 fling snapping.  friction: 0.004000 velocity: 1.264291, 0.000000 predictedDelta: 315.440094, 0.000000 position: 2.300000, 0.000000 predictedDestination: 123.218704, 0.000000
... // fling happens
FLING: 0xb8016000 ending fling animation. overscrolled=0
APZC: 0xb8016000 changing from state 1 to 0
APZC: Calculated displayport as (x=-95.116653, y=-165.887482, w=570.699951, h=995.324951) from velocity (0,0) paint time 50.000000 metrics:{ [cb=(x=43.739132, y=391.869568, w=992.521729, h=292720.687500)] [sr=(x=0.000000, y=0.000000, w=593.599976, h=112209.601562)] [s=(57.1646,0)] [dp=(x=0.000000, y=0.000000, w=593.599976, h=4710.399902)] [cdp=(x=0.000000, y=0.000000, w=593.599976, h=1177.599976) [dpm=(l=248.130402, t=432.749969, r=248.130402, b=432.749969)] [rcs=(w=414.000000, h=663.549988)] [v=(x=0.000000, y=0.000000, w=380.466675, h=112209.601562)] [z=(ld=2.609 r=1.000 cr=1 z=2.61 er=1)] [u=(1 0 36)] [i=(5 14 0)] }
APZC: 0xb8016000 scroll snapping near (57.1646,0)

i.e. we start out at x=2.3, and the predicted destination of the fling is at x=123.218704, but when the fling is done we're only at x=57.1646 which is a pretty big difference.

I think we need to modify this prediction code to actually obtain the predicted destination from the fling animation class instead of just assuming a particular model.

/cc Hiro as a FYI. I know you're working on the new scroll snapping stuff, not sure if you feel like picking this one up too.

Flags: needinfo?(hikezoe)

I suppose this will be fixed by 1546057, but still, I might be missing something.

Flags: needinfo?(hikezoe)

This was not fixed by bug 1546057. The code in AsyncPanZoomController::ScrollSnapToDestination() is not taking the fling physics into account when computing the destination.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.