Title: [150635] trunk/Source/WebCore
Revision
150635
Author
[email protected]
Date
2013-05-24 01:05:49 -0700 (Fri, 24 May 2013)

Log Message

[BlackBerry] DRT - crashed on GraphicsContext3D::makeContextCurrent
https://bugs.webkit.org/show_bug.cgi?id=116654

Patch by Xiaobo Wang <[email protected]> on 2013-05-24
Reviewed by Carlos Garcia Campos.

PR 331552.
Internally reviewed and amended by Arvid Nilsson.

No new tests, this patch is to fix DRT crashes in fast/canvas/webgl.
The instance of GraphicsContext3D has already been destroyed but
WebGLLayerWebKitThread is not aware of that. This is because compositor
layer of the WebGL graphics context was referenced outside the context.
So when destructing GraphicsContext3D the compositing layer was not
destructed.
Fix by setting m_webGLContext to 0 when destructing GrapthicsContext3D
after releasing the compositor layer, so that it won't be de-referenced
again later.

* platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp:
(WebCore::GraphicsContext3D::~GraphicsContext3D):
* platform/graphics/blackberry/WebGLLayerWebKitThread.cpp:
(WebCore::WebGLLayerWebKitThread::~WebGLLayerWebKitThread):
(WebCore::WebGLLayerWebKitThread::webGLContextDestroyed):
(WebCore):
* platform/graphics/blackberry/WebGLLayerWebKitThread.h:
(WebGLLayerWebKitThread):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (150634 => 150635)


--- trunk/Source/WebCore/ChangeLog	2013-05-24 07:32:54 UTC (rev 150634)
+++ trunk/Source/WebCore/ChangeLog	2013-05-24 08:05:49 UTC (rev 150635)
@@ -1,3 +1,32 @@
+2013-05-24  Xiaobo Wang  <[email protected]>
+
+        [BlackBerry] DRT - crashed on GraphicsContext3D::makeContextCurrent
+        https://bugs.webkit.org/show_bug.cgi?id=116654
+
+        Reviewed by Carlos Garcia Campos.
+
+        PR 331552.
+        Internally reviewed and amended by Arvid Nilsson.
+
+        No new tests, this patch is to fix DRT crashes in fast/canvas/webgl.
+        The instance of GraphicsContext3D has already been destroyed but
+        WebGLLayerWebKitThread is not aware of that. This is because compositor
+        layer of the WebGL graphics context was referenced outside the context.
+        So when destructing GraphicsContext3D the compositing layer was not
+        destructed.
+        Fix by setting m_webGLContext to 0 when destructing GrapthicsContext3D
+        after releasing the compositor layer, so that it won't be de-referenced
+        again later.
+
+        * platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp:
+        (WebCore::GraphicsContext3D::~GraphicsContext3D):
+        * platform/graphics/blackberry/WebGLLayerWebKitThread.cpp:
+        (WebCore::WebGLLayerWebKitThread::~WebGLLayerWebKitThread):
+        (WebCore::WebGLLayerWebKitThread::webGLContextDestroyed):
+        (WebCore):
+        * platform/graphics/blackberry/WebGLLayerWebKitThread.h:
+        (WebGLLayerWebKitThread):
+
 2013-05-24  Andreas Kling  <[email protected]>
 
         Typing in Safari's unified field causes unnecessary web content repaints.

Modified: trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp (150634 => 150635)


--- trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp	2013-05-24 07:32:54 UTC (rev 150634)
+++ trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp	2013-05-24 08:05:49 UTC (rev 150635)
@@ -127,7 +127,7 @@
         ::glDeleteFramebuffers(1, &m_fbo);
     }
 
-    m_compositingLayer = 0; // Must release compositing layer before destroying the context.
+    static_cast<WebGLLayerWebKitThread *>(m_compositingLayer.get())->webGLContextDestroyed(); // Must release compositing layer before destroying the context.
     BlackBerry::Platform::Graphics::destroyWebGLContext(m_context);
 }
 

Modified: trunk/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.cpp (150634 => 150635)


--- trunk/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.cpp	2013-05-24 07:32:54 UTC (rev 150634)
+++ trunk/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.cpp	2013-05-24 08:05:49 UTC (rev 150635)
@@ -34,8 +34,7 @@
 
 WebGLLayerWebKitThread::~WebGLLayerWebKitThread()
 {
-    if (m_webGLContext && m_webGLContext->makeContextCurrent())
-        deleteFrontBuffer();
+    deleteTextures();
 }
 
 void WebGLLayerWebKitThread::updateTextureContentsIfNeeded()
@@ -54,6 +53,12 @@
         deleteFrontBuffer();
 }
 
+void WebGLLayerWebKitThread::webGLContextDestroyed()
+{
+    deleteTextures();
+    m_webGLContext = 0;
+}
+
 } // namespace WebCore
 
 #endif // USE(ACCELERATED_COMPOSITING) && ENABLE(WEBGL)

Modified: trunk/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.h (150634 => 150635)


--- trunk/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.h	2013-05-24 07:32:54 UTC (rev 150634)
+++ trunk/Source/WebCore/platform/graphics/blackberry/WebGLLayerWebKitThread.h	2013-05-24 08:05:49 UTC (rev 150635)
@@ -37,6 +37,7 @@
     virtual ~WebGLLayerWebKitThread();
 
     void setWebGLContext(GraphicsContext3D* context) { m_webGLContext = context; }
+    void webGLContextDestroyed();
 
 protected:
     virtual void updateTextureContentsIfNeeded();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to