vcl/source/opengl/OpenGLContext.cxx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
New commits: commit 6143fa5a89d9528fc11fed1e7fe96b9280d411a4 Author: Louis-Francis Ratté-Boulianne <l...@collabora.com> Date: Mon Nov 10 17:13:55 2014 -0500 vcl: Use shared list for OpenGL contexts even with DBG_UTIL enabled Change-Id: I296b3a38a362343ecf8d65aa005ecabc6858a682 diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 1062a87..d39cb33 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -622,7 +622,13 @@ bool OpenGLContext::init(Display* dpy, Pixmap pix, unsigned int width, unsigned bool OpenGLContext::ImplInit() { + GLXContext pSharedCtx( NULL ); + SAL_INFO("vcl.opengl", "OpenGLContext::ImplInit----start"); + + if( !vShareList.empty() ) + pSharedCtx = vShareList.front(); + #ifdef DBG_UTIL if (!mbPixmap && glXCreateContextAttribsARB && !mbRequestLegacyContext) { @@ -639,7 +645,7 @@ bool OpenGLContext::ImplInit() GLX_CONTEXT_MINOR_VERSION_ARB, 2, None }; - m_aGLWin.ctx = glXCreateContextAttribsARB(m_aGLWin.dpy, pFBC[best_fbc], 0, GL_TRUE, nContextAttribs); + m_aGLWin.ctx = glXCreateContextAttribsARB(m_aGLWin.dpy, pFBC[best_fbc], pSharedCtx, GL_TRUE, nContextAttribs); SAL_INFO_IF(m_aGLWin.ctx, "vcl.opengl", "created a 3.2 core context"); } else @@ -650,25 +656,22 @@ bool OpenGLContext::ImplInit() if (!m_aGLWin.ctx) { - GLXContext pSharedCtx( NULL ); - if (!m_aGLWin.dpy || !m_aGLWin.vi) return false; - if( !vShareList.empty() ) - pSharedCtx = vShareList.front(); - m_aGLWin.ctx = m_aGLWin.dpy == 0 ? 0 : glXCreateContext(m_aGLWin.dpy, m_aGLWin.vi, pSharedCtx, GL_TRUE); - - if( m_aGLWin.ctx ) - vShareList.push_back( m_aGLWin.ctx ); } - if( m_aGLWin.ctx == NULL ) + + if( m_aGLWin.ctx ) + { + vShareList.push_back( m_aGLWin.ctx ); + } + else { SAL_WARN("vcl.opengl", "unable to create GLX context"); return false;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits