summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <lfrb@collabora.com>2014-11-10 17:13:55 -0500
committerMichael Meeks <michael.meeks@collabora.com>2014-11-10 22:22:44 +0000
commit6143fa5a89d9528fc11fed1e7fe96b9280d411a4 (patch)
tree8b286d72e2d2bc1ee379643b641738b980afd8c5 /vcl
parent01fad59c533d797cdb8dad1a848a553c4500115a (diff)
vcl: Use shared list for OpenGL contexts even with DBG_UTIL enabled
Change-Id: I296b3a38a362343ecf8d65aa005ecabc6858a682
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 1062a879a09d..d39cb33fdc36 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;