Changeset 211357 in webkit


Ignore:
Timestamp:
Jan 29, 2017 9:55:34 PM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[Threaded Compositor] Crash on WebCore::GLContext::version()
https://bugs.webkit.org/show_bug.cgi?id=167559

Reviewed by Michael Catanzaro.

Source/WebCore:

Fixes crashes in several media tests.

  • platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:

(WebCore::TextureMapperPlatformLayerProxy::invalidate): Clear m_compositorThreadUpdateTimer and call the update function.

Source/WebKit2:

This is happening because TextureMapperPlatformLayerProxy::compositorThreadUpdateTimerFired() is fired after the
threaded compositor is deleted. CoordinatedGraphicsScene::purgeGLResources() should invalidate the proxies
before clearing the map.

  • Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:

(WebKit::CoordinatedGraphicsScene::purgeGLResources):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r211356 r211357  
     12017-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [Threaded Compositor] Crash on WebCore::GLContext::version()
     4        https://bugs.webkit.org/show_bug.cgi?id=167559
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Fixes crashes in several media tests.
     9
     10        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
     11        (WebCore::TextureMapperPlatformLayerProxy::invalidate): Clear m_compositorThreadUpdateTimer and call the update function.
     12
    1132017-01-29  Nan Wang  <n_wang@apple.com>
    214
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp

    r210542 r211357  
    7373{
    7474    ASSERT(m_compositorThreadID == WTF::currentThread());
    75     LockHolder locker(m_lock);
    76     m_compositor = nullptr;
    77     m_targetLayer = nullptr;
     75    Function<void()> updateFunction;
     76    {
     77        LockHolder locker(m_lock);
     78        m_compositor = nullptr;
     79        m_targetLayer = nullptr;
     80
     81        // Clear the timer and dispatch the update function manually now.
     82        m_compositorThreadUpdateTimer = nullptr;
     83        if (!m_compositorThreadUpdateFunction)
     84            return;
     85        updateFunction = WTFMove(m_compositorThreadUpdateFunction);
     86    }
     87
     88    updateFunction();
    7889}
    7990
  • trunk/Source/WebKit2/ChangeLog

    r211356 r211357  
     12017-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [Threaded Compositor] Crash on WebCore::GLContext::version()
     4        https://bugs.webkit.org/show_bug.cgi?id=167559
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        This is happening because TextureMapperPlatformLayerProxy::compositorThreadUpdateTimerFired() is fired after the
     9        threaded compositor is deleted. CoordinatedGraphicsScene::purgeGLResources() should invalidate the proxies
     10        before clearing the map.
     11
     12        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
     13        (WebKit::CoordinatedGraphicsScene::purgeGLResources):
     14
    1152017-01-29  Nan Wang  <n_wang@apple.com>
    216
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp

    r211348 r211357  
    677677#endif
    678678#if USE(COORDINATED_GRAPHICS_THREADED)
     679    for (auto& proxy : m_platformLayerProxies.values())
     680        proxy->invalidate();
    679681    m_platformLayerProxies.clear();
    680682#endif
Note: See TracChangeset for help on using the changeset viewer.