Changeset 258541 in webkit


Ignore:
Timestamp:
Mar 16, 2020 10:27:00 PM (4 years ago)
Author:
Simon Fraser
Message:

Remove the zero-delay ScrollingCoordinatorMac commit timer
https://bugs.webkit.org/show_bug.cgi?id=209164

Reviewed by Zalan Bujtas.

Source/WebCore:

The scrolling tree on macOS should just commit at rendering update time. There's no need
for a separate zero-delay timer.

Tested by existing tests.

  • page/scrolling/mac/ScrollingCoordinatorMac.h:
  • page/scrolling/mac/ScrollingCoordinatorMac.mm:

(WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac):
(WebCore::ScrollingCoordinatorMac::pageDestroyed):
(WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
(WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
(WebCore::ScrollingCoordinatorMac::commitTreeState): Deleted.

LayoutTests:

Dumping layers just made this test flakey. It's enough to test for scroll events on the overflow.

  • tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-expected.txt:
  • tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r258537 r258541  
     12020-03-16  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Remove the zero-delay ScrollingCoordinatorMac commit timer
     4        https://bugs.webkit.org/show_bug.cgi?id=209164
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Dumping layers just made this test flakey. It's enough to test for scroll events on the overflow.
     9
     10        * tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-expected.txt:
     11        * tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html:
     12
    1132020-03-16  Lauro Moura  <lmoura@igalia.com>
    214
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-expected.txt

    r211662 r258541  
    5454TEST COMPLETE
    5555PASS Scrollable div did not receive wheel events.
    56 (GraphicsLayer
    57   (anchor 0.00 0.00)
    58   (bounds 2008.00 2266.00)
    59   (visible rect 0.00, 70.00 785.00 x 585.00)
    60   (coverage rect 0.00, 70.00 785.00 x 585.00)
    61   (intersects coverage rect 1)
    62   (contentsScale 1.00)
    63   (children 1
    64     (GraphicsLayer
    65       (bounds 2008.00 2266.00)
    66       (contentsOpaque 1)
    67       (visible rect 0.00, 70.00 785.00 x 585.00)
    68       (coverage rect 0.00, 0.00 1570.00 x 1755.00)
    69       (intersects coverage rect 1)
    70       (contentsScale 1.00)
    71       (tile cache coverage 0, 0 2008 x 2048)
    72       (tile size 512 x 512)
    73       (top left tile 0, 0 tiles grid 4 x 4)
    74       (in window 1)
    75     )
    76   )
    77 )
    7856
  • trunk/LayoutTests/tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html

    r252205 r258541  
    6363    else
    6464        testPassed("Scrollable div did not receive wheel events.");
    65 
    66     if (window.internals) {
    67         document.getElementById('layers').innerText = internals.layerTreeAsText(document,
    68             internals.LAYER_TREE_INCLUDES_VISIBLE_RECTS | internals.LAYER_TREE_INCLUDES_TILE_CACHES);
    69     }
    7065
    7166    testRunner.notifyDone();
     
    176171description("Tests that a scrollable div doesn't consume wheel events when scroll is latched to main frame.");
    177172</script>
    178 <pre id="layers">Layer tree goes here</p>
    179173<script src="../../resources/js-test-post.js"></script>
    180174</body>
  • trunk/Source/WebCore/ChangeLog

    r258539 r258541  
     12020-03-16  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Remove the zero-delay ScrollingCoordinatorMac commit timer
     4        https://bugs.webkit.org/show_bug.cgi?id=209164
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        The scrolling tree on macOS should just commit at rendering update time. There's no need
     9        for a separate zero-delay timer.
     10
     11        Tested by existing tests.
     12
     13        * page/scrolling/mac/ScrollingCoordinatorMac.h:
     14        * page/scrolling/mac/ScrollingCoordinatorMac.mm:
     15        (WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac):
     16        (WebCore::ScrollingCoordinatorMac::pageDestroyed):
     17        (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
     18        (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
     19        (WebCore::ScrollingCoordinatorMac::commitTreeState): Deleted.
     20
    1212020-03-16  Simon Fraser  <simon.fraser@apple.com>
    222
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h

    r257578 r258541  
    3939    void pageDestroyed() override;
    4040
    41     void commitTreeStateIfNeeded() override;
     41    void commitTreeStateIfNeeded() final;
    4242
    4343    // Handle the wheel event on the scrolling thread. Returns whether the event was handled or not.
     
    4545
    4646private:
    47     void scheduleTreeStateCommit() override;
     47    void scheduleTreeStateCommit() final;
    4848
    49     void commitTreeState();
    50    
    5149    void updateTiledScrollingIndicator();
    52 
    53     Timer m_scrollingStateTreeCommitterTimer;
    5450};
    5551
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm

    r257578 r258541  
    5454ScrollingCoordinatorMac::ScrollingCoordinatorMac(Page* page)
    5555    : AsyncScrollingCoordinator(page)
    56     , m_scrollingStateTreeCommitterTimer(*this, &ScrollingCoordinatorMac::commitTreeState)
    5756{
    5857    setScrollingTree(ScrollingTreeMac::create(*this));
     
    6867    AsyncScrollingCoordinator::pageDestroyed();
    6968
    70     m_scrollingStateTreeCommitterTimer.stop();
    71 
    7269    // Invalidating the scrolling tree will break the reference cycle between the ScrollingCoordinator and ScrollingTree objects.
    7370    RefPtr<ThreadedScrollingTree> scrollingTree = static_pointer_cast<ThreadedScrollingTree>(releaseScrollingTree());
     
    7572        scrollingTree->invalidate();
    7673    });
    77 }
    78 
    79 void ScrollingCoordinatorMac::commitTreeStateIfNeeded()
    80 {
    81     commitTreeState();
    82     m_scrollingStateTreeCommitterTimer.stop();
    8374}
    8475
     
    10091void ScrollingCoordinatorMac::scheduleTreeStateCommit()
    10192{
    102     ASSERT(scrollingStateTree()->hasChangedProperties() || eventTrackingRegionsDirty());
    103 
    104     if (m_scrollingStateTreeCommitterTimer.isActive())
    105         return;
    106 
    107     LOG(Scrolling, "ScrollingCoordinatorMac::scheduleTreeStateCommit");
    108     m_scrollingStateTreeCommitterTimer.startOneShot(0_s);
     93    m_page->scheduleRenderingUpdate();
    10994}
    11095
    111 void ScrollingCoordinatorMac::commitTreeState()
     96void ScrollingCoordinatorMac::commitTreeStateIfNeeded()
    11297{
    11398    willCommitTree();
Note: See TracChangeset for help on using the changeset viewer.