Closed Bug 979720 Opened 6 years ago Closed 6 years ago

normalize APZ velocity cap to screen resolution

Categories

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

All
Gonk (Firefox OS)
defect

Tracking

()

RESOLVED FIXED
mozilla30

People

(Reporter: bkelly, Assigned: kats)

References

Details

(Keywords: perf, Whiteboard: [c= p=1 s=2014.03.14 u=])

Attachments

(1 file)

In bug 976035 we added a pref'able velocity limit to APZC.  This took the form of an absolute px/ms value.  This works, but is difficult to tune well for devices with different screen sizes and resolutions.  The b2g value currently works well for the buri, but is a bit slow for the nexus-4 or nexus-5.

We should convert the velocity preference to be expressed in screens/second or some other device neutral fashion.  We can then calculate the px/ms from that value.

The current limit of 6 px/ms works out to 12.5 screens/second on the buri.
You should be able to multiply APZCTreeManager::GetDPI() to convert to a screen-resolution-dependent unit. See AXIS_BREAKOUT_THRESHOLD and its use site in AsyncPanZoomController.cpp for an example.
Whiteboard: [c= p= s= u=] → [c= p=3 s= u=]
Whiteboard: [c= p=3 s= u=] → [c= p=1 s= u=]
I think we should get this into 1.4 since the current velocity cap is tuned for small screens like the buri.  The 1.4 production devices like open c have larger screens.
blocking-b2g: --- → 1.4?
Assignee: bkelly → bugmail.mozilla
Attached patch PatchSplinter Review
Hamachi has a DPI of 160, so I just divided that out to maintain the same final value on Hamachi, and scale it accordingly on other devices.
Attachment #8391432 - Flags: review?(bkelly)
Comment on attachment 8391432 [details] [diff] [review]
Patch

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

I think we want to update the pref name, but otherwise it looks good.  I'm not a peer, though, so can I officially review?

::: b2g/app/b2g.js
@@ +874,2 @@
>  // to avoid checkerboarding.  Note, float value must be set as a string.
> +pref("apz.max_velocity_pixels_per_ms", "0.0375");

s/pixels/inches/g
Attachment #8391432 - Flags: review?(bkelly) → feedback+
Comment on attachment 8391432 [details] [diff] [review]
Patch

It was explained to me that only one of [reviewer,reviewee] has to be a peer.  So r=me with the updated pref name.

Thanks!
Attachment #8391432 - Flags: feedback+ → review+
Followup to fix the pref name (doh!):

https://hg.mozilla.org/integration/mozilla-inbound/rev/b377204840b9

I also cancelled the build jobs for the previous rev since it's more useful to just get them on this follow-up.
https://hg.mozilla.org/mozilla-central/rev/2e54fe94c127
https://hg.mozilla.org/mozilla-central/rev/b377204840b9
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
blocking-b2g: 1.4? → ---
Priority: -- → P2
Whiteboard: [c= p=1 s= u=] → [c= p=1 s=2014.03.14 u=]
You need to log in before you can comment on or make changes to this bug.