Title: [286718] branches/safari-612.4.2.1-branch/Source/WebCore
Revision
286718
Author
alanc...@apple.com
Date
2021-12-08 13:25:41 -0800 (Wed, 08 Dec 2021)

Log 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

Modified Paths

Diff

Modified: branches/safari-612.4.2.1-branch/Source/WebCore/ChangeLog (286717 => 286718)


--- branches/safari-612.4.2.1-branch/Source/WebCore/ChangeLog	2021-12-08 21:25:37 UTC (rev 286717)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/ChangeLog	2021-12-08 21:25:41 UTC (rev 286718)
@@ -1,5 +1,78 @@
 2021-12-01  Alan Coon  <alanc...@apple.com>
 
+        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
+
+    2021-11-30  Simon Fraser  <simon.fra...@apple.com>
+
+            Custom application of r286352 to prepare 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.
+
+            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.
+
+            (WebCore::ThreadedScrollingTree::frameDuration):
+            (WebCore::ThreadedScrollingTree::displayDidRefreshOnScrollingThread):
+            * page/scrolling/ThreadedScrollingTree.h:
+
+2021-12-01  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r283353. rdar://problem/85928816
 
     Simplify some scrolling-related code in WebKit with use of RectEdges<bool>

Modified: branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ScrollingTree.cpp (286717 => 286718)


--- branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ScrollingTree.cpp	2021-12-08 21:25:37 UTC (rev 286717)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ScrollingTree.cpp	2021-12-08 21:25:41 UTC (rev 286718)
@@ -700,7 +700,7 @@
     m_lastWheelEventTime = MonotonicTime::now();
 }
 
-std::optional<unsigned> ScrollingTree::nominalFramesPerSecond()
+std::optional<FramesPerSecond> ScrollingTree::nominalFramesPerSecond()
 {
     Locker locker { m_treeStateLock };
     return m_treeState.nominalFramesPerSecond;

Modified: branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp (286717 => 286718)


--- branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp	2021-12-08 21:25:37 UTC (rev 286717)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp	2021-12-08 21:25:41 UTC (rev 286718)
@@ -28,6 +28,7 @@
 
 #if ENABLE(ASYNC_SCROLLING) && ENABLE(SCROLLING_THREAD)
 
+#include "AnimationFrameRate.h"
 #include "AsyncScrollingCoordinator.h"
 #include "Logging.h"
 #include "PlatformWheelEvent.h"
@@ -296,12 +297,16 @@
     m_state = SynchronizationState::InRenderingUpdate;
 }
 
+Seconds ThreadedScrollingTree::frameDuration()
+{
+    auto displayFPS = nominalFramesPerSecond().value_or(FullSpeedFramesPerSecond);
+    return 1_s / (double)displayFPS;
+}
+
 Seconds ThreadedScrollingTree::maxAllowableRenderingUpdateDurationForSynchronization()
 {
     constexpr double allowableFrameFraction = 0.5;
-    auto displayFPS = nominalFramesPerSecond().value_or(60);
-    Seconds frameDuration = 1_s / (double)displayFPS;
-    return allowableFrameFraction * frameDuration;
+    return allowableFrameFraction * frameDuration();
 }
 
 // This code allows the main thread about half a frame to complete its rendering udpate. If the main thread

Modified: branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ThreadedScrollingTree.h (286717 => 286718)


--- branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ThreadedScrollingTree.h	2021-12-08 21:25:37 UTC (rev 286717)
+++ branches/safari-612.4.2.1-branch/Source/WebCore/page/scrolling/ThreadedScrollingTree.h	2021-12-08 21:25:41 UTC (rev 286718)
@@ -94,6 +94,7 @@
     void scheduleDelayedRenderingUpdateDetectionTimer(Seconds) WTF_REQUIRES_LOCK(m_treeLock);
     void delayedRenderingUpdateDetectionTimerFired();
 
+    Seconds frameDuration();
     Seconds maxAllowableRenderingUpdateDurationForSynchronization();
 
     enum class SynchronizationState : uint8_t {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to