Changeset 205956 in webkit
- Timestamp:
- Sep 15, 2016 12:59:10 AM (8 years ago)
- Location:
- releases/WebKitGTK/webkit-2.14/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog
r205734 r205956 1 2016-09-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Crash of WebProcess on the last WebView disconnect (take two) 4 https://bugs.webkit.org/show_bug.cgi?id=161842 5 6 Reviewed by Michael Catanzaro. 7 8 The problem is that when PlatformDisplayX11 is destroyed, the sharing GL context is deleted and its destructor 9 makes a downcast of PlatformDisplay to get the native X11 display. We could simply keep a pointer to the native 10 X11 display in GLContextGLX, got at construction time from the PlatformDisplay, and ensure the sharing GL 11 context is deleted before the native X11 display is closed. 12 13 * platform/graphics/PlatformDisplay.h: Make m_sharingGLContext protected. 14 * platform/graphics/glx/GLContextGLX.cpp: 15 (WebCore::GLContextGLX::GLContextGLX): Initialize m_x11Display. 16 (WebCore::GLContextGLX::~GLContextGLX): Use m_x11Display and remove confusing comment about possible crash with 17 nviedia closed drivers. 18 (WebCore::GLContextGLX::defaultFrameBufferSize): Use m_x11Display. 19 (WebCore::GLContextGLX::makeContextCurrent): Ditto. 20 (WebCore::GLContextGLX::swapBuffers): Ditto. 21 (WebCore::GLContextGLX::swapInterval): Ditto. 22 (WebCore::GLContextGLX::cairoDevice): Ditto. 23 * platform/graphics/glx/GLContextGLX.h: 24 * platform/graphics/x11/PlatformDisplayX11.cpp: 25 (WebCore::PlatformDisplayX11::~PlatformDisplayX11): Delete the sharing GL context before closing the display. 26 1 27 2016-09-06 Carlos Garcia Campos <cgarcia@igalia.com> 2 28 -
releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/PlatformDisplay.h
r205116 r205956 81 81 #endif 82 82 83 std::unique_ptr<GLContext> m_sharingGLContext; 84 83 85 private: 84 86 static std::unique_ptr<PlatformDisplay> createPlatformDisplay(); … … 91 93 int m_eglMinorVersion { 0 }; 92 94 #endif 93 std::unique_ptr<GLContext> m_sharingGLContext;94 95 }; 95 96 -
releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.cpp
r205734 r205956 181 181 GLContextGLX::GLContextGLX(PlatformDisplay& display, XUniqueGLXContext&& context, XID window) 182 182 : GLContext(display) 183 , m_x11Display(downcast<PlatformDisplayX11>(m_display).native()) 183 184 , m_context(WTFMove(context)) 184 185 , m_window(window) … … 189 190 GLContextGLX::GLContextGLX(PlatformDisplay& display, XUniqueGLXContext&& context, XUniqueGLXPbuffer&& pbuffer) 190 191 : GLContext(display) 192 , m_x11Display(downcast<PlatformDisplayX11>(m_display).native()) 191 193 , m_context(WTFMove(context)) 192 194 , m_pbuffer(WTFMove(pbuffer)) … … 197 199 GLContextGLX::GLContextGLX(PlatformDisplay& display, XUniqueGLXContext&& context, XUniquePixmap&& pixmap, XUniqueGLXPixmap&& glxPixmap) 198 200 : GLContext(display) 201 , m_x11Display(downcast<PlatformDisplayX11>(m_display).native()) 199 202 , m_context(WTFMove(context)) 200 203 , m_pixmap(WTFMove(pixmap)) … … 220 223 } 221 224 222 // This may be necessary to prevent crashes with NVidia's closed source drivers. Originally223 // from Mozilla's 3D canvas implementation at: http://bitbucket.org/ilmari/canvas3d/224 225 glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); 225 glXMakeCurrent( downcast<PlatformDisplayX11>(m_display).native(), None, None);226 glXMakeCurrent(m_x11Display, None, None); 226 227 227 228 m_context = nullptr; … … 241 242 Window rootWindow; 242 243 unsigned int width, height, borderWidth, depth; 243 if (!XGetGeometry( downcast<PlatformDisplayX11>(m_display).native(), m_window, &rootWindow, &x, &y, &width, &height, &borderWidth, &depth))244 if (!XGetGeometry(m_x11Display, m_window, &rootWindow, &x, &y, &width, &height, &borderWidth, &depth)) 244 245 return IntSize(); 245 246 … … 255 256 return true; 256 257 257 Display* display = downcast<PlatformDisplayX11>(m_display).native();258 258 if (m_window) 259 return glXMakeCurrent( display, m_window, m_context.get());259 return glXMakeCurrent(m_x11Display, m_window, m_context.get()); 260 260 261 261 if (m_pbuffer) 262 return glXMakeCurrent( display, m_pbuffer.get(), m_context.get());263 264 return ::glXMakeCurrent( display, m_glxPixmap.get(), m_context.get());262 return glXMakeCurrent(m_x11Display, m_pbuffer.get(), m_context.get()); 263 264 return ::glXMakeCurrent(m_x11Display, m_glxPixmap.get(), m_context.get()); 265 265 } 266 266 … … 268 268 { 269 269 if (m_window) 270 glXSwapBuffers( downcast<PlatformDisplayX11>(m_display).native(), m_window);270 glXSwapBuffers(m_x11Display, m_window); 271 271 } 272 272 … … 278 278 void GLContextGLX::swapInterval(int interval) 279 279 { 280 if (!hasSGISwapControlExtension( downcast<PlatformDisplayX11>(m_display).native()))280 if (!hasSGISwapControlExtension(m_x11Display)) 281 281 return; 282 282 glXSwapIntervalSGI(interval); … … 289 289 290 290 #if ENABLE(ACCELERATED_2D_CANVAS) && CAIRO_HAS_GLX_FUNCTIONS 291 m_cairoDevice = cairo_glx_device_create( downcast<PlatformDisplayX11>(m_display).native(), m_context.get());291 m_cairoDevice = cairo_glx_device_create(m_x11Display, m_context.get()); 292 292 #endif 293 293 -
releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/glx/GLContextGLX.h
r205734 r205956 30 30 typedef unsigned long XID; 31 31 typedef void* ContextKeyType; 32 typedef struct _XDisplay Display; 32 33 33 34 namespace WebCore { … … 65 66 static std::unique_ptr<GLContextGLX> createPixmapContext(PlatformDisplay&, GLXContext sharingContext = nullptr); 66 67 68 Display* m_x11Display { nullptr }; 67 69 XUniqueGLXContext m_context; 68 70 XID m_window { 0 }; -
releases/WebKitGTK/webkit-2.14/Source/WebCore/platform/graphics/x11/PlatformDisplayX11.cpp
r204013 r205956 36 36 #if USE(EGL) 37 37 #include <EGL/egl.h> 38 #include <EGL/eglplatform.h> 38 39 #endif 40 41 // FIXME: this needs to be here, after eglplatform.h, to avoid EGLNativeDisplayType to be defined as wl_display. 42 // Since we support Wayland and X11 to be built at the same time, but eglplatform.h defines are decided at compile time 43 // we need to ensure we only include eglplatform.h from X11 or Wayland specific files. 44 #include "GLContext.h" 39 45 40 46 namespace WebCore { … … 54 60 PlatformDisplayX11::~PlatformDisplayX11() 55 61 { 62 // Clear the sharing context before releasing the display. 63 m_sharingGLContext = nullptr; 56 64 if (m_ownedDisplay) 57 65 XCloseDisplay(m_display);
Note: See TracChangeset
for help on using the changeset viewer.