From 7164ec07ca50a9faba85cb73bcd8a734d058ec34 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Wed, 2 Sep 2015 17:28:39 +0100 Subject: Don't call GL debugging methods if there is no context. Change-Id: Ie6b824953b8ad19fd1b6a146cb6bf52bbb152ef7 Reviewed-on: https://gerrit.libreoffice.org/18276 Tested-by: Jenkins Reviewed-by: Michael Meeks --- vcl/source/opengl/OpenGLContext.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'vcl/source/opengl/OpenGLContext.cxx') diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index f3eeb7cfc53f..49feb75368b4 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -1314,6 +1314,17 @@ bool OpenGLContext::isCurrent() #endif } +bool OpenGLContext::hasCurrent() +{ +#if defined( WNT ) + return wglGetCurrentContext() != NULL; +#elif defined( MACOSX ) || defined( IOS ) || defined( ANDROID ) || defined(LIBO_HEADLESS) + return false; +#elif defined( UNX ) + return glXGetCurrentContext() != None; +#endif +} + void OpenGLContext::clearCurrent() { ImplSVData* pSVData = ImplGetSVData(); -- cgit