[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl2' - vcl/opengl
Michael Meeks
michael.meeks at collabora.com
Mon Nov 17 12:35:36 PST 2014
vcl/opengl/salbmp.cxx | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
New commits:
commit 6631d9819cb1635a6b8d273b99e8c17f33286dfc
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Mon Nov 17 20:33:41 2014 +0000
vcl: only use default windows' GL Context for bitmaps if NULL / uninitialized.
Change-Id: I6465c548ba5d50da2cca7cce24e9bd2a20b28f47
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 6dfb4bd..78bcf07 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;
}
More information about the Libreoffice-commits
mailing list