tdf#149068 don't call any OpenGL if the context is initially 'invalid'
Change-Id: I6a966e84574716a215d1625cde8b6826185cc451
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134935
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx b/slideshow/source/engine/opengl/TransitionerImpl.cxx
index 6f9e2a2..f3cc33a 100644
--- a/slideshow/source/engine/opengl/TransitionerImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionerImpl.cxx
@@ -266,15 +266,15 @@ bool OGLTransitionerImpl::initialize( const Reference< presentation::XSlideShowV
setSlides( xLeavingSlide, xEnteringSlide );
CHECK_GL_ERROR();
return mbValidOpenGLContext;
}
void OGLTransitionerImpl::impl_initializeFlags( bool const bValidContext )
{
CHECK_GL_ERROR();
mbValidOpenGLContext = bValidContext;
if ( bValidContext ) {
CHECK_GL_ERROR();
mnGLVersion = OpenGLHelper::getGLVersion();
SAL_INFO("slideshow.opengl", "GL version: " << mnGLVersion << "" );
@@ -283,8 +283,9 @@ void OGLTransitionerImpl::impl_initializeFlags( bool const bValidContext )
/* TODO: check for version once the bug in fglrx driver is fixed */
mbBrokenTexturesATI = (vendor && strcmp( reinterpret_cast<const char *>(vendor), "ATI Technologies Inc." ) == 0 );
#endif
CHECK_GL_ERROR();
}
CHECK_GL_ERROR();
}
bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presentation::XSlideShowView >& xView )
@@ -1075,6 +1076,9 @@ void SAL_CALL OGLTransitionerImpl::viewChanged( const Reference< presentation::X
void OGLTransitionerImpl::disposeTextures()
{
if (!mbValidOpenGLContext)
return;
mpContext->makeCurrent();
CHECK_GL_ERROR();
@@ -1088,8 +1092,11 @@ void OGLTransitionerImpl::disposeTextures()
void OGLTransitionerImpl::impl_dispose()
{
mpContext->makeCurrent();
CHECK_GL_ERROR();
if (mbValidOpenGLContext)
{
mpContext->makeCurrent();
CHECK_GL_ERROR();
}
if( mpTransition && mpTransition->getSettings().mnRequiredGLVersion <= mnGLVersion )
mpTransition->finish();