slideshow/source/engine/opengl/TransitionerImpl.cxx |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 1bfbef9ad2092106c8f1f6c3e5942940173c2d15
Author:     Caolán McNamara <[email protected]>
AuthorDate: Wed May 25 11:49:24 2022 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Wed May 25 16:35:01 2022 +0200

    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 <[email protected]>

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();

Reply via email to