summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-05-25 11:49:24 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-25 16:35:01 +0200
commit1bfbef9ad2092106c8f1f6c3e5942940173c2d15 (patch)
tree028b8f72947e6807bdc53e8f7c651c125a811ee5
parent9525dc41e3f592a373315d005ed9a65cbb57861c (diff)
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>
-rw-r--r--slideshow/source/engine/opengl/TransitionerImpl.cxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx b/slideshow/source/engine/opengl/TransitionerImpl.cxx
index 6f9e2a26001d..f3cc33abf3f6 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();