summaryrefslogtreecommitdiff
path: root/vcl/source/opengl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-09-08 11:46:13 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-09-08 13:04:02 +0100
commit56900a441de1d4cc896ad1e36a44622ed1598fad (patch)
treeae176203c003dce23d188dbd198359da802d728f /vcl/source/opengl
parent2456cf8306be22e32130e789ab939c059e5e79e5 (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')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx11
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