Title: [211357] trunk/Source
Revision
211357
Author
carlo...@webkit.org
Date
2017-01-29 21:55:34 -0800 (Sun, 29 Jan 2017)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (211356 => 211357)


--- trunk/Source/WebCore/ChangeLog	2017-01-30 05:03:11 UTC (rev 211356)
+++ trunk/Source/WebCore/ChangeLog	2017-01-30 05:55:34 UTC (rev 211357)
@@ -1,3 +1,15 @@
+2017-01-29  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [Threaded Compositor] Crash on WebCore::GLContext::version()
+        https://bugs.webkit.org/show_bug.cgi?id=167559
+
+        Reviewed by Michael Catanzaro.
+
+        Fixes crashes in several media tests.
+
+        * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
+        (WebCore::TextureMapperPlatformLayerProxy::invalidate): Clear m_compositorThreadUpdateTimer and call the update function.
+
 2017-01-29  Nan Wang  <n_w...@apple.com>
 
         AX: WKContentView needs to implement UITextInput methods to make speak selection highlighting work

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp (211356 => 211357)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp	2017-01-30 05:03:11 UTC (rev 211356)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp	2017-01-30 05:55:34 UTC (rev 211357)
@@ -72,9 +72,20 @@
 void TextureMapperPlatformLayerProxy::invalidate()
 {
     ASSERT(m_compositorThreadID == WTF::currentThread());
-    LockHolder locker(m_lock);
-    m_compositor = nullptr;
-    m_targetLayer = nullptr;
+    Function<void()> updateFunction;
+    {
+        LockHolder locker(m_lock);
+        m_compositor = nullptr;
+        m_targetLayer = nullptr;
+
+        // Clear the timer and dispatch the update function manually now.
+        m_compositorThreadUpdateTimer = nullptr;
+        if (!m_compositorThreadUpdateFunction)
+            return;
+        updateFunction = WTFMove(m_compositorThreadUpdateFunction);
+    }
+
+    updateFunction();
 }
 
 bool TextureMapperPlatformLayerProxy::isActive()

Modified: trunk/Source/WebKit2/ChangeLog (211356 => 211357)


--- trunk/Source/WebKit2/ChangeLog	2017-01-30 05:03:11 UTC (rev 211356)
+++ trunk/Source/WebKit2/ChangeLog	2017-01-30 05:55:34 UTC (rev 211357)
@@ -1,3 +1,17 @@
+2017-01-29  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [Threaded Compositor] Crash on WebCore::GLContext::version()
+        https://bugs.webkit.org/show_bug.cgi?id=167559
+
+        Reviewed by Michael Catanzaro.
+
+        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):
+
 2017-01-29  Nan Wang  <n_w...@apple.com>
 
         AX: WKContentView needs to implement UITextInput methods to make speak selection highlighting work

Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (211356 => 211357)


--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2017-01-30 05:03:11 UTC (rev 211356)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp	2017-01-30 05:55:34 UTC (rev 211357)
@@ -676,6 +676,8 @@
     m_surfaceBackingStores.clear();
 #endif
 #if USE(COORDINATED_GRAPHICS_THREADED)
+    for (auto& proxy : m_platformLayerProxies.values())
+        proxy->invalidate();
     m_platformLayerProxies.clear();
 #endif
     m_surfaces.clear();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to