From 1c20a126d43ca34332f050f6eb847621de99e1b0 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 17 Nov 2014 20:33:41 +0000 Subject: vcl: only use default windows' GL Context for bitmaps if NULL / uninitialized. Change-Id: I6465c548ba5d50da2cca7cce24e9bd2a20b28f47 --- vcl/opengl/salbmp.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'vcl') 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; } -- cgit