diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2014-11-17 20:33:41 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2014-11-17 22:40:08 +0000 |
commit | 1c20a126d43ca34332f050f6eb847621de99e1b0 (patch) | |
tree | 0520e21f812c7ff204c8981949b33202eebf904a /vcl | |
parent | 95017eaf851c6b97db38cd226b6bea661e73dc60 (diff) |
vcl: only use default windows' GL Context for bitmaps if NULL / uninitialized.
Change-Id: I6465c548ba5d50da2cca7cce24e9bd2a20b28f47
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/opengl/salbmp.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index 780c268c5516..15ef1b38a8dd 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -464,14 +464,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; } |