summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2014-11-17 20:33:41 +0000
committerMichael Meeks <michael.meeks@collabora.com>2014-11-17 20:34:43 +0000
commit6631d9819cb1635a6b8d273b99e8c17f33286dfc (patch)
treeb8e78f40ba4b5f0ec9ad6a5b460b61581e5e9bf6
parent67ff07df7d5bcf11da407b775b3fc541622fe297 (diff)
vcl: only use default windows' GL Context for bitmaps if NULL / uninitialized.
Change-Id: I6465c548ba5d50da2cca7cce24e9bd2a20b28f47
-rw-r--r--vcl/opengl/salbmp.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 6dfb4bdf6be4..78bcf07b1594 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -472,14 +472,17 @@ sal_uInt16 OpenGLSalBitmap::GetBitCount() const
bool OpenGLSalBitmap::makeCurrent()
{
- OpenGLContextProvider *pProvider;
- pProvider = dynamic_cast< OpenGLContextProvider* >( ImplGetDefaultWindow()->GetGraphics() );
- if( pProvider == NULL )
+ if (!mpContext || !mpContext->isInitialized())
{
- SAL_WARN( "vcl.opengl", "Couldn't get default OpenGL context provider" );
- return false;
+ OpenGLContextProvider *pProvider;
+ pProvider = dynamic_cast< OpenGLContextProvider* >( ImplGetDefaultWindow()->GetGraphics() );
+ if( pProvider == NULL )
+ {
+ SAL_WARN( "vcl.opengl", "Couldn't get default OpenGL context provider" );
+ return false;
+ }
+ mpContext = pProvider->GetOpenGLContext();
}
- mpContext = pProvider->GetOpenGLContext();
mpContext->makeCurrent();
return true;
}