Changeset 260643 in webkit


Ignore:
Timestamp:
Apr 24, 2020 8:03:22 AM (4 years ago)
Author:
Simon Fraser
Message:

Move some post-renderingUpdate code into WebCore
https://bugs.webkit.org/show_bug.cgi?id=210952

Reviewed by Antti Koivisto.

Factor some code called by the various DrawingArea subclasses into Page::finalizeRenderingUpdate(),
with some flags to control behavior that differs between drawing areas.

ScrollingCoordinator::commitTreeStateIfNeeded() is a no-op for RemoteScrollingCoordinator so
it's fine to always call it.

Source/WebCore:

  • page/Page.cpp:

(WebCore::Page::passiveTouchEventListenerRectsForTesting):
(WebCore::Page::finalizeRenderingUpdate):

  • page/Page.h:

Source/WebKit:

  • WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:

(WebKit::RemoteLayerTreeDrawingArea::updateRendering):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::finalizeRenderingUpdate):

  • WebProcess/WebPage/WebPage.h:
  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

(WebKit::TiledCoreAnimationDrawingArea::updateRendering):

Location:
trunk/Source
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r260625 r260643  
     12020-04-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Move some post-renderingUpdate code into WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=210952
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Factor some code called by the various DrawingArea subclasses into Page::finalizeRenderingUpdate(),
     9        with some flags to control behavior that differs between drawing areas.
     10
     11        ScrollingCoordinator::commitTreeStateIfNeeded() is a no-op for RemoteScrollingCoordinator so
     12        it's fine to always call it.
     13
     14        * page/Page.cpp:
     15        (WebCore::Page::passiveTouchEventListenerRectsForTesting):
     16        (WebCore::Page::finalizeRenderingUpdate):
     17        * page/Page.h:
     18
    1192020-04-24  Adrian Perez de Castro  <aperez@igalia.com>
    220
  • trunk/Source/WebCore/page/Page.cpp

    r260616 r260643  
    517517
    518518    Vector<IntRect> rects;
    519     if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator())
     519    if (auto* scrollingCoordinator = this->scrollingCoordinator())
    520520        rects.appendVector(scrollingCoordinator->absoluteEventTrackingRegions().asynchronousDispatchRegion.rects());
    521521
     
    14191419        auto* frameView = child->view();
    14201420        ASSERT(!frameView || !frameView->needsLayout());
     1421    }
     1422#endif
     1423}
     1424
     1425void Page::finalizeRenderingUpdate(OptionSet<FinalizeRenderingUpdateFlags> flags)
     1426{
     1427    auto* view = mainFrame().view();
     1428    if (!view)
     1429        return;
     1430
     1431    if (flags.contains(FinalizeRenderingUpdateFlags::InvalidateImagesWithAsyncDecodes))
     1432        view->invalidateImagesWithAsyncDecodes();
     1433
     1434    view->flushCompositingStateIncludingSubframes();
     1435
     1436#if ENABLE(ASYNC_SCROLLING)
     1437    if (auto* scrollingCoordinator = this->scrollingCoordinator()) {
     1438        scrollingCoordinator->commitTreeStateIfNeeded();
     1439        if (flags.contains(FinalizeRenderingUpdateFlags::ApplyScrollingTreeLayerPositions))
     1440            scrollingCoordinator->applyScrollingTreeLayerPositions();
    14211441    }
    14221442#endif
  • trunk/Source/WebCore/page/Page.h

    r260616 r260643  
    165165};
    166166
     167enum class FinalizeRenderingUpdateFlags : uint8_t {
     168    ApplyScrollingTreeLayerPositions    = 1 << 0,
     169    InvalidateImagesWithAsyncDecodes    = 1 << 1,
     170};
     171
    167172class Page : public Supplementable<Page>, public CanMakeWeakPtr<Page> {
    168173    WTF_MAKE_NONCOPYABLE(Page);
     
    481486    WEBCORE_EXPORT void layoutIfNeeded();
    482487    WEBCORE_EXPORT void updateRendering();
     488   
     489    WEBCORE_EXPORT void finalizeRenderingUpdate(OptionSet<FinalizeRenderingUpdateFlags>);
    483490   
    484491    WEBCORE_EXPORT void scheduleRenderingUpdate();
  • trunk/Source/WebKit/ChangeLog

    r260642 r260643  
     12020-04-24  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Move some post-renderingUpdate code into WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=210952
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Factor some code called by the various DrawingArea subclasses into Page::finalizeRenderingUpdate(),
     9        with some flags to control behavior that differs between drawing areas.
     10
     11        ScrollingCoordinator::commitTreeStateIfNeeded() is a no-op for RemoteScrollingCoordinator so
     12        it's fine to always call it.
     13
     14        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
     15        (WebKit::RemoteLayerTreeDrawingArea::updateRendering):
     16        * WebProcess/WebPage/WebPage.cpp:
     17        (WebKit::WebPage::finalizeRenderingUpdate):
     18        * WebProcess/WebPage/WebPage.h:
     19        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     20        (WebKit::TiledCoreAnimationDrawingArea::updateRendering):
     21
    1222020-04-24  Chris Dumez  <cdumez@apple.com>
    223
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm

    r257394 r260643  
    339339    addCommitHandlers();
    340340
     341    OptionSet<FinalizeRenderingUpdateFlags> flags;
    341342    if (m_nextRenderingUpdateRequiresSynchronousImageDecoding)
    342         m_webPage.mainFrameView()->invalidateImagesWithAsyncDecodes();
    343 
    344     m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes();
     343        flags.add(FinalizeRenderingUpdateFlags::InvalidateImagesWithAsyncDecodes);
     344
     345    m_webPage.finalizeRenderingUpdate(flags);
    345346
    346347    // Because our view-relative overlay root layer is not attached to the FrameView's GraphicsLayer tree, we need to flush it manually.
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp

    r260407 r260643  
    38133813}
    38143814
     3815void WebPage::finalizeRenderingUpdate(OptionSet<FinalizeRenderingUpdateFlags> flags)
     3816{
     3817    m_page->finalizeRenderingUpdate(flags);
     3818}
     3819
    38153820WebInspector* WebPage::inspector(LazyCreationPolicy behavior)
    38163821{
  • trunk/Source/WebKit/WebProcess/WebPage/WebPage.h

    r260407 r260643  
    352352    void layoutIfNeeded();
    353353    void updateRendering();
     354    void finalizeRenderingUpdate(OptionSet<WebCore::FinalizeRenderingUpdateFlags>);
    354355
    355356    enum class LazyCreationPolicy { UseExistingOnly, CreateIfNeeded };
  • trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r260158 r260643  
    476476
    477477        addCommitHandlers();
    478        
    479         bool didFlushAllFrames = m_webPage.mainFrameView()->flushCompositingStateIncludingSubframes();
    480 
    481 #if ENABLE(ASYNC_SCROLLING)
    482         if (auto* scrollingCoordinator = m_webPage.corePage()->scrollingCoordinator()) {
    483             scrollingCoordinator->commitTreeStateIfNeeded();
    484             if (flushType == UpdateRenderingType::Normal)
    485                 scrollingCoordinator->applyScrollingTreeLayerPositions();
    486         }
    487 #endif
     478
     479        OptionSet<FinalizeRenderingUpdateFlags> flags;
     480        if (flushType == UpdateRenderingType::Normal)
     481            flags.add(FinalizeRenderingUpdateFlags::ApplyScrollingTreeLayerPositions);
     482
     483        m_webPage.finalizeRenderingUpdate(flags);
    488484
    489485        // If we have an active transient zoom, we want the zoom to win over any changes
     
    497493        }
    498494
    499         if (didFlushAllFrames) {
    500             sendDidFirstLayerFlushIfNeeded();
    501             invalidateRenderingUpdateRunLoopObserver();
    502         }
     495        sendDidFirstLayerFlushIfNeeded();
     496        invalidateRenderingUpdateRunLoopObserver();
    503497    }
    504498}
Note: See TracChangeset for help on using the changeset viewer.