Closed Bug 1335958 Opened 4 years ago Closed 4 years ago
Simplify APZ overscroll physics
APZ currently supports an oscillation spring-based overscroll effect. This was used by B2G, and now that we no longer support B2G, we don't need it anymore. However, we will want an overscroll effect for macOS (tracked by bug 1124108). So rather than removing APZ's overscroll animation, I propose that we just modify its physics to be what we want for macOS. Markus' WIP patch in bug 1124108 already does this, but I'd like to land the parts that concern the overscroll physics now, because it will make the refactoring we're planning to do in bug 1282245 easier. I will do so in this bug.
One thing this patch does not do is add prefs for the various constants used by the new physics. I'll leave it to Markus to decide which constants it makes sense to add prefs for, in bug 1124108.
Comment on attachment 8832701 [details] Bug 1335958 - Simplify APZ overscroll physics. https://reviewboard.mozilla.org/r/108888/#review110306 Looks fairly straightforward. Nice to see lots of code deletion :) ::: gfx/layers/apz/src/Axis.h:285 (Diff revision 1) > + // The mass-spring-damper model for overscroll physics. > + AxisPhysicsMSDModel mMSDModel; > + nit: move this up so it's next to mOverscroll (i.e. group overscroll-related fields together) ::: gfx/layers/apz/src/Axis.cpp:259 (Diff revision 1) > - mLastOverscrollPeak == 0 && > - mOverscrollScale == 1); > - > SetVelocity(aVelocity); > + mMSDModel.SetPosition(mOverscroll); > + mMSDModel.SetVelocity(mVelocity * 1000.0); Presumably this 1000 is a units conversion, can you add a comment that specifies what units we're converting from/to?
Attachment #8832701 - Flags: review?(bugmail) → review+
4 years ago
Priority: -- → P3
Addressed review comments.
You need to log in before you can comment on or make changes to this bug.