Closed
Bug 627651
Opened 15 years ago
Closed 15 years ago
Improve the smooth scroll animation
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
FIXED
mozilla5
People
(Reporter: mstange, Assigned: mstange)
References
Details
Attachments
(1 file, 2 obsolete files)
13.16 KB,
patch
|
dbaron
:
approval2.0-
|
Details | Diff | Splinter Review |
The current smooth scroll animation gets slower when the frame rate drops. That's bad. Instead, the duration of the animation should be fixed and the current position should be based on the current time.
This patch reimplements the animation using bezier splines for the timing function to get smooth acceleration and deceleration.
Faaborg, you seem to care a lot about smooth scrolling, so please make sure I don't regress anything here.
Tryserver builds are in http://stage.mozilla.org/pub/mozilla.org/firefox/tryserver-builds/mstange@themasta.com-86febfd03a83/
Attachment #505727 -
Flags: ui-review?(faaborg)
Attachment #505727 -
Flags: review?(roc)
Comment 1•15 years ago
|
||
Sorry about the delay, I'm going to try to get to this review tomorrow.
Assignee | ||
Comment 2•15 years ago
|
||
No rush, this really isn't a priority.
Comment 3•15 years ago
|
||
>the duration of the animation should be fixed and the
>current position should be based on the current time.
I feel like this was already filed and resolved, but looking into it, I think the (pretty old) bug 418684 might have been incorrectly duped to bug 418351, and you're correct that this is still an issue.
cc'ing dbaron since he was just commenting on how smooth scrolling is considerably slower on his Linux machine (want to test the tryserver builds :)
I tested on windows, but my computer was fast enough to avoid dropping any frames, and keep in time with the events coming in. Moving on to test on an incredibly slow OS X machine.
Comment 4•15 years ago
|
||
Comment on attachment 505727 [details] [diff] [review]
v1
yeah, wow. I also tested out these try server builds and the currently nightly build on a slow OS X machine with smooth scrolling enabled, and the nytimes home page. With the current nightly build I was able to get the application to scroll on its own for several seconds after receiving input, by first providing about 30 seconds of two finger scroll events. The try server builds stopped scrolling almost immediately after I took my fingers off of the track pad.
Attachment #505727 -
Flags: ui-review?(faaborg) → ui-review+
Comment on attachment 505727 [details] [diff] [review]
v1
+ return slope / (mDuration / oneSecond) * (aDestination - aStart);
I'd prefer (slope * (aDestination - aStart)) / (mDuration / oneSecond)
+ const TimeDuration oneSecond = mozilla::TimeDuration::FromSeconds(1);
drop "mozilla::"
+ mozilla::TimeStamp now = mozilla::TimeStamp::Now();
Add "using namespace mozilla;" after the #includes and drop mozilla:: here.
Attachment #505727 -
Flags: review?(roc) → review+
Assignee | ||
Comment 6•15 years ago
|
||
Attachment #505727 -
Attachment is obsolete: true
Attachment #506349 -
Flags: approval2.0?
Comment 7•15 years ago
|
||
>approval2.0?
I'm very much in favor of approval, this patch has a significant impact on perceived performance on slower machines (although only for the set of users who happen to have turned on smooth scrolling).
Comment 9•15 years ago
|
||
(In reply to comment #7)
> >approval2.0?
>
> I'm very much in favor of approval, this patch has a significant impact on
> perceived performance on slower machines (although only for the set of users
> who happen to have turned on smooth scrolling).
I thought smooth scrolling is enabled by default on Windows nowadays.
But maybe that change was reverted.
Comment 10•15 years ago
|
||
discussed but not done, details here: https://bugzilla.mozilla.org/show_bug.cgi?id=590022#c23
Comment 11•15 years ago
|
||
The previous patch bitrotted. This one takes care of it. Overall, it makes a big difference on "heavy" pages on my laptop, especially when scrolling a long GMail message thread. The only issue I've seen is that things can be a bit jerky when the framerate changes. On the other hand, it certainly makes scrolling more responsive, and responsiveness and feel is one of the most user-visible areas of performance. It would be a real shame for this to miss 4.0.
Attachment #506349 -
Attachment is obsolete: true
Attachment #510817 -
Flags: approval2.0?
Attachment #506349 -
Flags: approval2.0?
Updated•15 years ago
|
Attachment #510817 -
Attachment description: For checking (unrotted) → For checkin (unrotted)
Comment on attachment 510817 [details] [diff] [review]
For checkin (unrotted)
This looks really nice, but it should land after Firefox 4 / Gecko 2 has branched.
Attachment #510817 -
Flags: approval2.0? → approval2.0-
Assignee | ||
Comment 13•15 years ago
|
||
dbaron, is this something that could land in the birch repo?
Comment 14•15 years ago
|
||
Shouldn't this be added to the post gecko 2.0 queue?
https://bugzilla.mozilla.org/show_bug.cgi?id=610267
Updated•15 years ago
|
Comment 16•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
No longer depends on: post2.0
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.2
You need to log in
before you can comment on or make changes to this bug.
Description
•