Title: [289729] trunk/Source/WebCore
Revision
289729
Author
[email protected]
Date
2022-02-14 03:29:16 -0800 (Mon, 14 Feb 2022)

Log Message

[GTK] [WPE] Fix problem when the buffer object is released before we try to send it to the compositor
https://bugs.webkit.org/show_bug.cgi?id=236520

Patch by Alejandro G. Castro <[email protected]> on 2022-02-14
Reviewed by Žan Doberšek.

There is a layout test failing because the buffer object was
released before the swap buffers method was called and we were
calling the construction of the TextureMapperPlatformLayerDmabuf
with wrong data.

Fixes webgl/1.0.3/conformance/context/context-release-with-workers.html.

* platform/graphics/angle/GraphicsContextGLANGLE.h: Add the
isReleased function to the EGLImageBacking class.
* platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp: Ditto.
(Nicosia::GCGLANGLELayer::swapBuffersIfNeeded):
* platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
(WebCore::GraphicsContextGLANGLE::EGLImageBacking::isReleased):
Bail out when the image backing was released.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (289728 => 289729)


--- trunk/Source/WebCore/ChangeLog	2022-02-14 11:20:59 UTC (rev 289728)
+++ trunk/Source/WebCore/ChangeLog	2022-02-14 11:29:16 UTC (rev 289729)
@@ -1,3 +1,25 @@
+2022-02-14  Alejandro G. Castro  <[email protected]>
+
+        [GTK] [WPE] Fix problem when the buffer object is released before we try to send it to the compositor
+        https://bugs.webkit.org/show_bug.cgi?id=236520
+
+        Reviewed by Žan Doberšek.
+
+        There is a layout test failing because the buffer object was
+        released before the swap buffers method was called and we were
+        calling the construction of the TextureMapperPlatformLayerDmabuf
+        with wrong data.
+
+        Fixes webgl/1.0.3/conformance/context/context-release-with-workers.html.
+
+        * platform/graphics/angle/GraphicsContextGLANGLE.h: Add the
+        isReleased function to the EGLImageBacking class.
+        * platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp: Ditto.
+        (Nicosia::GCGLANGLELayer::swapBuffersIfNeeded):
+        * platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp:
+        (WebCore::GraphicsContextGLANGLE::EGLImageBacking::isReleased):
+        Bail out when the image backing was released.
+
 2022-02-14  Carlos Garcia Campos  <[email protected]>
 
         [ATSPI] Reduce the size of dbus objects Vectors

Modified: trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h (289728 => 289729)


--- trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h	2022-02-14 11:20:59 UTC (rev 289728)
+++ trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.h	2022-02-14 11:29:16 UTC (rev 289729)
@@ -469,6 +469,8 @@
 
         uint32_t format() const;
         uint32_t stride() const;
+
+        bool isReleased();
     private:
         void releaseResources();
 

Modified: trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp (289728 => 289729)


--- trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp	2022-02-14 11:20:59 UTC (rev 289728)
+++ trunk/Source/WebCore/platform/graphics/nicosia/texmap/NicosiaGCGLANGLELayer.cpp	2022-02-14 11:29:16 UTC (rev 289729)
@@ -53,6 +53,9 @@
     auto size = m_context.getInternalFramebufferSize();
 
     if (m_context.m_compositorTextureBacking) {
+        if (m_context.m_compositorTextureBacking->isReleased())
+            return;
+
         auto format = m_context.m_compositorTextureBacking->format();
         auto stride = m_context.m_compositorTextureBacking->stride();
         auto fd = m_context.m_compositorTextureBacking->fd();

Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp (289728 => 289729)


--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp	2022-02-14 11:20:59 UTC (rev 289728)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsContextGLTextureMapperANGLE.cpp	2022-02-14 11:29:16 UTC (rev 289729)
@@ -164,6 +164,11 @@
     }
 }
 
+bool GraphicsContextGLANGLE::EGLImageBacking::isReleased()
+{
+    return !m_BO;
+}
+
 bool GraphicsContextGLANGLE::EGLImageBacking::reset(int width, int height, bool hasAlpha)
 {
     releaseResources();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to