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

Changeset 286718 in webkit


Ignore:
Timestamp:
Dec 8, 2021, 1:25:41 PM (5 years ago)
Author:
Alan Coon
Message:

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

Custom application of r286352 to introduce frameDuration() for a future patch.

Pass the timestamp for scrolling thread animations through all the serviceScrollAnimation() calls
https://bugs.webkit.org/show_bug.cgi?id=233678

Reviewed by Tim Horton.

Source/WebCore:

All scroll animations serviced at the same time should use a common timestamp, and
avoid multiple calls to MonotonicTime::now() by passing the time down through from
ThreadedScrollingTree::displayDidRefreshOnScrollingThread().

Also minor refactoring in ThreadedScrollingTree to prepare for a future patch.

  • page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::nominalFramesPerSecond):
  • page/scrolling/ScrollingTreeScrollingNode.h:
  • page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
  • page/scrolling/ThreadedScrollingTree.cpp: (WebCore::ThreadedScrollingTree::frameDuration): (WebCore::ThreadedScrollingTree::maxAllowableRenderingUpdateDurationForSynchronization): (WebCore::ThreadedScrollingTree::serviceScrollAnimations): (WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
  • page/scrolling/ThreadedScrollingTree.h:
  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm: (WebCore::ScrollingTreeFrameScrollingNodeMac::serviceScrollAnimation):
  • page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
  • page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: (WebCore::ScrollingTreeOverflowScrollingNodeMac::serviceScrollAnimation):
  • page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
  • page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: (WebCore::ScrollingTreeScrollingNodeDelegateMac::serviceScrollAnimation):
  • page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeFrameScrollingNodeNicosia::serviceScrollAnimation):
  • page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:
  • page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp: (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::serviceScrollAnimation):
  • page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h:
  • page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp: (WebCore::ScrollingTreeScrollingNodeDelegateNicosia::serviceScrollAnimation):
  • page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.h:

Source/WebKit:

  • UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:

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

Location:
branches/safari-612.4.2.1-branch/Source/WebCore
Files:
4 edited

Legend:

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

    r286716 r286718  
     12021-12-01  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r286352. rdar://problem/85928816
     4
     5    Custom application of r286352 to introduce frameDuration() for a future patch.
     6   
     7    Pass the timestamp for scrolling thread animations through all the serviceScrollAnimation() calls
     8    https://bugs.webkit.org/show_bug.cgi?id=233678
     9   
     10    Reviewed by Tim Horton.
     11   
     12    Source/WebCore:
     13   
     14    All scroll animations serviced at the same time should use a common timestamp, and
     15    avoid multiple calls to MonotonicTime::now() by passing the time down through from
     16    ThreadedScrollingTree::displayDidRefreshOnScrollingThread().
     17   
     18    Also minor refactoring in ThreadedScrollingTree to prepare for a future patch.
     19   
     20    * page/scrolling/ScrollingTree.cpp:
     21    (WebCore::ScrollingTree::nominalFramesPerSecond):
     22    * page/scrolling/ScrollingTreeScrollingNode.h:
     23    * page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
     24    * page/scrolling/ThreadedScrollingTree.cpp:
     25    (WebCore::ThreadedScrollingTree::frameDuration):
     26    (WebCore::ThreadedScrollingTree::maxAllowableRenderingUpdateDurationForSynchronization):
     27    (WebCore::ThreadedScrollingTree::serviceScrollAnimations):
     28    (WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
     29    * page/scrolling/ThreadedScrollingTree.h:
     30    * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
     31    * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
     32    (WebCore::ScrollingTreeFrameScrollingNodeMac::serviceScrollAnimation):
     33    * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
     34    * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
     35    (WebCore::ScrollingTreeOverflowScrollingNodeMac::serviceScrollAnimation):
     36    * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
     37    * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
     38    (WebCore::ScrollingTreeScrollingNodeDelegateMac::serviceScrollAnimation):
     39    * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp:
     40    (WebCore::ScrollingTreeFrameScrollingNodeNicosia::serviceScrollAnimation):
     41    * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h:
     42    * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.cpp:
     43    (WebCore::ScrollingTreeOverflowScrollingNodeNicosia::serviceScrollAnimation):
     44    * page/scrolling/nicosia/ScrollingTreeOverflowScrollingNodeNicosia.h:
     45    * page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.cpp:
     46    (WebCore::ScrollingTreeScrollingNodeDelegateNicosia::serviceScrollAnimation):
     47    * page/scrolling/nicosia/ScrollingTreeScrollingNodeDelegateNicosia.h:
     48   
     49    Source/WebKit:
     50   
     51    * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
     52   
     53    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@286352 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     54
     55    2021-11-30  Simon Fraser  <simon.fraser@apple.com>
     56
     57            Custom application of r286352 to prepare for a future patch.
     58
     59            Pass the timestamp for scrolling thread animations through all the serviceScrollAnimation() calls
     60            https://bugs.webkit.org/show_bug.cgi?id=233678
     61
     62            Reviewed by Tim Horton.
     63
     64            All scroll animations serviced at the same time should use a common timestamp, and
     65            avoid multiple calls to MonotonicTime::now() by passing the time down through from
     66            ThreadedScrollingTree::displayDidRefreshOnScrollingThread().
     67
     68            Also minor refactoring in ThreadedScrollingTree to prepare for a future patch.
     69
     70            (WebCore::ThreadedScrollingTree::frameDuration):
     71            (WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
     72            * page/scrolling/ThreadedScrollingTree.h:
     73
    1742021-12-01  Alan Coon  <alancoon@apple.com>
    275
  • branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ScrollingTree.cpp

    r278253 r286718  
    701701}
    702702
    703 std::optional<unsigned> ScrollingTree::nominalFramesPerSecond()
     703std::optional<FramesPerSecond> ScrollingTree::nominalFramesPerSecond()
    704704{
    705705    Locker locker { m_treeStateLock };
  • branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp

    r278923 r286718  
    2929#if ENABLE(ASYNC_SCROLLING) && ENABLE(SCROLLING_THREAD)
    3030
     31#include "AnimationFrameRate.h"
    3132#include "AsyncScrollingCoordinator.h"
    3233#include "Logging.h"
     
    297298}
    298299
     300Seconds ThreadedScrollingTree::frameDuration()
     301{
     302    auto displayFPS = nominalFramesPerSecond().value_or(FullSpeedFramesPerSecond);
     303    return 1_s / (double)displayFPS;
     304}
     305
    299306Seconds ThreadedScrollingTree::maxAllowableRenderingUpdateDurationForSynchronization()
    300307{
    301308    constexpr double allowableFrameFraction = 0.5;
    302     auto displayFPS = nominalFramesPerSecond().value_or(60);
    303     Seconds frameDuration = 1_s / (double)displayFPS;
    304     return allowableFrameFraction * frameDuration;
     309    return allowableFrameFraction * frameDuration();
    305310}
    306311
  • branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ThreadedScrollingTree.h

    r278923 r286718  
    9595    void delayedRenderingUpdateDetectionTimerFired();
    9696
     97    Seconds frameDuration();
    9798    Seconds maxAllowableRenderingUpdateDurationForSynchronization();
    9899
Note: See TracChangeset for help on using the changeset viewer.