summaryrefslogtreecommitdiff
path: root/vcl/source/opengl/OpenGLContext.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-09-02 17:28:39 +0100
committerMichael Meeks <michael.meeks@collabora.com>2015-09-02 17:37:11 +0000
commit7164ec07ca50a9faba85cb73bcd8a734d058ec34 (patch)
treee5b3e2c41e81898d0cb93306c253c329e177fa53 /vcl/source/opengl/OpenGLContext.cxx
parent0c648002addbecbf1ff5c9b9f6aa708521e16384 (diff)
Don't call GL debugging methods if there is no context.
Change-Id: Ie6b824953b8ad19fd1b6a146cb6bf52bbb152ef7 Reviewed-on: https://gerrit.libreoffice.org/18276 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/source/opengl/OpenGLContext.cxx')
-rw-r--r--vcl/source/opengl/OpenGLContext.cxx11
1 files changed, 11 insertions, 0 deletions
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();