Title: [210154] releases/WebKitGTK/webkit-2.14/Source/WebCore

Diff

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (210153 => 210154)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2016-12-27 08:04:25 UTC (rev 210153)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog	2016-12-27 10:33:25 UTC (rev 210154)
@@ -1732,32 +1732,6 @@
         (WebCore::ScrollbarThemeGtk::paint):
         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
 
-2016-09-12  Carlos Garcia Campos  <[email protected]>
-
-        [GTK] Crash of WebProcess on the last WebView disconnect (take two)
-        https://bugs.webkit.org/show_bug.cgi?id=161842
-
-        Reviewed by Michael Catanzaro.
-
-        The problem is that when PlatformDisplayX11 is destroyed, the sharing GL context is deleted and its destructor
-        makes a downcast of PlatformDisplay to get the native X11 display. We could simply keep a pointer to the native
-        X11 display in GLContextGLX, got at construction time from the PlatformDisplay, and ensure the sharing GL
-        context is deleted before the native X11 display is closed.
-
-        * platform/graphics/PlatformDisplay.h: Make m_sharingGLContext protected.
-        * platform/graphics/glx/GLContextGLX.cpp:
-        (WebCore::GLContextGLX::GLContextGLX): Initialize m_x11Display.
-        (WebCore::GLContextGLX::~GLContextGLX): Use m_x11Display and remove confusing comment about possible crash with
-        nviedia closed drivers.
-        (WebCore::GLContextGLX::defaultFrameBufferSize): Use m_x11Display.
-        (WebCore::GLContextGLX::makeContextCurrent): Ditto.
-        (WebCore::GLContextGLX::swapBuffers): Ditto.
-        (WebCore::GLContextGLX::swapInterval): Ditto.
-        (WebCore::GLContextGLX::cairoDevice): Ditto.
-        * platform/graphics/glx/GLContextGLX.h:
-        * platform/graphics/x11/PlatformDisplayX11.cpp:
-        (WebCore::PlatformDisplayX11::~PlatformDisplayX11): Delete the sharing GL context before closing the display.
-
 2016-09-06  Carlos Garcia Campos  <[email protected]>
 
         [GTK] Crash of WebProcess on the last WebView disconnect

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/PlatformDisplay.h (210153 => 210154)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/PlatformDisplay.h	2016-12-27 08:04:25 UTC (rev 210153)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/PlatformDisplay.h	2016-12-27 10:33:25 UTC (rev 210154)
@@ -80,10 +80,6 @@
     EGLDisplay m_eglDisplay;
 #endif
 
-#if USE(EGL) || USE(GLX)
-    std::unique_ptr<GLContext> m_sharingGLContext;
-#endif
-
 private:
     static std::unique_ptr<PlatformDisplay> createPlatformDisplay();
 
@@ -94,6 +90,9 @@
     int m_eglMajorVersion { 0 };
     int m_eglMinorVersion { 0 };
 #endif
+#if USE(EGL) || USE(GLX)
+    std::unique_ptr<GLContext> m_sharingGLContext;
+#endif
 };
 
 } // namespace WebCore

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp (210153 => 210154)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp	2016-12-27 08:04:25 UTC (rev 210153)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp	2016-12-27 10:33:25 UTC (rev 210154)
@@ -179,7 +179,6 @@
 
 GLContextGLX::GLContextGLX(PlatformDisplay& display, XUniqueGLXContext&& context, GLNativeWindowType window)
     : GLContext(display)
-    , m_x11Display(downcast<PlatformDisplayX11>(m_display).native())
     , m_context(WTFMove(context))
     , m_window(static_cast<Window>(window))
 {
@@ -188,7 +187,6 @@
 
 GLContextGLX::GLContextGLX(PlatformDisplay& display, XUniqueGLXContext&& context, XUniqueGLXPbuffer&& pbuffer)
     : GLContext(display)
-    , m_x11Display(downcast<PlatformDisplayX11>(m_display).native())
     , m_context(WTFMove(context))
     , m_pbuffer(WTFMove(pbuffer))
 {
@@ -197,7 +195,6 @@
 
 GLContextGLX::GLContextGLX(PlatformDisplay& display, XUniqueGLXContext&& context, XUniquePixmap&& pixmap, XUniqueGLXPixmap&& glxPixmap)
     : GLContext(display)
-    , m_x11Display(downcast<PlatformDisplayX11>(m_display).native())
     , m_context(WTFMove(context))
     , m_pixmap(WTFMove(pixmap))
     , m_glxPixmap(WTFMove(glxPixmap))
@@ -221,8 +218,10 @@
         m_cairoDevice = nullptr;
     }
 
+    // This may be necessary to prevent crashes with NVidia's closed source drivers. Originally
+    // from Mozilla's 3D canvas implementation at: http://bitbucket.org/ilmari/canvas3d/
     glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
-    glXMakeCurrent(m_x11Display, None, None);
+    glXMakeCurrent(downcast<PlatformDisplayX11>(m_display).native(), None, None);
 
     m_context = nullptr;
 }
@@ -240,7 +239,7 @@
     int x, y;
     Window rootWindow;
     unsigned int width, height, borderWidth, depth;
-    if (!XGetGeometry(m_x11Display, m_window, &rootWindow, &x, &y, &width, &height, &borderWidth, &depth))
+    if (!XGetGeometry(downcast<PlatformDisplayX11>(m_display).native(), m_window, &rootWindow, &x, &y, &width, &height, &borderWidth, &depth))
         return IntSize();
 
     return IntSize(width, height);
@@ -254,19 +253,20 @@
     if (glXGetCurrentContext() == m_context.get())
         return true;
 
+    Display* display = downcast<PlatformDisplayX11>(m_display).native();
     if (m_window)
-        return glXMakeCurrent(m_x11Display, m_window, m_context.get());
+        return glXMakeCurrent(display, m_window, m_context.get());
 
     if (m_pbuffer)
-        return glXMakeCurrent(m_x11Display, m_pbuffer.get(), m_context.get());
+        return glXMakeCurrent(display, m_pbuffer.get(), m_context.get());
 
-    return ::glXMakeCurrent(m_x11Display, m_glxPixmap.get(), m_context.get());
+    return ::glXMakeCurrent(display, m_glxPixmap.get(), m_context.get());
 }
 
 void GLContextGLX::swapBuffers()
 {
     if (m_window)
-        glXSwapBuffers(m_x11Display, m_window);
+        glXSwapBuffers(downcast<PlatformDisplayX11>(m_display).native(), m_window);
 }
 
 void GLContextGLX::waitNative()
@@ -276,7 +276,7 @@
 
 void GLContextGLX::swapInterval(int interval)
 {
-    if (!hasSGISwapControlExtension(m_x11Display))
+    if (!hasSGISwapControlExtension(downcast<PlatformDisplayX11>(m_display).native()))
         return;
     glXSwapIntervalSGI(interval);
 }
@@ -287,7 +287,7 @@
         return m_cairoDevice;
 
 #if ENABLE(ACCELERATED_2D_CANVAS) && CAIRO_HAS_GLX_FUNCTIONS
-    m_cairoDevice = cairo_glx_device_create(m_x11Display, m_context.get());
+    m_cairoDevice = cairo_glx_device_create(downcast<PlatformDisplayX11>(m_display).native(), m_context.get());
 #endif
 
     return m_cairoDevice;

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.h (210153 => 210154)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.h	2016-12-27 08:04:25 UTC (rev 210153)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.h	2016-12-27 10:33:25 UTC (rev 210154)
@@ -28,7 +28,6 @@
 typedef unsigned char GLubyte;
 typedef unsigned long Window;
 typedef void* ContextKeyType;
-typedef struct _XDisplay Display;
 
 namespace WebCore {
 
@@ -64,7 +63,6 @@
     static std::unique_ptr<GLContextGLX> createPbufferContext(PlatformDisplay&, GLXContext sharingContext = nullptr);
     static std::unique_ptr<GLContextGLX> createPixmapContext(PlatformDisplay&, GLXContext sharingContext = nullptr);
 
-    Display* m_x11Display { nullptr };
     XUniqueGLXContext m_context;
     Window m_window { 0 };
     XUniqueGLXPbuffer m_pbuffer;

Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp (210153 => 210154)


--- releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp	2016-12-27 08:04:25 UTC (rev 210153)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp	2016-12-27 10:33:25 UTC (rev 210154)
@@ -56,10 +56,6 @@
 
 PlatformDisplayX11::~PlatformDisplayX11()
 {
-#if USE(EGL) || USE(GLX)
-    // Clear the sharing context before releasing the display.
-    m_sharingGLContext = nullptr;
-#endif
     if (m_ownedDisplay)
         XCloseDisplay(m_display);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to