WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch for landing
bug-107178-20130121121510.patch (text/plain), 12.60 KB, created by
Viatcheslav Ostapenko
on 2013-01-21 09:18:07 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Viatcheslav Ostapenko
Created:
2013-01-21 09:18:07 PST
Size:
12.60 KB
patch
obsolete
>Subversion Revision: 140284 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c937f0442dad1751fbd0d90afb6384229b49ef24..d817fce72f792334e5e9f60525659ab0388a1290 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,40 @@ >+2013-01-18 Viatcheslav Ostapenko <sl.ostapenko@samsung.com> >+ >+ [EFL][Qt][WebGl] Random crash in GraphicsContext3D::drawArrays >+ https://bugs.webkit.org/show_bug.cgi?id=107178 >+ >+ Reviewed by Noam Rosenthal. >+ >+ Workaround for the problem in mesa when internal llvm pipe object is deleted >+ later than the screen object. Screen object is deleted because the corresponding >+ X server display connection closed. >+ Keep X server display connection open until program shutdown. >+ OffScreenRootWindow::display is now static, so there is no need to create >+ OffScreenRootWindow object on client side. >+ >+ Fixes crash that appears during run of fast/canavs/webgl tests. >+ >+ * platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp: >+ (OffScreenRootWindow): >+ (WebCore::OffScreenRootWindow::DisplayConnection::DisplayConnection): >+ (DisplayConnection): >+ (WebCore::OffScreenRootWindow::DisplayConnection::~DisplayConnection): >+ (WebCore::OffScreenRootWindow::DisplayConnection::display): >+ (WebCore::OffScreenRootWindow::display): >+ (WebCore::OffScreenRootWindow::~OffScreenRootWindow): >+ (WebCore): >+ (WebCore::GraphicsSurfacePrivate::GraphicsSurfacePrivate): >+ (WebCore::GraphicsSurfacePrivate::createSurface): >+ (WebCore::GraphicsSurfacePrivate::createPixmap): >+ (WebCore::GraphicsSurfacePrivate::makeCurrent): >+ (WebCore::GraphicsSurfacePrivate::doneCurrent): >+ (WebCore::GraphicsSurfacePrivate::swapBuffers): >+ (WebCore::GraphicsSurfacePrivate::display): >+ (WebCore::GraphicsSurfacePrivate::size): >+ (WebCore::GraphicsSurfacePrivate::findFBConfigWithAlpha): >+ (WebCore::GraphicsSurfacePrivate::clear): >+ (GraphicsSurfacePrivate): >+ > 2013-01-20 Laszlo Gombos <l.gombos@samsung.com> > > Simplify a list of negative PLATFORM() tests >diff --git a/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp b/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp >index 933d6fa9019e791bbdcfa97a2e4b532e0aab03f4..a57b638696892fa15db479f68a5c32d5e7b8ea1f 100644 >--- a/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp >+++ b/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp >@@ -144,37 +144,50 @@ public: > return m_window; > } > >- Display* display() >- { >- if (!m_display) >+private: >+ struct DisplayConnection { >+ DisplayConnection() >+ { > m_display = XOpenDisplay(0); >- return m_display; >+ } >+ >+ ~DisplayConnection() >+ { >+ XCloseDisplay(m_display); >+ } >+ >+ Display* display() { return m_display; } >+ private: >+ Display* m_display; >+ }; >+ >+public: >+ static Display* display() >+ { >+ // Display connection will only be broken at program shutdown. >+ static DisplayConnection displayConnection; >+ return displayConnection.display(); > } > > ~OffScreenRootWindow() > { >- if (--m_refCount || !m_display) >+ if (--m_refCount) > return; > > if (m_window) { >- XUnmapWindow(m_display, m_window); >- XDestroyWindow(m_display, m_window); >+ XUnmapWindow(display(), m_window); >+ XDestroyWindow(display(), m_window); > m_window = 0; > } >- >- XCloseDisplay(m_display); >- m_display = 0; > } > > private: > static int m_refCount; > static Window m_window; >- static Display* m_display; > }; > > int OffScreenRootWindow::m_refCount = 0; > Window OffScreenRootWindow::m_window = 0; >-Display* OffScreenRootWindow::m_display = 0; > > static const int glxSpec[] = { > // The specification is a set key value pairs stored in a simple array. >@@ -195,7 +208,7 @@ static const int glxAttributes[] = { > > struct GraphicsSurfacePrivate { > GraphicsSurfacePrivate(const PlatformGraphicsContext3D shareContext = 0) >- : m_display(m_offScreenWindow.display()) >+ : m_offScreenWindow(adoptPtr(new OffScreenRootWindow())) > , m_xPixmap(0) > , m_glxPixmap(0) > , m_surface(0) >@@ -222,7 +235,7 @@ struct GraphicsSurfacePrivate { > #endif > > int numReturned; >- GLXFBConfig* fbConfigs = glXChooseFBConfig(m_display, DefaultScreen(m_display), attributes, &numReturned); >+ GLXFBConfig* fbConfigs = glXChooseFBConfig(display(), DefaultScreen(display()), attributes, &numReturned); > > // Make sure that we choose a configuration that supports an alpha mask. > m_fbConfig = findFBConfigWithAlpha(fbConfigs, numReturned); >@@ -230,12 +243,11 @@ struct GraphicsSurfacePrivate { > XFree(fbConfigs); > > // Create a GLX context for OpenGL rendering >- m_glContext = glXCreateNewContext(m_display, m_fbConfig, GLX_RGBA_TYPE, shareContextObject, true); >+ m_glContext = glXCreateNewContext(display(), m_fbConfig, GLX_RGBA_TYPE, shareContextObject, true); > } > > GraphicsSurfacePrivate(uint32_t winId) >- : m_display(m_offScreenWindow.display()) >- , m_xPixmap(0) >+ : m_xPixmap(0) > , m_glxPixmap(0) > , m_surface(winId) > , m_glxSurface(0) >@@ -255,63 +267,63 @@ struct GraphicsSurfacePrivate { > > uint32_t createSurface(const IntSize& size) > { >- XVisualInfo* visualInfo = glXGetVisualFromFBConfig(m_display, m_fbConfig); >+ XVisualInfo* visualInfo = glXGetVisualFromFBConfig(display(), m_fbConfig); > if (!visualInfo) > return 0; > >- Colormap cmap = XCreateColormap(m_display, m_offScreenWindow.getXWindow(), visualInfo->visual, AllocNone); >+ Colormap cmap = XCreateColormap(display(), m_offScreenWindow->getXWindow(), visualInfo->visual, AllocNone); > > XSetWindowAttributes a; >- a.background_pixel = WhitePixel(m_display, 0); >- a.border_pixel = BlackPixel(m_display, 0); >+ a.background_pixel = WhitePixel(display(), 0); >+ a.border_pixel = BlackPixel(display(), 0); > a.colormap = cmap; >- m_surface = XCreateWindow(m_display, m_offScreenWindow.getXWindow(), 0, 0, size.width(), size.height(), >+ m_surface = XCreateWindow(display(), m_offScreenWindow->getXWindow(), 0, 0, size.width(), size.height(), > 0, visualInfo->depth, InputOutput, visualInfo->visual, > CWBackPixel | CWBorderPixel | CWColormap, &a); >- XSetWindowBackgroundPixmap(m_display, m_surface, 0); >- XCompositeRedirectWindow(m_display, m_surface, CompositeRedirectManual); >- m_glxSurface = glXCreateWindow(m_display, m_fbConfig, m_surface, 0); >+ XSetWindowBackgroundPixmap(display(), m_surface, 0); >+ XCompositeRedirectWindow(display(), m_surface, CompositeRedirectManual); >+ m_glxSurface = glXCreateWindow(display(), m_fbConfig, m_surface, 0); > XFree(visualInfo); > > // Make sure the XRender Extension is available. > int eventBasep, errorBasep; >- if (!XRenderQueryExtension(m_display, &eventBasep, &errorBasep)) >+ if (!XRenderQueryExtension(display(), &eventBasep, &errorBasep)) > return 0; > >- XMapWindow(m_display, m_surface); >+ XMapWindow(display(), m_surface); > return m_surface; > } > > void createPixmap(uint32_t winId) > { > XWindowAttributes attr; >- if (!XGetWindowAttributes(m_display, winId, &attr)) >+ if (!XGetWindowAttributes(display(), winId, &attr)) > return; > > // Ensure that the window is mapped. > if (attr.map_state == IsUnmapped || attr.map_state == IsUnviewable) > return; > >- ScopedXPixmapCreationErrorHandler handler(m_display); >+ ScopedXPixmapCreationErrorHandler handler(display()); > m_size = IntSize(attr.width, attr.height); > >- XRenderPictFormat* format = XRenderFindVisualFormat(m_display, attr.visual); >+ XRenderPictFormat* format = XRenderFindVisualFormat(display(), attr.visual); > m_hasAlpha = (format->type == PictTypeDirect && format->direct.alphaMask); > > int numberOfConfigs; >- GLXFBConfig* configs = glXChooseFBConfig(m_display, XDefaultScreen(m_display), glxSpec, &numberOfConfigs); >+ GLXFBConfig* configs = glXChooseFBConfig(display(), XDefaultScreen(display()), glxSpec, &numberOfConfigs); > > // If origin window has alpha then find config with alpha. > GLXFBConfig& config = m_hasAlpha ? findFBConfigWithAlpha(configs, numberOfConfigs) : configs[0]; > >- m_xPixmap = XCompositeNameWindowPixmap(m_display, winId); >- m_glxPixmap = glXCreatePixmap(m_display, config, m_xPixmap, glxAttributes); >+ m_xPixmap = XCompositeNameWindowPixmap(display(), winId); >+ m_glxPixmap = glXCreatePixmap(display(), config, m_xPixmap, glxAttributes); > > if (!handler.isValidOperation()) > clear(); > else { > uint inverted = 0; >- glXQueryDrawable(m_display, m_glxPixmap, GLX_Y_INVERTED_EXT, &inverted); >+ glXQueryDrawable(display(), m_glxPixmap, GLX_Y_INVERTED_EXT, &inverted); > m_textureIsYInverted = !!inverted; > } > >@@ -328,13 +340,13 @@ struct GraphicsSurfacePrivate { > m_detachedContext = glXGetCurrentContext(); > m_detachedSurface = glXGetCurrentDrawable(); > if (m_surface && m_glContext) >- glXMakeCurrent(m_display, m_surface, m_glContext); >+ glXMakeCurrent(display(), m_surface, m_glContext); > } > > void doneCurrent() > { > if (m_detachedContext) >- glXMakeCurrent(m_display, m_detachedSurface, m_detachedContext); >+ glXMakeCurrent(display(), m_detachedSurface, m_detachedContext); > m_detachedContext = 0; > } > >@@ -351,7 +363,7 @@ struct GraphicsSurfacePrivate { > GLint oldFBO; > glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldFBO); > pGlBindFramebuffer(GL_FRAMEBUFFER, 0); >- glXSwapBuffers(m_display, m_surface); >+ glXSwapBuffers(display(), m_surface); > pGlBindFramebuffer(GL_FRAMEBUFFER, oldFBO); > } > } >@@ -388,7 +400,7 @@ struct GraphicsSurfacePrivate { > doneCurrent(); > } > >- Display* display() const { return m_display; } >+ Display* display() const { return OffScreenRootWindow::display(); } > > GLXPixmap glxPixmap() const > { >@@ -401,7 +413,7 @@ struct GraphicsSurfacePrivate { > { > if (m_size.isEmpty()) { > XWindowAttributes attr; >- if (XGetWindowAttributes(m_display, m_surface, &attr)) >+ if (XGetWindowAttributes(display(), m_surface, &attr)) > const_cast<GraphicsSurfacePrivate*>(this)->m_size = IntSize(attr.width, attr.height); > } > return m_size; >@@ -412,11 +424,11 @@ private: > GLXFBConfig& findFBConfigWithAlpha(GLXFBConfig* fbConfigs, int numberOfConfigs) > { > for (int i = 0; i < numberOfConfigs; ++i) { >- XVisualInfo* visualInfo = glXGetVisualFromFBConfig(m_display, fbConfigs[i]); >+ XVisualInfo* visualInfo = glXGetVisualFromFBConfig(display(), fbConfigs[i]); > if (!visualInfo) > continue; > >- XRenderPictFormat* format = XRenderFindVisualFormat(m_display, visualInfo->visual); >+ XRenderPictFormat* format = XRenderFindVisualFormat(display(), visualInfo->visual); > XFree(visualInfo); > > if (format && format->direct.alphaMask > 0) >@@ -430,30 +442,29 @@ private: > void clear() > { > if (m_glxPixmap) { >- glXDestroyPixmap(m_display, m_glxPixmap); >+ glXDestroyPixmap(display(), m_glxPixmap); > m_glxPixmap = 0; > } > > if (m_xPixmap) { >- XFreePixmap(m_display, m_xPixmap); >+ XFreePixmap(display(), m_xPixmap); > m_xPixmap = 0; > } > > // Client doesn't own the window. Delete surface only on writing side. > if (!m_isReceiver && m_surface) { >- XDestroyWindow(m_display, m_surface); >+ XDestroyWindow(display(), m_surface); > m_surface = 0; > } > > if (m_glContext) { >- glXDestroyContext(m_display, m_glContext); >+ glXDestroyContext(display(), m_glContext); > m_glContext = 0; > } > } > >- OffScreenRootWindow m_offScreenWindow; >+ OwnPtr<OffScreenRootWindow> m_offScreenWindow; > IntSize m_size; >- Display* m_display; > Pixmap m_xPixmap; > GLXPixmap m_glxPixmap; > Window m_surface;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 107178
:
183293
|
183471
| 183796