Changeset 275892 in webkit
- Timestamp:
- Apr 13, 2021, 9:55:33 AM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/page/scrolling/ScrollingTree.cpp (modified) (1 diff)
-
WebCore/page/scrolling/ThreadedScrollingTree.cpp (modified) (4 diffs)
-
WebCore/page/scrolling/ThreadedScrollingTree.h (modified) (3 diffs)
-
WebCore/platform/graphics/AnimationFrameRate.h (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/WebProcess/WebPage/EventDispatcher.cpp (modified) (2 diffs)
-
WebKit/WebProcess/WebPage/EventDispatcher.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r275891 r275892 1 2021-04-13 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, reverting r275889. 4 https://bugs.webkit.org/show_bug.cgi?id=224488 5 6 Unintentional commit 7 8 Reverted changeset: 9 10 https://trac.webkit.org/changeset/275889 11 1 12 2021-04-13 Sihui Liu <sihui_liu@apple.com> 2 13 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r275889 r275892 423 423 return; 424 424 425 LOG_WITH_STREAM(Scrolling, stream << "ScrollingTree::applyLayerPositionsInternal - main thread " << isMainThread());426 427 425 applyLayerPositionsRecursive(*m_rootNode); 428 426 } -
trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
r275889 r275892 211 211 } 212 212 213 LOG_WITH_STREAM(Scrolling, stream << "ThreadedScrollingTree::scrollingTreeNodeDidScroll " << node.scrollingNodeID() << " to " << scrollPosition << " triggering main thread rendering update"); 214 213 215 auto scrollUpdate = ScrollUpdate { node.scrollingNodeID(), scrollPosition, layoutViewportOrigin, scrollingLayerPositionAction }; 214 216 addPendingScrollUpdate(WTFMove(scrollUpdate)); 215 217 216 if (m_hasScheduledNextRenderingUpdate) {217 LOG_WITH_STREAM(Scrolling, stream << "ThreadedScrollingTree::scrollingTreeNodeDidScroll " << node.scrollingNodeID() << " to " << scrollPosition << " - rendering update already scheduled");218 return;219 }220 221 LOG_WITH_STREAM(Scrolling, stream << "ThreadedScrollingTree::scrollingTreeNodeDidScroll " << node.scrollingNodeID() << " to " << scrollPosition << " bouncing to main thread");222 223 m_hasScheduledNextRenderingUpdate = true;224 218 auto deferrer = WheelEventTestMonitorCompletionDeferrer { wheelEventTestMonitor(), reinterpret_cast<WheelEventTestMonitor::ScrollableAreaIdentifier>(node.scrollingNodeID()), WheelEventTestMonitor::ScrollingThreadSyncNeeded }; 225 219 RunLoop::main().dispatch([strongThis = makeRef(*this), deferrer = WTFMove(deferrer)] { … … 281 275 ASSERT(isMainThread()); 282 276 283 { 284 LockHolder treeLocker(m_treeMutex); 285 m_hasScheduledNextRenderingUpdate = false; 286 } 287 288 if (!hasProcessedWheelEventsRecently()) { 289 LOG_WITH_STREAM(Scrolling, stream << "ThreadedScrollingTree::willStartRenderingUpdate - no recent events"); 290 return; 291 } 277 if (!hasProcessedWheelEventsRecently()) 278 return; 292 279 293 280 tracePoint(ScrollingThreadRenderUpdateSyncStart); … … 385 372 LockHolder treeLocker(m_treeMutex); 386 373 387 LOG_WITH_STREAM(Scrolling, stream << "ThreadedScrollingTree::displayDidRefreshOnScrollingThread - hasScheduledNextRenderingUpdate " << m_hasScheduledNextRenderingUpdate);388 389 374 if (m_state != SynchronizationState::Idle && canUpdateLayersOnScrollingThread()) 390 375 applyLayerPositionsInternal(); … … 404 389 } 405 390 406 void ThreadedScrollingTree::displayDidRefresh(PlatformDisplayID displayID , ShouldSyncWithMainThread)391 void ThreadedScrollingTree::displayDidRefresh(PlatformDisplayID displayID) 407 392 { 408 393 // We're on the EventDispatcher thread or in the ThreadedCompositor thread here. -
trunk/Source/WebCore/page/scrolling/ThreadedScrollingTree.h
r275889 r275892 38 38 class AsyncScrollingCoordinator; 39 39 40 enum class ShouldSyncWithMainThread : bool {41 No,42 Yes43 };44 45 40 // The ThreadedScrollingTree class lives almost exclusively on the scrolling thread and manages the 46 41 // hierarchy of scrollable regions on the page. It's also responsible for dispatching events … … 61 56 void invalidate() override; 62 57 63 WEBCORE_EXPORT void displayDidRefresh(PlatformDisplayID , ShouldSyncWithMainThread);58 WEBCORE_EXPORT void displayDidRefresh(PlatformDisplayID); 64 59 65 60 void willStartRenderingUpdate(); … … 120 115 bool m_scrollAnimatorEnabled { false }; 121 116 bool m_hasNodesWithSynchronousScrollingReasons { false }; 122 bool m_hasScheduledNextRenderingUpdate { false };123 117 }; 124 118 -
trunk/Source/WebCore/platform/graphics/AnimationFrameRate.h
r275889 r275892 46 46 47 47 // Allow a little more than 60fps to make sure we can at least hit that frame rate. 48 constexpr const Seconds FullSpeedAnimationInterval { 31_ms };48 constexpr const Seconds FullSpeedAnimationInterval { 15_ms }; 49 49 // Allow a little more than 30fps to make sure we can at least hit that frame rate. 50 constexpr const Seconds HalfSpeedThrottlingAnimationInterval { 60_ms };50 constexpr const Seconds HalfSpeedThrottlingAnimationInterval { 30_ms }; 51 51 constexpr const Seconds AggressiveThrottlingAnimationInterval { 10_s }; 52 52 constexpr const int IntervalThrottlingFactor { 2 }; 53 53 54 constexpr const FramesPerSecond FullSpeedFramesPerSecond = 30;55 constexpr const FramesPerSecond HalfSpeedThrottlingFramesPerSecond = 15;54 constexpr const FramesPerSecond FullSpeedFramesPerSecond = 60; 55 constexpr const FramesPerSecond HalfSpeedThrottlingFramesPerSecond = 30; 56 56 57 57 WEBCORE_EXPORT FramesPerSecond framesPerSecondNearestFullSpeed(FramesPerSecond); -
trunk/Source/WebKit/ChangeLog
r275891 r275892 1 2021-04-13 Commit Queue <commit-queue@webkit.org> 2 3 Unreviewed, reverting r275889. 4 https://bugs.webkit.org/show_bug.cgi?id=224488 5 6 Unintentional commit 7 8 Reverted changeset: 9 10 https://trac.webkit.org/changeset/275889 11 1 12 2021-04-13 Sihui Liu <sihui_liu@apple.com> 2 13 -
trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.cpp
r275889 r275892 280 280 #endif 281 281 282 void EventDispatcher::notifyScrollingTreesDisplayWasRefreshed(PlatformDisplayID displayID , bool shouldSyncWithMainThread)282 void EventDispatcher::notifyScrollingTreesDisplayWasRefreshed(PlatformDisplayID displayID) 283 283 { 284 284 #if ENABLE(SCROLLING_THREAD) 285 285 LockHolder locker(m_scrollingTreesMutex); 286 286 for (auto keyValuePair : m_scrollingTrees) 287 keyValuePair.value->displayDidRefresh(displayID , shouldSyncWithMainThread ? ShouldSyncWithMainThread::Yes : ShouldSyncWithMainThread::No);287 keyValuePair.value->displayDidRefresh(displayID); 288 288 #endif 289 289 } … … 293 293 { 294 294 ASSERT(!RunLoop::isMain()); 295 notifyScrollingTreesDisplayWasRefreshed(displayID, sendToMainThread); 296 297 // FIXME: We need ensure that the last update in a sequence always has "send to main thread". 295 notifyScrollingTreesDisplayWasRefreshed(displayID); 296 298 297 if (!sendToMainThread) 299 298 return; -
trunk/Source/WebKit/WebProcess/WebPage/EventDispatcher.h
r275889 r275892 75 75 void initializeConnection(IPC::Connection*); 76 76 77 void notifyScrollingTreesDisplayWasRefreshed(WebCore::PlatformDisplayID , bool shouldSyncWithMainThread = true);77 void notifyScrollingTreesDisplayWasRefreshed(WebCore::PlatformDisplayID); 78 78 79 79 private:
Note:
See TracChangeset
for help on using the changeset viewer.