Changeset 216970 in webkit


Ignore:
Timestamp:
May 17, 2017 12:18:56 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted
https://bugs.webkit.org/show_bug.cgi?id=172167

Reviewed by Michael Catanzaro.

This is still happening, even after r216182, less often but still happens. There are two conditions in which
this can happen:

  • Again in force repaint. r216182 fixed the case of force repaint called when update state is completed, but it can also crash if update state is inProgress or PendingAfterCompletion when m_coordinateUpdateCompletionWithClient is true.
  • When the threaded compositor is invalidated right after renderLayerTree() starts, but before it finishes.
  • Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:

(WebKit::ThreadedCompositor::invalidate): Invalidate the refresh monitor right after stopping updates in the
compositing run loop to ensure no more updates are scheduled.
(WebKit::ThreadedCompositor::renderLayerTree): Check the scene is still active before calling sceneUpdateFinished().
(WebKit::ThreadedCompositor::updateSceneState): Do not update m_coordinateUpdateCompletionWithClient when in
force repaint.

  • Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:

(WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback): Return early if the monitor has been invalidated.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r216967 r216970  
     12017-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [Threaded Compositor] SHOULD NEVER BE REACHED in WebKit::CompositingRunLoop::updateCompleted
     4        https://bugs.webkit.org/show_bug.cgi?id=172167
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        This is still happening, even after r216182, less often but still happens. There are two conditions in which
     9        this can happen:
     10
     11         - Again in force repaint. r216182 fixed the case of force repaint called when update state is completed, but it
     12           can also crash if update state is inProgress or PendingAfterCompletion when m_coordinateUpdateCompletionWithClient
     13           is true.
     14         - When the threaded compositor is invalidated right after renderLayerTree() starts, but before it finishes.
     15
     16        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
     17        (WebKit::ThreadedCompositor::invalidate): Invalidate the refresh monitor right after stopping updates in the
     18        compositing run loop to ensure no more updates are scheduled.
     19        (WebKit::ThreadedCompositor::renderLayerTree): Check the scene is still active before calling sceneUpdateFinished().
     20        (WebKit::ThreadedCompositor::updateSceneState): Do not update m_coordinateUpdateCompletionWithClient when in
     21        force repaint.
     22        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
     23        (WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback): Return early if the monitor has been invalidated.
     24
    1252017-05-16  Sam Weinig  <sam@webkit.org>
    226
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp

    r216923 r216970  
    125125    m_scene->detach();
    126126    m_compositingRunLoop->stopUpdates();
     127#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
     128    m_displayRefreshMonitor->invalidate();
     129#endif
    127130    m_compositingRunLoop->performTaskSync([this, protectedThis = makeRef(*this)] {
    128131        m_scene->purgeGLResources();
     
    133136        m_scene = nullptr;
    134137    });
    135 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    136     m_displayRefreshMonitor->invalidate();
    137 #endif
    138138    m_compositingRunLoop = nullptr;
    139 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
    140     m_displayRefreshMonitor->invalidate();
    141 #endif
    142139}
    143140
     
    266263
    267264#if PLATFORM(GTK)
    268     sceneUpdateFinished();
     265    if (m_scene->isActive())
     266        sceneUpdateFinished();
    269267#endif
    270268}
     
    290288
    291289        m_clientRendersNextFrame.store(true);
     290        // Do not change m_coordinateUpdateCompletionWithClient while in force repaint.
     291        if (m_inForceRepaint)
     292            return;
    292293        bool coordinateUpdate = std::any_of(state.layersToUpdate.begin(), state.layersToUpdate.end(),
    293294            [](const std::pair<CoordinatedLayerID, CoordinatedGraphicsLayerState>& it) {
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp

    r216927 r216970  
    6868void ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback()
    6969{
     70    if (!m_compositor)
     71        return;
    7072    m_displayRefreshTimer.startOneShot(0);
    7173}
Note: See TracChangeset for help on using the changeset viewer.