⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286722 in webkit


Ignore:
Timestamp:
Dec 8, 2021, 1:25:52 PM (5 years ago)
Author:
Alan Coon
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

Location:
branches/safari-612.4.2.1-branch/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612.4.2.1-branch/Source/WebKit/ChangeLog

    r286717 r286722  
     12021-12-03  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r286380. rdar://problem/85928816
     4
     5    Unreviewed build fixes after r286346.
     6   
     7    * WebProcess/WebPage/MomentumEventDispatcher.cpp:
     8    (WebKit::MomentumEventDispatcher::startDisplayLink):
     9    (WebKit::MomentumEventDispatcher::displayWasRefreshed):
     10    (WebKit::MomentumEventDispatcher::didReceiveScrollEventWithInterval):
     11    (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta):
     12    (WebKit::MomentumEventDispatcher::offsetAtTime):
     13    (WebKit::momentumDecayRate):
     14    (WebKit::MomentumEventDispatcher::computeNextDelta):
     15    * WebProcess/WebPage/MomentumEventDispatcher.h:
     16   
     17    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     18
     19    2021-12-01  Chris Dumez  <cdumez@apple.com>
     20
     21            Unreviewed build fixes after r286346.
     22
     23            * WebProcess/WebPage/MomentumEventDispatcher.cpp:
     24            (WebKit::MomentumEventDispatcher::startDisplayLink):
     25            (WebKit::MomentumEventDispatcher::displayWasRefreshed):
     26            (WebKit::MomentumEventDispatcher::didReceiveScrollEventWithInterval):
     27            (WebKit::MomentumEventDispatcher::buildOffsetTableWithInitialDelta):
     28            (WebKit::MomentumEventDispatcher::offsetAtTime):
     29            (WebKit::momentumDecayRate):
     30            (WebKit::MomentumEventDispatcher::computeNextDelta):
     31            * WebProcess/WebPage/MomentumEventDispatcher.h:
     32
    1332021-12-01  Alan Coon  <alancoon@apple.com>
    234
  • branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp

    r286717 r286722  
    3131#include "EventDispatcher.h"
    3232#include "Logging.h"
     33#include "WebProcess.h"
    3334#include "WebProcessProxyMessages.h"
    3435#include <WebCore/DisplayRefreshMonitor.h>
     36#include <WebCore/Scrollbar.h>
    3537
    3638namespace WebKit {
     
    222224
    223225    // 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);
    225227    RELEASE_LOG(ScrollAnimations, "MomentumEventDispatcher starting display link for display %d", displayID);
    226228}
     
    263265#if !USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING)
    264266    // Intentional delta rounding (but at the end!).
    265     FloatSize delta = roundedIntSize(desiredOffset - m_currentGesture.currentOffset);
     267    WebCore::FloatSize delta = roundedIntSize(desiredOffset - m_currentGesture.currentOffset);
    266268#else
    267     FloatSize delta = desiredOffset - m_currentGesture.currentOffset;
     269    WebCore::FloatSize delta = desiredOffset - m_currentGesture.currentOffset;
    268270#endif
    269271
     
    273275}
    274276
    275 void MomentumEventDispatcher::didReceiveScrollEventWithInterval(FloatSize size, Seconds frameInterval)
     277void MomentumEventDispatcher::didReceiveScrollEventWithInterval(WebCore::FloatSize size, Seconds frameInterval)
    276278{
    277279    auto push = [](HistoricalDeltas& deltas, Delta newDelta) {
     
    311313}
    312314
    313 void MomentumEventDispatcher::buildOffsetTableWithInitialDelta(FloatSize initialUnacceleratedDelta)
     315void MomentumEventDispatcher::buildOffsetTableWithInitialDelta(WebCore::FloatSize initialUnacceleratedDelta)
    314316{
    315317#if USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING)
     
    318320    m_currentGesture.offsetTable.clear();
    319321
    320     FloatSize accumulatedOffset;
    321     FloatSize unacceleratedDelta = initialUnacceleratedDelta;
     322    WebCore::FloatSize accumulatedOffset;
     323    WebCore::FloatSize unacceleratedDelta = initialUnacceleratedDelta;
    322324
    323325    do {
    324         FloatSize acceleratedDelta;
     326        WebCore::FloatSize acceleratedDelta;
    325327        std::tie(unacceleratedDelta, acceleratedDelta) = computeNextDelta(unacceleratedDelta);
    326328
     
    337339}
    338340
    339 FloatSize MomentumEventDispatcher::offsetAtTime(Seconds time)
     341WebCore::FloatSize MomentumEventDispatcher::offsetAtTime(Seconds time)
    340342{
    341343    if (!m_currentGesture.offsetTable.size())
     
    353355}
    354356
    355 static float momentumDecayRate(FloatSize delta, Seconds frameInterval)
     357static float momentumDecayRate(WebCore::FloatSize delta, Seconds frameInterval)
    356358{
    357359    constexpr float defaultDecay = 0.975f;
     
    374376}
    375377
    376 std::pair<FloatSize, FloatSize> MomentumEventDispatcher::computeNextDelta(FloatSize currentUnacceleratedDelta)
    377 {
    378     FloatSize unacceleratedDelta = currentUnacceleratedDelta;
     378std::pair<WebCore::FloatSize, WebCore::FloatSize> MomentumEventDispatcher::computeNextDelta(WebCore::FloatSize currentUnacceleratedDelta)
     379{
     380    WebCore::FloatSize unacceleratedDelta = currentUnacceleratedDelta;
    379381
    380382    float decayRate = momentumDecayRate(unacceleratedDelta, idealCurveFrameRate);
     
    446448    };
    447449
    448     FloatSize acceleratedDelta(
     450    WebCore::FloatSize acceleratedDelta(
    449451        accelerateAxis(m_deltaHistoryX, quantizedUnacceleratedDelta.width()),
    450452        accelerateAxis(m_deltaHistoryY, quantizedUnacceleratedDelta.height())
  • branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.h

    r286717 r286722  
    3232#define USE_MOMENTUM_EVENT_DISPATCHER_TEMPORARY_LOGGING 1
    3333
     34#include "DisplayLinkObserverID.h"
    3435#include "ScrollingAccelerationCurve.h"
    3536#include "WebWheelEvent.h"
     
    3839#include <WebCore/RectEdges.h>
    3940#include <memory>
     41#include <wtf/Deque.h>
    4042#include <wtf/Noncopyable.h>
    4143
     
    7779    void dispatchSyntheticMomentumEvent(WebWheelEvent::Phase, WebCore::FloatSize delta);
    7880
    79     void buildOffsetTableWithInitialDelta(FloatSize);
     81    void buildOffsetTableWithInitialDelta(WebCore::FloatSize);
    8082
    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);
    8385
    84     void didReceiveScrollEventWithInterval(FloatSize, Seconds);
     86    void didReceiveScrollEventWithInterval(WebCore::FloatSize, Seconds);
    8587    void didReceiveScrollEvent(const WebWheelEvent&);
    8688
     
    98100    WebCore::RectEdges<bool> m_lastRubberBandableEdges;
    99101#if !RELEASE_LOG_DISABLED
    100     FloatSize m_lastActivePhaseDelta;
     102    WebCore::FloatSize m_lastActivePhaseDelta;
    101103#endif
    102104
     
    108110        std::optional<WebWheelEvent> initiatingEvent;
    109111
    110         FloatSize currentOffset;
     112        WebCore::FloatSize currentOffset;
    111113        WallTime startTime;
    112114
    113         Vector<FloatSize> offsetTable;
     115        Vector<WebCore::FloatSize> offsetTable;
    114116
    115117#if !RELEASE_LOG_DISABLED
    116         FloatSize accumulatedEventOffset;
     118        WebCore::FloatSize accumulatedEventOffset;
    117119        bool didLogInitialQueueState { false };
    118120#endif
    119121
    120122#if USE(MOMENTUM_EVENT_DISPATCHER_PREMATURE_ROUNDING)
    121         FloatSize carryOffset;
     123        WebCore::FloatSize carryOffset;
    122124#endif
    123125    } m_currentGesture;
Note: See TracChangeset for help on using the changeset viewer.