Title: [286689] branches/safari-612-branch/Source/WebKit
Revision
286689
Author
alanc...@apple.com
Date
2021-12-08 12:23:25 -0800 (Wed, 08 Dec 2021)

Log Message

Cherry-pick r286380. rdar://problem/85928816

    Unreviewed build fixes after r286346.

    * WebProcess/WebPage/MomentumEventDispatcher.cpp:
    (WebKit::MomentumEventDispatcher::startDisplayLink):
    (WebKit::MomentumEventDispatcher::displayWasRefreshed):
    (WebKit::MomentumEventDispatcher::didReceiveScrollEventWithInterval):
    (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta):
    (WebKit::MomentumEventDispatcher::offsetAtTime):
    (WebKit::momentumDecayRate):
    (WebKit::MomentumEventDispatcher::computeNextDelta):
    * WebProcess/WebPage/MomentumEventDispatcher.h:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286380 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-612-branch/Source/WebKit/ChangeLog (286688 => 286689)


--- branches/safari-612-branch/Source/WebKit/ChangeLog	2021-12-08 20:23:22 UTC (rev 286688)
+++ branches/safari-612-branch/Source/WebKit/ChangeLog	2021-12-08 20:23:25 UTC (rev 286689)
@@ -1,3 +1,35 @@
+2021-12-03  Russell Epstein  <repst...@apple.com>
+
+        Cherry-pick r286380. rdar://problem/85928816
+
+    Unreviewed build fixes after r286346.
+    
+    * WebProcess/WebPage/MomentumEventDispatcher.cpp:
+    (WebKit::MomentumEventDispatcher::startDisplayLink):
+    (WebKit::MomentumEventDispatcher::displayWasRefreshed):
+    (WebKit::MomentumEventDispatcher::didReceiveScrollEventWithInterval):
+    (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta):
+    (WebKit::MomentumEventDispatcher::offsetAtTime):
+    (WebKit::momentumDecayRate):
+    (WebKit::MomentumEventDispatcher::computeNextDelta):
+    * WebProcess/WebPage/MomentumEventDispatcher.h:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-12-01  Chris Dumez  <cdu...@apple.com>
+
+            Unreviewed build fixes after r286346.
+
+            * WebProcess/WebPage/MomentumEventDispatcher.cpp:
+            (WebKit::MomentumEventDispatcher::startDisplayLink):
+            (WebKit::MomentumEventDispatcher::displayWasRefreshed):
+            (WebKit::MomentumEventDispatcher::didReceiveScrollEventWithInterval):
+            (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta):
+            (WebKit::MomentumEventDispatcher::offsetAtTime):
+            (WebKit::momentumDecayRate):
+            (WebKit::MomentumEventDispatcher::computeNextDelta):
+            * WebProcess/WebPage/MomentumEventDispatcher.h:
+
 2021-12-01  Alan Coon  <alanc...@apple.com>
 
         Cherry-pick r286346. rdar://problem/85928816

Modified: branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp (286688 => 286689)


--- branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp	2021-12-08 20:23:22 UTC (rev 286688)
+++ branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp	2021-12-08 20:23:25 UTC (rev 286689)
@@ -30,8 +30,10 @@
 
 #include "EventDispatcher.h"
 #include "Logging.h"
+#include "WebProcess.h"
 #include "WebProcessProxyMessages.h"
 #include <WebCore/DisplayRefreshMonitor.h>
+#include <WebCore/Scrollbar.h>
 
 namespace WebKit {
 
@@ -221,7 +223,7 @@
     }
 
     // FIXME: Switch down to lower-than-full-speed frame rates for the tail end of the curve.
-    WebProcess::singleton().parentProcessConnection()->send(Messages::WebProcessProxy::StartDisplayLink(m_observerID, displayID, FullSpeedFramesPerSecond), 0);
+    WebProcess::singleton().parentProcessConnection()->send(Messages::WebProcessProxy::StartDisplayLink(m_observerID, displayID, WebCore::FullSpeedFramesPerSecond), 0);
     RELEASE_LOG(ScrollAnimations, "MomentumEventDispatcher starting display link for display %d", displayID);
 }
 
@@ -262,9 +264,9 @@
 
 #if !USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING)
     // Intentional delta rounding (but at the end!).
-    FloatSize delta = roundedIntSize(desiredOffset - m_currentGesture.currentOffset);
+    WebCore::FloatSize delta = roundedIntSize(desiredOffset - m_currentGesture.currentOffset);
 #else
-    FloatSize delta = desiredOffset - m_currentGesture.currentOffset;
+    WebCore::FloatSize delta = desiredOffset - m_currentGesture.currentOffset;
 #endif
 
     dispatchSyntheticMomentumEvent(WebWheelEvent::PhaseChanged, -delta);
@@ -272,7 +274,7 @@
     m_currentGesture.currentOffset += delta;
 }
 
-void MomentumEventDispatcher::didReceiveScrollEventWithInterval(FloatSize size, Seconds frameInterval)
+void MomentumEventDispatcher::didReceiveScrollEventWithInterval(WebCore::FloatSize size, Seconds frameInterval)
 {
     auto push = [](HistoricalDeltas& deltas, Delta newDelta) {
         bool directionChanged = deltas.size() && (deltas.first().rawPlatformDelta > 0) != (newDelta.rawPlatformDelta > 0);
@@ -310,7 +312,7 @@
     didReceiveScrollEventWithInterval(delta, frameInterval);
 }
 
-void MomentumEventDispatcher::buildOffsetTableWithInitialDelta(FloatSize initialUnacceleratedDelta)
+void MomentumEventDispatcher::buildOffsetTableWithInitialDelta(WebCore::FloatSize initialUnacceleratedDelta)
 {
 #if USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING)
     m_currentGesture.carryOffset = { };
@@ -317,11 +319,11 @@
 #endif
     m_currentGesture.offsetTable.clear();
 
-    FloatSize accumulatedOffset;
-    FloatSize unacceleratedDelta = initialUnacceleratedDelta;
+    WebCore::FloatSize accumulatedOffset;
+    WebCore::FloatSize unacceleratedDelta = initialUnacceleratedDelta;
 
     do {
-        FloatSize acceleratedDelta;
+        WebCore::FloatSize acceleratedDelta;
         std::tie(unacceleratedDelta, acceleratedDelta) = computeNextDelta(unacceleratedDelta);
 
         accumulatedOffset += acceleratedDelta;
@@ -336,7 +338,7 @@
     return a + t * (b - a);
 }
 
-FloatSize MomentumEventDispatcher::offsetAtTime(Seconds time)
+WebCore::FloatSize MomentumEventDispatcher::offsetAtTime(Seconds time)
 {
     if (!m_currentGesture.offsetTable.size())
         return { };
@@ -352,7 +354,7 @@
     };
 }
 
-static float momentumDecayRate(FloatSize delta, Seconds frameInterval)
+static float momentumDecayRate(WebCore::FloatSize delta, Seconds frameInterval)
 {
     constexpr float defaultDecay = 0.975f;
     constexpr float tailVelocity = 250.f;
@@ -373,9 +375,9 @@
     return value / 65536.0f;
 }
 
-std::pair<FloatSize, FloatSize> MomentumEventDispatcher::computeNextDelta(FloatSize currentUnacceleratedDelta)
+std::pair<WebCore::FloatSize, WebCore::FloatSize> MomentumEventDispatcher::computeNextDelta(WebCore::FloatSize currentUnacceleratedDelta)
 {
-    FloatSize unacceleratedDelta = currentUnacceleratedDelta;
+    WebCore::FloatSize unacceleratedDelta = currentUnacceleratedDelta;
 
     float decayRate = momentumDecayRate(unacceleratedDelta, idealCurveFrameRate);
     unacceleratedDelta.scale(decayRate);
@@ -445,7 +447,7 @@
         return value * multiplier;
     };
 
-    FloatSize acceleratedDelta(
+    WebCore::FloatSize acceleratedDelta(
         accelerateAxis(m_deltaHistoryX, quantizedUnacceleratedDelta.width()),
         accelerateAxis(m_deltaHistoryY, quantizedUnacceleratedDelta.height())
     );

Modified: branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h (286688 => 286689)


--- branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h	2021-12-08 20:23:22 UTC (rev 286688)
+++ branches/safari-612-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h	2021-12-08 20:23:25 UTC (rev 286689)
@@ -31,6 +31,7 @@
 #define USE_MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING 0
 #define USE_MOMENTUM_EVENT_DISPATCHER_TEMPORARY_LOGGING 1
 
+#include "DisplayLinkObserverID.h"
 #include "ScrollingAccelerationCurve.h"
 #include "WebWheelEvent.h"
 #include <WebCore/FloatSize.h>
@@ -37,6 +38,7 @@
 #include <WebCore/PageIdentifier.h>
 #include <WebCore/RectEdges.h>
 #include <memory>
+#include <wtf/Deque.h>
 #include <wtf/Noncopyable.h>
 
 namespace WebCore {
@@ -76,12 +78,12 @@
 
     void dispatchSyntheticMomentumEvent(WebWheelEvent::Phase, WebCore::FloatSize delta);
 
-    void buildOffsetTableWithInitialDelta(FloatSize);
+    void buildOffsetTableWithInitialDelta(WebCore::FloatSize);
 
-    FloatSize offsetAtTime(Seconds);
-    std::pair<FloatSize, FloatSize> computeNextDelta(FloatSize currentUnacceleratedDelta);
+    WebCore::FloatSize offsetAtTime(Seconds);
+    std::pair<WebCore::FloatSize, WebCore::FloatSize> computeNextDelta(WebCore::FloatSize currentUnacceleratedDelta);
 
-    void didReceiveScrollEventWithInterval(FloatSize, Seconds);
+    void didReceiveScrollEventWithInterval(WebCore::FloatSize, Seconds);
     void didReceiveScrollEvent(const WebWheelEvent&);
 
     struct Delta {
@@ -97,7 +99,7 @@
     std::optional<WebWheelEvent> m_lastIncomingEvent;
     WebCore::RectEdges<bool> m_lastRubberBandableEdges;
 #if !RELEASE_LOG_DISABLED
-    FloatSize m_lastActivePhaseDelta;
+    WebCore::FloatSize m_lastActivePhaseDelta;
 #endif
 
     struct {
@@ -107,18 +109,18 @@
         std::optional<ScrollingAccelerationCurve> accelerationCurve;
         std::optional<WebWheelEvent> initiatingEvent;
 
-        FloatSize currentOffset;
+        WebCore::FloatSize currentOffset;
         WallTime startTime;
 
-        Vector<FloatSize> offsetTable;
+        Vector<WebCore::FloatSize> offsetTable;
 
 #if !RELEASE_LOG_DISABLED
-        FloatSize accumulatedEventOffset;
+        WebCore::FloatSize accumulatedEventOffset;
         bool didLogInitialQueueState { false };
 #endif
 
 #if USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING)
-        FloatSize carryOffset;
+        WebCore::FloatSize carryOffset;
 #endif
     } m_currentGesture;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to