Title: [291351] releases/WebKitGTK/webkit-2.36/Source/WebKit
Revision
291351
Author
carlo...@webkit.org
Date
2022-03-16 08:17:52 -0700 (Wed, 16 Mar 2022)

Log Message

Merge r291335 - [GTK][WPE] Crash during the WebPage::close() related to GL resources destruction
https://bugs.webkit.org/show_bug.cgi?id=237588

Reviewed by Carlos Garcia Campos.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::invalidate):
(WebKit::ThreadedCompositor::updateSceneWithoutRendering):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.36/Source/WebKit/ChangeLog (291350 => 291351)


--- releases/WebKitGTK/webkit-2.36/Source/WebKit/ChangeLog	2022-03-16 15:10:41 UTC (rev 291350)
+++ releases/WebKitGTK/webkit-2.36/Source/WebKit/ChangeLog	2022-03-16 15:17:52 UTC (rev 291351)
@@ -1,3 +1,16 @@
+2022-03-16  Pablo Saavedra  <psaave...@igalia.com>
+
+        [GTK][WPE] Crash during the WebPage::close() related to GL resources destruction
+        https://bugs.webkit.org/show_bug.cgi?id=237588
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
+        (WebKit::ThreadedCompositor::invalidate):
+        (WebKit::ThreadedCompositor::updateSceneWithoutRendering):
+        * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
+
 2022-03-07  Adrian Perez de Castro  <ape...@igalia.com>
 
         [GTK] generate-automation-atom.py breaks reproducible builds

Modified: releases/WebKitGTK/webkit-2.36/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h (291350 => 291351)


--- releases/WebKitGTK/webkit-2.36/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h	2022-03-16 15:10:41 UTC (rev 291350)
+++ releases/WebKitGTK/webkit-2.36/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h	2022-03-16 15:17:52 UTC (rev 291351)
@@ -65,6 +65,7 @@
 
     void applyStateChanges(const Vector<WebCore::CoordinatedGraphicsState>&);
     void paintToCurrentGLContext(const WebCore::TransformationMatrix&, const WebCore::FloatRect&, WebCore::TextureMapper::PaintFlags = 0);
+    void updateSceneState();
     void detach();
 
     // The painting thread must lock the main thread to use below two methods, because two methods access members that the main thread manages. See m_client.
@@ -76,7 +77,6 @@
 
 private:
     void commitSceneState(const WebCore::CoordinatedGraphicsState::NicosiaState&);
-    void updateSceneState();
 
     WebCore::TextureMapperLayer* rootLayer() { return m_rootLayer.get(); }
 

Modified: releases/WebKitGTK/webkit-2.36/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp (291350 => 291351)


--- releases/WebKitGTK/webkit-2.36/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2022-03-16 15:10:41 UTC (rev 291350)
+++ releases/WebKitGTK/webkit-2.36/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp	2022-03-16 15:17:52 UTC (rev 291351)
@@ -106,6 +106,11 @@
     m_compositingRunLoop->performTaskSync([this, protectedThis = Ref { *this }] {
         if (!m_context || !m_context->makeContextCurrent())
             return;
+
+        // Update the scene at this point ensures the layers state are correctly propagated
+        // in the ThreadedCompositor and in the CompositingCoordinator.
+        updateSceneWithoutRendering();
+
         m_scene->purgeGLResources();
         m_context = nullptr;
         m_client.didDestroyGLContext();
@@ -281,6 +286,19 @@
     m_compositingRunLoop->scheduleUpdate();
 }
 
+void ThreadedCompositor::updateSceneWithoutRendering()
+{
+    Vector<WebCore::CoordinatedGraphicsState> states;
+
+    {
+        Locker locker { m_attributes.lock };
+        states = WTFMove(m_attributes.states);
+
+    }
+    m_scene->applyStateChanges(states);
+    m_scene->updateSceneState();
+}
+
 RefPtr<WebCore::DisplayRefreshMonitor> ThreadedCompositor::displayRefreshMonitor(PlatformDisplayID)
 {
     return m_displayRefreshMonitor.copyRef();

Modified: releases/WebKitGTK/webkit-2.36/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h (291350 => 291351)


--- releases/WebKitGTK/webkit-2.36/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h	2022-03-16 15:10:41 UTC (rev 291350)
+++ releases/WebKitGTK/webkit-2.36/Source/WebKit/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h	2022-03-16 15:17:52 UTC (rev 291351)
@@ -67,6 +67,7 @@
 
     void updateSceneState(const WebCore::CoordinatedGraphicsState&);
     void updateScene();
+    void updateSceneWithoutRendering();
 
     void invalidate();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to