Changeset 286999 in webkit
- Timestamp:
- Dec 13, 2021, 5:50:21 PM (5 years ago)
- Location:
- trunk/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
-
trunk/Source/WebKit/ChangeLog
r286993 r286999 1 2021-12-13 Tim Horton <timothy_horton@apple.com> 2 3 Momentum Event Dispatcher: Excessive "kick" at the beginning of scrolling (especially on 60fps displays) 4 https://bugs.webkit.org/show_bug.cgi?id=234279 5 <rdar://problem/86425321> 6 7 Reviewed by Simon Fraser. 8 9 * WebProcess/WebPage/MomentumEventDispatcher.cpp: 10 (WebKit::MomentumEventDispatcher::handleWheelEvent): 11 (WebKit::MomentumEventDispatcher::didStartMomentumPhase): 12 Instead of back-dating the animation to try to acquire a momentum-start 13 delta, pass the one we got from the event through, and start the animation 14 curve at momentum-start time. Also, critically, inset ourselves along 15 the curve by the amount of that initial delta (since the time starts now). 16 17 Tested at both 60fps and 120fps, this significantly smooths out the 18 transition from fingers-down phase to the generated momentum phase, 19 avoiding the overly large initial delta. 20 21 * WebProcess/WebPage/MomentumEventDispatcher.h: 22 1 23 2021-12-13 J Pascoe <j_pascoe@apple.com> 2 24 -
trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp
r286919 r286999 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 -
trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h
r286919 r286999 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.