diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-09-08 11:46:13 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-09-08 13:04:02 +0100 |
commit | 56900a441de1d4cc896ad1e36a44622ed1598fad (patch) | |
tree | ae176203c003dce23d188dbd198359da802d728f /vcl/source/opengl/OpenGLContext.cxx | |
parent | 2456cf8306be22e32130e789ab939c059e5e79e5 (diff) |
tdf#94006 - fix OpenGLContext mis-use in several places.
gltf rendering, OpenGL canvas, GL transitions & GL capable (charts)
Avoid GLX operations on un-initialized contexts.
Change-Id: I7f523640f66ab656896181e5c865879234f6640e
Diffstat (limited to 'vcl/source/opengl/OpenGLContext.cxx')
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index d070e3fb3b6b..432241f03817 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -1362,11 +1362,14 @@ void OpenGLContext::makeCurrent() TempErrorHandler aErrorHandler(m_aGLWin.dpy, unxErrorHandler); #endif - GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win; - if (!glXMakeCurrent( m_aGLWin.dpy, nDrawable, m_aGLWin.ctx )) + if (m_aGLWin.dpy) { - SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent failed on drawable " << nDrawable << " pixmap? " << mbPixmap); - return; + GLXDrawable nDrawable = mbPixmap ? m_aGLWin.glPix : m_aGLWin.win; + if (!glXMakeCurrent( m_aGLWin.dpy, nDrawable, m_aGLWin.ctx )) + { + SAL_WARN("vcl.opengl", "OpenGLContext::makeCurrent failed on drawable " << nDrawable << " pixmap? " << mbPixmap); + return; + } } #endif |