Changeset 287031 in webkit
- Timestamp:
- Dec 14, 2021, 10:30:27 AM (5 years ago)
- Location:
- branches/safari-612-branch/Source/WebKit
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
WebProcess/WebPage/MomentumEventDispatcher.cpp (modified) (3 diffs)
-
WebProcess/WebPage/MomentumEventDispatcher.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-612-branch/Source/WebKit/ChangeLog
r286991 r287031 1 2021-12-14 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r286999. rdar://problem/86425321 4 5 Momentum Event Dispatcher: Excessive "kick" at the beginning of scrolling (especially on 60fps displays) 6 https://bugs.webkit.org/show_bug.cgi?id=234279 7 <rdar://problem/86425321> 8 9 Reviewed by Simon Fraser. 10 11 * WebProcess/WebPage/MomentumEventDispatcher.cpp: 12 (WebKit::MomentumEventDispatcher::handleWheelEvent): 13 (WebKit::MomentumEventDispatcher::didStartMomentumPhase): 14 Instead of back-dating the animation to try to acquire a momentum-start 15 delta, pass the one we got from the event through, and start the animation 16 curve at momentum-start time. Also, critically, inset ourselves along 17 the curve by the amount of that initial delta (since the time starts now). 18 19 Tested at both 60fps and 120fps, this significantly smooths out the 20 transition from fingers-down phase to the generated momentum phase, 21 avoiding the overly large initial delta. 22 23 * WebProcess/WebPage/MomentumEventDispatcher.h: 24 25 26 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286999 268f45cc-cd09-0410-ab3c-d52691b4dbfc 27 28 2021-12-13 Tim Horton <timothy_horton@apple.com> 29 30 Momentum Event Dispatcher: Excessive "kick" at the beginning of scrolling (especially on 60fps displays) 31 https://bugs.webkit.org/show_bug.cgi?id=234279 32 <rdar://problem/86425321> 33 34 Reviewed by Simon Fraser. 35 36 * WebProcess/WebPage/MomentumEventDispatcher.cpp: 37 (WebKit::MomentumEventDispatcher::handleWheelEvent): 38 (WebKit::MomentumEventDispatcher::didStartMomentumPhase): 39 Instead of back-dating the animation to try to acquire a momentum-start 40 delta, pass the one we got from the event through, and start the animation 41 curve at momentum-start time. Also, critically, inset ourselves along 42 the curve by the amount of that initial delta (since the time starts now). 43 44 Tested at both 60fps and 120fps, this significantly smooths out the 45 transition from fingers-down phase to the generated momentum phase, 46 avoiding the overly large initial delta. 47 48 * WebProcess/WebPage/MomentumEventDispatcher.h: 49 1 50 2021-12-13 Alan Coon <alancoon@apple.com> 2 51 -
branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp
r286991 r287031 101 101 } 102 102 103 if (event.phase() == WebWheelEvent::PhaseEnded)104 m_lastEndedEventTimestamp = event.ioHIDEventTimestamp();105 106 103 if (eventShouldStartSyntheticMomentumPhase(pageIdentifier, event)) 107 104 didStartMomentumPhase(pageIdentifier, event); … … 191 188 tracePoint(SyntheticMomentumStart); 192 189 193 auto momentumStartInterval = event.ioHIDEventTimestamp() - m_lastEndedEventTimestamp;194 195 190 m_currentGesture.active = true; 196 191 m_currentGesture.pageIdentifier = pageIdentifier; 197 192 m_currentGesture.initiatingEvent = event; 198 193 m_currentGesture.currentOffset = { }; 199 m_currentGesture.startTime = MonotonicTime::now() - momentumStartInterval;194 m_currentGesture.startTime = MonotonicTime::now(); 200 195 m_currentGesture.displayNominalFrameRate = displayProperties->nominalFrameRate; 201 196 m_currentGesture.accelerationCurve = [&] () -> std::optional<ScrollingAccelerationCurve> { … … 214 209 buildOffsetTableWithInitialDelta(*event.rawPlatformDelta() * idealCurveMultiplier); 215 210 216 dispatchSyntheticMomentumEvent(WebWheelEvent::PhaseBegan, consumeDeltaForCurrentTime()); 211 WebCore::FloatSize consumedDelta = event.delta(); 212 if (m_currentGesture.initiatingEvent->directionInvertedFromDevice()) 213 consumedDelta.scale(-1); 214 m_currentGesture.currentOffset += consumedDelta; 215 216 dispatchSyntheticMomentumEvent(WebWheelEvent::PhaseBegan, event.delta()); 217 217 } 218 218 -
branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h
r286991 r287031 124 124 125 125 std::optional<WallTime> m_lastScrollTimestamp; 126 WallTime m_lastEndedEventTimestamp;127 126 std::optional<WebWheelEvent> m_lastIncomingEvent; 128 127 WebCore::RectEdges<bool> m_lastRubberBandableEdges;
Note:
See TracChangeset
for help on using the changeset viewer.