summaryrefslogtreecommitdiff
path: root/vcl/opengl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2016-05-10 12:50:38 +0300
committerTor Lillqvist <tml@collabora.com>2016-05-10 13:14:59 +0300
commit347e46da399b8cc96d9dd8dbfd62120db473b555 (patch)
tree81dbde441206ed60588001ad1dc0bee54a0e3133 /vcl/opengl
parent6928136177a4caebfdc01d5f0c1106fa8e1683fa (diff)
Check if we have an OpenGL context before using API that requires it
Avoid GL errors when glDisable() is called without a context. Change-Id: Ie9eae498c207a82934228ad2f74b7096308f5530
Diffstat (limited to 'vcl/opengl')
-rw-r--r--vcl/opengl/gdiimpl.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 4b67ed5fb871..65650c00fcab 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -2516,8 +2516,11 @@ void OpenGLSalGraphicsImpl::doFlush()
{
FlushDeferredDrawing();
- mpContext->state()->scissor().disable();
- mpContext->state()->stencil().disable();
+ if (OpenGLContext::hasCurrent())
+ {
+ mpContext->state()->scissor().disable();
+ mpContext->state()->stencil().disable();
+ }
if( IsOffscreen() )
return;