[Libreoffice-commits] core.git: 4 commits - slideshow/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Tue Aug 26 10:26:18 PDT 2014


 slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx |   51 ++--------
 1 file changed, 13 insertions(+), 38 deletions(-)

New commits:
commit 67232b5e73df5a2a792fc274b04b52f4e9806000
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Tue Aug 26 19:13:23 2014 +0200

    glew is setting up that function pointer for us
    
    Change-Id: I1722c1d3816e6e995e71317a9c9b1529afe9df13

diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index cfb1c56..19c1606 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -561,12 +561,10 @@ void OGLTransitionerImpl::createTexture( GLuint* texID,
     glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
 
 #if defined( GLX_EXT_texture_from_pixmap )
-    PFNGLXBINDTEXIMAGEEXTPROC myglXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC) glXGetProcAddress( (const GLubyte*) "glXBindTexImageEXT" );
-
     if( usePixmap ) {
         if( mbGenerateMipmap )
             glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, True);
-        myglXBindTexImageEXT (mpContext->getOpenGLWindow().dpy, pixmap, GLX_FRONT_LEFT_EXT, NULL);
+        glXBindTexImageEXT (mpContext->getOpenGLWindow().dpy, pixmap, GLX_FRONT_LEFT_EXT, NULL);
         if( mbGenerateMipmap && useMipmap ) {
             SAL_INFO("slideshow.opengl", "use mipmaps");
             glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
@@ -1234,9 +1232,8 @@ void OGLTransitionerImpl::disposeTextures()
 #if defined( GLX_EXT_texture_from_pixmap )
     GLWindow& rGLWindow(mpContext->getOpenGLWindow());
 
-    PFNGLXRELEASETEXIMAGEEXTPROC myglXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC) glXGetProcAddress( (const GLubyte*) "glXReleaseTexImageEXT" );
     if( mbUseLeavingPixmap ) {
-        myglXReleaseTexImageEXT( rGLWindow.dpy, maLeavingPixmapGL, GLX_FRONT_LEFT_EXT );
+        glXReleaseTexImageEXT( rGLWindow.dpy, maLeavingPixmapGL, GLX_FRONT_LEFT_EXT );
         glXDestroyGLXPixmap( rGLWindow.dpy, maLeavingPixmapGL );
         maLeavingPixmapGL = 0;
         if( mbFreeLeavingPixmap ) {
@@ -1246,7 +1243,7 @@ void OGLTransitionerImpl::disposeTextures()
         }
     }
     if( mbUseEnteringPixmap ) {
-        myglXReleaseTexImageEXT( rGLWindow.dpy, maEnteringPixmapGL, GLX_FRONT_LEFT_EXT );
+        glXReleaseTexImageEXT( rGLWindow.dpy, maEnteringPixmapGL, GLX_FRONT_LEFT_EXT );
         glXDestroyGLXPixmap( rGLWindow.dpy, maEnteringPixmapGL );
         maEnteringPixmapGL = 0;
         if( mbFreeEnteringPixmap ) {
commit 88963dcfe78972111c7906b29492a602504ebf49
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Tue Aug 26 19:10:18 2014 +0200

    that variable has nothing to do with glx
    
    Change-Id: I202f716bcc65165e80928ccb81cec57f01bc0824

diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index 67a7080..cfb1c56 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -287,7 +287,7 @@ public:
     /**
        Whether the display has GLX extension on X11, always true otherwise (?)
      */
-    bool mbGLXPresent;
+    bool mbValidOpenGLContext;
 
     /**
        whether to generate mipmaped textures
@@ -313,18 +313,18 @@ bool OGLTransitionerImpl::initialize( const Reference< presentation::XSlideShowV
         const Reference< rendering::XBitmap >& xLeavingSlide,
         const Reference< rendering::XBitmap >& xEnteringSlide )
 {
-    bool const bGLXPresent( initWindowFromSlideShowView( xView ) );
-    impl_initializeFlags( bGLXPresent );
+    bool const bValidContext( initWindowFromSlideShowView( xView ) );
+    impl_initializeFlags( bValidContext );
 
     setSlides( xLeavingSlide, xEnteringSlide );
 
-    return mbGLXPresent;
+    return mbValidOpenGLContext;
 }
 
-void OGLTransitionerImpl::impl_initializeFlags( bool const bGLXPresent )
+void OGLTransitionerImpl::impl_initializeFlags( bool const bValidContext )
 {
-    mbGLXPresent = bGLXPresent;
-    if ( bGLXPresent ) {
+    mbValidOpenGLContext = bValidContext;
+    if ( bValidContext ) {
         mnGLVersion = OpenGLHelper::getGLVersion();
         SAL_INFO("slideshow.opengl", "GL version: " << mnGLVersion << "" );
 
@@ -1181,7 +1181,7 @@ void SAL_CALL OGLTransitionerImpl::update( double nTime ) throw (uno::RuntimeExc
 #endif
     osl::MutexGuard const guard( m_aMutex );
 
-    if (isDisposed() || !mbGLXPresent || mpTransition->getSettings().mnRequiredGLVersion > mnGLVersion)
+    if (isDisposed() || !mbValidOpenGLContext || mpTransition->getSettings().mnRequiredGLVersion > mnGLVersion)
         return;
 
     mpContext->makeCurrent();
@@ -1342,8 +1342,7 @@ OGLTransitionerImpl::OGLTransitionerImpl()
     , maSlideSize()
     , mbBrokenTexturesATI(false)
     , mnGLVersion(0)
-    , mbGLXPresent(false)
-    , mbMesa(false)
+    , mbValidOpenGLContext(false)
     , mbGenerateMipmap(false)
     , mbHasTFPVisual(false)
 {
commit d72c4d4ba26666b4b0cc86c6ebaabb813a79e370
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Tue Aug 26 19:07:04 2014 +0200

    let us assume that we need to special handling for mesa anymore
    
    Change-Id: I37c4db8ad7283486dd8bb62b22342f6b127f0b08

diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index c23da5a..67a7080 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -289,10 +289,6 @@ public:
      */
     bool mbGLXPresent;
 
-    /** Whether Mesa is the OpenGL vendor
-     */
-    bool mbMesa;
-
     /**
        whether to generate mipmaped textures
     */
@@ -333,8 +329,6 @@ void OGLTransitionerImpl::impl_initializeFlags( bool const bGLXPresent )
         SAL_INFO("slideshow.opengl", "GL version: " << mnGLVersion << "" );
 
         const GLubyte* vendor = glGetString( GL_VENDOR );
-        mbMesa = ( vendor && strstr( (const char *) vendor, "Mesa" ) );
-        SAL_INFO("slideshow.opengl", "GL vendor: " << vendor << " identified as Mesa: " << mbMesa << "" );
 
         /* TODO: check for version once the bug in fglrx driver is fixed */
         mbBrokenTexturesATI = (vendor && strcmp( (const char *) vendor, "ATI Technologies Inc." ) == 0 );
@@ -1416,12 +1410,6 @@ public:
         if ( !xRes->initialize( view, leavingBitmap, enteringBitmap ) )
             return uno::Reference< presentation::XTransition >();
 
-        if( xRes->mbMesa && (
-            ( transitionType == animations::TransitionType::FADE && transitionSubType == animations::TransitionSubType::CROSSFADE ) ||
-            ( transitionType == animations::TransitionType::FADE && transitionSubType == animations::TransitionSubType::FADEOVERCOLOR ) ||
-            ( transitionType == animations::TransitionType::IRISWIPE && transitionSubType == animations::TransitionSubType::DIAMOND ) ) )
-            return uno::Reference< presentation::XTransition >();
-
         boost::shared_ptr<OGLTransitionImpl> pTransition;
 
         if( transitionType == animations::TransitionType::MISCSHAPEWIPE ) {
commit d409d5810c3ab53040f664c3b4cfab412ba97ae4
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Tue Aug 26 19:05:40 2014 +0200

    use glew variable to check for the feature
    
    Change-Id: I1e2ae37a75826d321268395d4a3c23c7ed8d7b17

diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index 949dc36..c23da5a 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -294,11 +294,6 @@ public:
     bool mbMesa;
 
     /**
-       whether texture from pixmap extension is available
-    */
-    bool mbTextureFromPixmap;
-
-    /**
        whether to generate mipmaped textures
     */
     bool mbGenerateMipmap;
@@ -383,9 +378,6 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta
 
     GLWindow& rGLWindow(mpContext->getOpenGLWindow());
 
-#ifdef UNX
-    mbTextureFromPixmap = rGLWindow.HasGLXExtension( "GLX_EXT_texture_from_pixmap" );
-#endif
     mbGenerateMipmap = rGLWindow.HasGLExtension( "GL_SGIS_generate_mipmap" );
 
     glEnable(GL_CULL_FACE);
@@ -446,7 +438,7 @@ void OGLTransitionerImpl::impl_prepareSlides()
 
     GLWindow& rGLWindow(mpContext->getOpenGLWindow());
 
-    if( mbTextureFromPixmap && xLeavingSet.is() && xEnteringSet.is() && mbHasTFPVisual ) {
+    if( GLXEW_EXT_texture_from_pixmap && xLeavingSet.is() && xEnteringSet.is() && mbHasTFPVisual ) {
         Sequence< Any > leaveArgs;
         Sequence< Any > enterArgs;
         if( (xLeavingSet->getFastPropertyValue( 1 ) >>= leaveArgs) &&
@@ -1358,7 +1350,6 @@ OGLTransitionerImpl::OGLTransitionerImpl()
     , mnGLVersion(0)
     , mbGLXPresent(false)
     , mbMesa(false)
-    , mbTextureFromPixmap(false)
     , mbGenerateMipmap(false)
     , mbHasTFPVisual(false)
 {


More information about the Libreoffice-commits mailing list