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

Changeset 286810 in webkit


Ignore:
Timestamp:
Dec 9, 2021, 3:19:32 PM (5 years ago)
Author:
Alan Coon
Message:

Cherry-pick r286805. rdar://problem/86291413

Momentum Generator: Scroll tail hiccup only when scrolling up on 60Hz displays
https://bugs.webkit.org/show_bug.cgi?id=234104
<rdar://problem/86291413>

Reviewed by Simon Fraser.

  • WebProcess/WebPage/MomentumEventDispatcher.cpp: (WebKit::MomentumEventDispatcher::equalizeTailGaps): Sort in the correct direction based on the sign of the first delta...

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

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

Legend:

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

    r286735 r286810  
     12021-12-09  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r286805. rdar://problem/86291413
     4
     5    Momentum Generator: Scroll tail hiccup only when scrolling up on 60Hz displays
     6    https://bugs.webkit.org/show_bug.cgi?id=234104
     7    <rdar://problem/86291413>
     8   
     9    Reviewed by Simon Fraser.
     10   
     11    * WebProcess/WebPage/MomentumEventDispatcher.cpp:
     12    (WebKit::MomentumEventDispatcher::equalizeTailGaps):
     13    Sort in the correct direction based on the sign of the first delta...
     14   
     15   
     16    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     17
     18    2021-12-09  Tim Horton  <timothy_horton@apple.com>
     19
     20            Momentum Generator: Scroll tail hiccup only when scrolling up on 60Hz displays
     21            https://bugs.webkit.org/show_bug.cgi?id=234104
     22            <rdar://problem/86291413>
     23
     24            Reviewed by Simon Fraser.
     25
     26            * WebProcess/WebPage/MomentumEventDispatcher.cpp:
     27            (WebKit::MomentumEventDispatcher::equalizeTailGaps):
     28            Sort in the correct direction based on the sign of the first delta...
     29
    1302021-12-08  Alan Coon  <alancoon@apple.com>
    231
  • branches/safari-612.4.2.1-branch/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp

    r286734 r286810  
    415415    auto& table = m_currentGesture.tailDeltaTable;
    416416    size_t initialTableSize = table.size();
     417    if (!initialTableSize)
     418        return;
    417419
    418420    enum Axis { Horizontal, Vertical };
     
    430432            firstZeroIndex[Vertical] = i;
    431433    }
    432    
    433     if (auto index = firstZeroIndex[Horizontal])
    434         std::sort(deltas[Horizontal].begin(), std::next(deltas[Horizontal].begin(), index));
    435     if (auto index = firstZeroIndex[Vertical])
    436         std::sort(deltas[Vertical].begin(), std::next(deltas[Vertical].begin(), index));
     434
     435    auto sortDeltas = [&] (Axis axis) {
     436        if (!firstZeroIndex[axis])
     437            return;
     438
     439        if (deltas[axis][0] > 0)
     440            std::sort(deltas[axis].begin(), std::next(deltas[axis].begin(), firstZeroIndex[axis]), std::greater<float>());
     441        else
     442            std::sort(deltas[axis].begin(), std::next(deltas[axis].begin(), firstZeroIndex[axis]), std::less<float>());
     443    };
     444
     445    sortDeltas(Horizontal);
     446    sortDeltas(Vertical);
    437447
    438448    // GapSize is a count of contiguous frames with zero deltas.
Note: See TracChangeset for help on using the changeset viewer.