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

Changeset 286805 in webkit


Ignore:
Timestamp:
Dec 9, 2021, 3:01:05 PM (5 years ago)
Author:
timothy_horton@apple.com
Message:

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...

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r286800 r286805  
     12021-12-09  Tim Horton  <timothy_horton@apple.com>
     2
     3        Momentum Generator: Scroll tail hiccup only when scrolling up on 60Hz displays
     4        https://bugs.webkit.org/show_bug.cgi?id=234104
     5        <rdar://problem/86291413>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * WebProcess/WebPage/MomentumEventDispatcher.cpp:
     10        (WebKit::MomentumEventDispatcher::equalizeTailGaps):
     11        Sort in the correct direction based on the sign of the first delta...
     12
    1132021-12-09  Chris Dumez  <cdumez@apple.com>
    214
  • trunk/Source/WebKit/WebProcess/WebPage/MomentumEventDispatcher.cpp

    r286671 r286805  
    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.