Changeset 286380 in webkit
- Timestamp:
- Dec 1, 2021, 1:05:22 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
WebProcess/WebPage/MomentumEventDispatcher.cpp (modified) (10 diffs)
-
WebProcess/WebPage/MomentumEventDispatcher.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r286361 r286380 1 2021-12-01 Chris Dumez <cdumez@apple.com> 2 3 Unreviewed build fixes after r286346. 4 5 * WebProcess/WebPage/MomentumEventDispatcher.cpp: 6 (WebKit::MomentumEventDispatcher::startDisplayLink): 7 (WebKit::MomentumEventDispatcher::displayWasRefreshed): 8 (WebKit::MomentumEventDispatcher::didReceiveScrollEventWithInterval): 9 (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta): 10 (WebKit::MomentumEventDispatcher::offsetAtTime): 11 (WebKit::momentumDecayRate): 12 (WebKit::MomentumEventDispatcher::computeNextDelta): 13 * WebProcess/WebPage/MomentumEventDispatcher.h: 14 1 15 2021-12-01 Youenn Fablet <youenn@apple.com> 2 16 -
trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp
r286346 r286380 31 31 #include "EventDispatcher.h" 32 32 #include "Logging.h" 33 #include "WebProcess.h" 33 34 #include "WebProcessProxyMessages.h" 34 35 #include <WebCore/DisplayRefreshMonitor.h> 36 #include <WebCore/Scrollbar.h> 35 37 36 38 namespace WebKit { … … 222 224 223 225 // FIXME: Switch down to lower-than-full-speed frame rates for the tail end of the curve. 224 WebProcess::singleton().parentProcessConnection()->send(Messages::WebProcessProxy::StartDisplayLink(m_observerID, displayID, FullSpeedFramesPerSecond), 0);226 WebProcess::singleton().parentProcessConnection()->send(Messages::WebProcessProxy::StartDisplayLink(m_observerID, displayID, WebCore::FullSpeedFramesPerSecond), 0); 225 227 RELEASE_LOG(ScrollAnimations, "MomentumEventDispatcher starting display link for display %d", displayID); 226 228 } … … 263 265 #if !USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING) 264 266 // Intentional delta rounding (but at the end!). 265 FloatSize delta = roundedIntSize(desiredOffset - m_currentGesture.currentOffset);267 WebCore::FloatSize delta = roundedIntSize(desiredOffset - m_currentGesture.currentOffset); 266 268 #else 267 FloatSize delta = desiredOffset - m_currentGesture.currentOffset;269 WebCore::FloatSize delta = desiredOffset - m_currentGesture.currentOffset; 268 270 #endif 269 271 … … 273 275 } 274 276 275 void MomentumEventDispatcher::didReceiveScrollEventWithInterval( FloatSize size, Seconds frameInterval)277 void MomentumEventDispatcher::didReceiveScrollEventWithInterval(WebCore::FloatSize size, Seconds frameInterval) 276 278 { 277 279 auto push = [](HistoricalDeltas& deltas, Delta newDelta) { … … 311 313 } 312 314 313 void MomentumEventDispatcher::buildOffsetTableWithInitialDelta( FloatSize initialUnacceleratedDelta)315 void MomentumEventDispatcher::buildOffsetTableWithInitialDelta(WebCore::FloatSize initialUnacceleratedDelta) 314 316 { 315 317 #if USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING) … … 318 320 m_currentGesture.offsetTable.clear(); 319 321 320 FloatSize accumulatedOffset;321 FloatSize unacceleratedDelta = initialUnacceleratedDelta;322 WebCore::FloatSize accumulatedOffset; 323 WebCore::FloatSize unacceleratedDelta = initialUnacceleratedDelta; 322 324 323 325 do { 324 FloatSize acceleratedDelta;326 WebCore::FloatSize acceleratedDelta; 325 327 std::tie(unacceleratedDelta, acceleratedDelta) = computeNextDelta(unacceleratedDelta); 326 328 … … 337 339 } 338 340 339 FloatSize MomentumEventDispatcher::offsetAtTime(Seconds time)341 WebCore::FloatSize MomentumEventDispatcher::offsetAtTime(Seconds time) 340 342 { 341 343 if (!m_currentGesture.offsetTable.size()) … … 353 355 } 354 356 355 static float momentumDecayRate( FloatSize delta, Seconds frameInterval)357 static float momentumDecayRate(WebCore::FloatSize delta, Seconds frameInterval) 356 358 { 357 359 constexpr float defaultDecay = 0.975f; … … 374 376 } 375 377 376 std::pair< FloatSize, FloatSize> MomentumEventDispatcher::computeNextDelta(FloatSize currentUnacceleratedDelta)377 { 378 FloatSize unacceleratedDelta = currentUnacceleratedDelta;378 std::pair<WebCore::FloatSize, WebCore::FloatSize> MomentumEventDispatcher::computeNextDelta(WebCore::FloatSize currentUnacceleratedDelta) 379 { 380 WebCore::FloatSize unacceleratedDelta = currentUnacceleratedDelta; 379 381 380 382 float decayRate = momentumDecayRate(unacceleratedDelta, idealCurveFrameRate); … … 446 448 }; 447 449 448 FloatSize acceleratedDelta(450 WebCore::FloatSize acceleratedDelta( 449 451 accelerateAxis(m_deltaHistoryX, quantizedUnacceleratedDelta.width()), 450 452 accelerateAxis(m_deltaHistoryY, quantizedUnacceleratedDelta.height()) -
trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h
r286346 r286380 32 32 #define USE_MOMENTUM_EVENT_DISPATCHER_TEMPORARY_LOGGING 1 33 33 34 #include "DisplayLinkObserverID.h" 34 35 #include "ScrollingAccelerationCurve.h" 35 36 #include "WebWheelEvent.h" … … 38 39 #include <WebCore/RectEdges.h> 39 40 #include <memory> 41 #include <wtf/Deque.h> 40 42 #include <wtf/Noncopyable.h> 41 43 … … 77 79 void dispatchSyntheticMomentumEvent(WebWheelEvent::Phase, WebCore::FloatSize delta); 78 80 79 void buildOffsetTableWithInitialDelta( FloatSize);81 void buildOffsetTableWithInitialDelta(WebCore::FloatSize); 80 82 81 FloatSize offsetAtTime(Seconds);82 std::pair< FloatSize, FloatSize> computeNextDelta(FloatSize currentUnacceleratedDelta);83 WebCore::FloatSize offsetAtTime(Seconds); 84 std::pair<WebCore::FloatSize, WebCore::FloatSize> computeNextDelta(WebCore::FloatSize currentUnacceleratedDelta); 83 85 84 void didReceiveScrollEventWithInterval( FloatSize, Seconds);86 void didReceiveScrollEventWithInterval(WebCore::FloatSize, Seconds); 85 87 void didReceiveScrollEvent(const WebWheelEvent&); 86 88 … … 98 100 WebCore::RectEdges<bool> m_lastRubberBandableEdges; 99 101 #if !RELEASE_LOG_DISABLED 100 FloatSize m_lastActivePhaseDelta;102 WebCore::FloatSize m_lastActivePhaseDelta; 101 103 #endif 102 104 … … 108 110 std::optional<WebWheelEvent> initiatingEvent; 109 111 110 FloatSize currentOffset;112 WebCore::FloatSize currentOffset; 111 113 WallTime startTime; 112 114 113 Vector< FloatSize> offsetTable;115 Vector<WebCore::FloatSize> offsetTable; 114 116 115 117 #if !RELEASE_LOG_DISABLED 116 FloatSize accumulatedEventOffset;118 WebCore::FloatSize accumulatedEventOffset; 117 119 bool didLogInitialQueueState { false }; 118 120 #endif 119 121 120 122 #if USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING) 121 FloatSize carryOffset;123 WebCore::FloatSize carryOffset; 122 124 #endif 123 125 } m_currentGesture;
Note:
See TracChangeset
for help on using the changeset viewer.