[Libreoffice-commits] .: 12 commits - sc/source slideshow/source sw/source vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 7 01:07:26 PDT 2012


 sc/source/core/data/documen8.cxx                                   |    3 
 sc/source/ui/docshell/arealink.cxx                                 |    1 
 slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx |  603 +++++-----
 sw/source/core/doc/gctable.cxx                                     |   13 
 vcl/source/helper/canvasbitmap.cxx                                 |    6 
 5 files changed, 327 insertions(+), 299 deletions(-)

New commits:
commit 06ae26b5676c29c4d1cc9c65f5bbaede9483a21d
Author: David Tardon <dtardon at redhat.com>
Date:   Fri Sep 7 10:00:44 2012 +0200

    fdo#54620 do not use vector iterator after insert
    
    Change-Id: I5e809f38a500ab818e9acef80b419dfece7a29fa

diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx
index 0694be3..6581000 100644
--- a/sw/source/core/doc/gctable.cxx
+++ b/sw/source/core/doc/gctable.cxx
@@ -352,19 +352,20 @@ static bool lcl_MergeGCBox(SwTableBox* pTblBox, _GCLinePara* pPara)
 
         if( 1 == pTblBox->GetTabLines().size() )
         {
-            // Box with a Line, then move all the Line's Boxes after this Box
-            // into the parent Line and delete this Box
+            // we have a box with a single line, so we just replace it by the line's boxes
             SwTableLine* pInsLine = pTblBox->GetUpper();
             SwTableLine* pCpyLine = pTblBox->GetTabLines()[0];
             SwTableBoxes::iterator it = std::find( pInsLine->GetTabBoxes().begin(), pInsLine->GetTabBoxes().end(), pTblBox );
             for( n = 0; n < pCpyLine->GetTabBoxes().size(); ++n )
                 pCpyLine->GetTabBoxes()[n]->SetUpper( pInsLine );
 
-            pInsLine->GetTabBoxes().insert( it + 1, pCpyLine->GetTabBoxes().begin(), pCpyLine->GetTabBoxes().end());
+            // remove the old box from its parent line
+            it = pInsLine->GetTabBoxes().erase( it );
+            // insert the nested line's boxes in its place
+            pInsLine->GetTabBoxes().insert( it, pCpyLine->GetTabBoxes().begin(), pCpyLine->GetTabBoxes().end());
             pCpyLine->GetTabBoxes().clear();
-            // Delete the old Box with the Line
-            delete *it;
-            pInsLine->GetTabBoxes().erase( it );
+            // destroy the removed box
+            delete pTblBox;
 
             return false; // set up anew
         }
commit dcae7058a707d7936c910d058afbad0f6220bb11
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Sep 6 13:46:01 2012 +0200

    this looks wrong
    
    Change-Id: Ibd18d9dfbd18176bc13b5c2a79a6535604e95b73

diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx
index 849b0a6..43f5848 100644
--- a/vcl/source/helper/canvasbitmap.cxx
+++ b/vcl/source/helper/canvasbitmap.cxx
@@ -1335,7 +1335,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromRGB( con
                     sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
                 aCol;
 
-            m_pBmpAcc->SetPixelOnData(pColors,0,aCol2);
+            m_pBmpAcc->SetPixelOnData(pColors,i,aCol2);
             pColors   += nNonAlphaBytes;
             *pColors++ = sal_uInt8(255);
         }
@@ -1384,7 +1384,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromARGB( co
                     sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
                 aCol;
 
-            m_pBmpAcc->SetPixelOnData(pColors,0,aCol2);
+            m_pBmpAcc->SetPixelOnData(pColors,i,aCol2);
             pColors   += nNonAlphaBytes;
             *pColors++ = 255 - toByteColor(rgbColor[i].Alpha);
         }
@@ -1434,7 +1434,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL VclCanvasBitmap::convertIntegerFromPARGB( c
                     sal::static_int_cast<sal_uInt8>(m_pBmpAcc->GetBestPaletteIndex( aCol ))) :
                 aCol;
 
-            m_pBmpAcc->SetPixelOnData(pColors,0,aCol2);
+            m_pBmpAcc->SetPixelOnData(pColors,i,aCol2);
             pColors   += nNonAlphaBytes;
             *pColors++ = 255 - toByteColor(nAlpha);
         }
commit 7e2f0392a8b4479541815818f5bcc8a54428b4c0
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Sep 3 14:38:23 2012 +0200

    fix crash on area link update
    
    Example spreadsheet: http://www.gummy-stuff.org/Excel/Yahoo.xls
    
    Change-Id: Icd16ed4fb05986bc199ac3f913cee656c7a434ff

diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 455f9c5..4b66d43 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1358,8 +1358,7 @@ void ScDocument::UpdateAreaLinks()
     if (GetLinkManager())
     {
         const ::sfx2::SvBaseLinks& rLinks = pLinkManager->GetLinks();
-        sal_uInt16 nCount = rLinks.size();
-        for (sal_uInt16 i=0; i<nCount; i++)
+        for (sal_uInt16 i=0; i<rLinks.size(); i++)
         {
             ::sfx2::SvBaseLink* pBase = *rLinks[i];
             if (pBase->ISA(ScAreaLink))
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 1e7ac94..2c08572 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -143,6 +143,7 @@ void ScAreaLink::Edit(Window* pParent, const Link& /* rEndEditHdl */ )
             SetName( aNewLinkName );
         }
 
+        sfx2::SvBaseLinkRef const xThis(this); // keep yourself alive
         Refresh( aFile, aFilter, aArea, GetRefreshDelay() );
     }
 
commit 7fac82d6f4bfd632c13d6a2b6566aa9dc8809827
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Aug 30 14:55:18 2012 +0200

    convert OSL_ debug funcs to SAL_
    
    Change-Id: I8903dd6aff6cdd6a4b24e3030309780975ea9318

diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
index 0d1a033..93bc99d 100644
--- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
@@ -851,7 +851,7 @@ void OGLTransitionerImpl::setSlides( const uno::Reference< rendering::XBitmap >&
 #endif
     GLInitSlides();
 
-    OSL_ENSURE(SlideBitmapLayout.PlaneStride == 0,"only handle no plane stride now");
+    SAL_WARN_IF(SlideBitmapLayout.PlaneStride != 0, "slideshow.opengl","only handle no plane stride now");
 
 #ifdef UNX
     /* flush & sync */
@@ -946,7 +946,7 @@ void OGLTransitionerImpl::createTexture( unsigned int* texID,
 #if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
     }
 #endif
-    OSL_ENSURE(glIsTexture(*texID), "Can't generate Leaving slide textures in OpenGL");
+    SAL_WARN_IF(!glIsTexture(*texID), "slideshow.opengl", "Can't generate Leaving slide textures in OpenGL");
 }
 
 void OGLTransitionerImpl::prepareEnvironment()
commit 6b84e09ff13d9173fb92575c860cce2f43b18b61
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Aug 30 13:54:58 2012 +0200

    more refactoring
    
    Change-Id: I2470e0d1ace4139a735e9de32c124bc054b8ff76

diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
index d747cc7..0d1a033 100644
--- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
@@ -381,6 +381,30 @@ void OGLTransitionerImpl::impl_initializeOnce( bool const bGLXPresent )
     }
 }
 
+#if defined( UNX )
+SystemEnvData const*
+lcl_createSystemWindow(
+        unx::XVisualInfo* const pXVisual,
+        Window* const pParentWindow,
+        SystemChildWindow** const pChildWindow )
+{
+    assert(pChildWindow);
+
+    SystemWindowData winData;
+    winData.nSize = sizeof(winData);
+    SAL_INFO("slideshow.opengl", "using VisualID " << pXVisual->visualid);
+    winData.pVisual = (void*)(pXVisual->visual);
+    SystemChildWindow* pWindow = new SystemChildWindow(pParentWindow, 0, &winData, sal_False);
+    SystemEnvData const* const pChildSysData = pWindow->GetSystemData();
+    if( !pChildSysData ) {
+        delete pWindow, pWindow=NULL;
+    }
+
+    *pChildWindow = pWindow;
+    return pChildSysData;
+}
+#endif
+
 bool OGLTransitionerImpl::createWindow( Window* pPWindow )
 {
     const SystemEnvData* sysData(pPWindow->GetSystemData());
@@ -509,31 +533,22 @@ bool OGLTransitionerImpl::createWindow( Window* pPWindow )
                 break;
             }
 
-            if( i != nfbconfigs || ( firstVisual && pAttributeTable[1] == NULL ) ) {
-                if( i != nfbconfigs ) {
-                    vi = glXGetVisualFromFBConfig( GLWin.dpy, fbconfigs[i] );
-                    mbHasTFPVisual = true;
-                    SAL_INFO("slideshow.opengl", "found visual suitable for texture_from_pixmap");
-                } else {
-                    vi = firstVisual;
-                    mbHasTFPVisual = false;
-                    SAL_INFO("slideshow.opengl", "did not find visual suitable for texture_from_pixmap, using " << vi->visualid);
-                }
-#endif
-            SystemWindowData winData;
-            winData.nSize = sizeof(winData);
-            SAL_INFO("slideshow.opengl", "using VisualID " << vi->visualid);
-            winData.pVisual = (void*)(vi->visual);
-            pWindow=new SystemChildWindow(pPWindow, 0, &winData, sal_False);
-            pChildSysData = pWindow->GetSystemData();
-            if( pChildSysData ) {
-                break;
-            } else {
-                delete pWindow, pWindow=NULL;
+            if( i != nfbconfigs ) {
+                vi = glXGetVisualFromFBConfig( GLWin.dpy, fbconfigs[i] );
+                mbHasTFPVisual = true;
+                pChildSysData = lcl_createSystemWindow( vi, pPWindow, &pWindow );
+                SAL_INFO("slideshow.opengl", "found visual suitable for texture_from_pixmap");
+            } else if( firstVisual && pAttributeTable[1] == NULL ) {
+                vi = firstVisual;
+                mbHasTFPVisual = false;
+                pChildSysData = lcl_createSystemWindow( vi, pPWindow, &pWindow );
+                SAL_INFO("slideshow.opengl", "did not find visual suitable for texture_from_pixmap, using " << vi->visualid);
             }
-#if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
-        }
+#else
+            pChildSysData = lcl_createSystemWindow( vi, pPWindow, &pWindow );
 #endif
+            if ( pChildSysData )
+                break;
         }
 
         ++pAttributeTable;
commit e24e04ccac73ab6aebc02647701cd9338bcb431b
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Aug 30 12:12:00 2012 +0200

    refactor the OGLTransitionerImpl init. a bit
    
    This removes some possible code paths that IMHO only added complexity
    and shaves some time off each presentation start (200--500 ms on this
    machine) by avoiding one call of GLInitSlides, which creates the
    textures.
    
    Change-Id: I0f66d138f14c86c87d6046276adc36072227c859

diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
index a1502e0..d747cc7 100644
--- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
@@ -172,10 +172,10 @@ int oglErrorHandler( unx::Display* /*dpy*/, unx::XErrorEvent* /*evnt*/ )
 class OGLTransitionerImpl : private cppu::BaseMutex, private boost::noncopyable, public OGLTransitionerImplBase
 {
 public:
-    explicit OGLTransitionerImpl(OGLTransitionImpl* pOGLTransition);
-    bool initWindowFromSlideShowView( const uno::Reference< presentation::XSlideShowView >& xView );
+    OGLTransitionerImpl();
     void setSlides( const Reference< rendering::XBitmap >& xLeavingSlide , const uno::Reference< rendering::XBitmap >& xEnteringSlide );
-    static bool initialize( const Reference< presentation::XSlideShowView >& xView );
+    void setTransition( OGLTransitionImpl* pOGLTransition );
+    bool initialize( const Reference< presentation::XSlideShowView >& xView );
 
     // XTransition
     virtual void SAL_CALL update( double nTime )
@@ -210,6 +210,9 @@ protected:
     const OGLFormat* chooseFormats();
 
 private:
+    static void impl_initializeOnce( bool const bGLXPresent );
+
+    bool initWindowFromSlideShowView( const uno::Reference< presentation::XSlideShowView >& xView );
     /** After the window has been created, and the slides have been set, we'll initialize the slides with OpenGL.
     */
     void GLInitSlides();
@@ -342,15 +345,21 @@ bool OGLTransitionerImpl::cbGLXPresent;
 
 bool OGLTransitionerImpl::initialize( const Reference< presentation::XSlideShowView >& xView )
 {
+
+    bool const bGLXPresent( initWindowFromSlideShowView( xView ) );
+    impl_initializeOnce( bGLXPresent );
+
+    return cbGLXPresent;
+}
+
+void OGLTransitionerImpl::impl_initializeOnce( bool const bGLXPresent )
+{
     // not thread safe
     static bool initialized = false;
 
     if( !initialized ) {
-        OGLTransitionerImpl *instance;
-
-        instance = new OGLTransitionerImpl( NULL );
-        if( instance->initWindowFromSlideShowView( xView ) ) {
-
+        cbGLXPresent = bGLXPresent;
+        if ( bGLXPresent ) {
             const GLubyte* version = glGetString( GL_VERSION );
             if( version && version[0] ) {
                 cnGLVersion = version[0] - '0';
@@ -367,16 +376,9 @@ bool OGLTransitionerImpl::initialize( const Reference< presentation::XSlideShowV
             /* TODO: check for version once the bug in fglrx driver is fixed */
             cbBrokenTexturesATI = (vendor && strcmp( (const char *) vendor, "ATI Technologies Inc." ) == 0 );
 
-            instance->disposing();
-            cbGLXPresent = true;
-        } else
-            cbGLXPresent = false;
-
-        delete instance;
+        }
         initialized = true;
     }
-
-    return cbGLXPresent;
 }
 
 bool OGLTransitionerImpl::createWindow( Window* pPWindow )
@@ -711,12 +713,6 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta
     glEnable(GL_LIGHT0);
     glEnable(GL_NORMALIZE);
 
-    if( LeavingBytes.hasElements() && EnteringBytes.hasElements())
-        GLInitSlides();//we already have uninitialized slides, let's initialize
-
-    if( pTransition && pTransition->mnRequiredGLVersion <= cnGLVersion )
-        pTransition->prepare( GLleavingSlide, GLenteringSlide );
-
     return true;
 }
 
@@ -855,6 +851,14 @@ void OGLTransitionerImpl::setSlides( const uno::Reference< rendering::XBitmap >&
 #endif
 }
 
+void OGLTransitionerImpl::setTransition( OGLTransitionImpl* const pNewTransition )
+{
+    pTransition = pNewTransition;
+
+    if( pTransition && pTransition->mnRequiredGLVersion <= cnGLVersion )
+        pTransition->prepare( GLleavingSlide, GLenteringSlide );
+}
+
 void OGLTransitionerImpl::createTexture( unsigned int* texID,
 #if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
                      unx::GLXPixmap pixmap,
@@ -1306,7 +1310,7 @@ void OGLTransitionerImpl::disposing()
     mxView.clear();
 }
 
-OGLTransitionerImpl::OGLTransitionerImpl(OGLTransitionImpl* pOGLTransition) :
+OGLTransitionerImpl::OGLTransitionerImpl() :
     OGLTransitionerImplBase(m_aMutex),
     GLWin(),
     GLleavingSlide( 0 ),
@@ -1320,7 +1324,7 @@ OGLTransitionerImpl::OGLTransitionerImpl(OGLTransitionImpl* pOGLTransition) :
     mbUseEnteringPixmap( false ),
     SlideBitmapLayout(),
     SlideSize(),
-    pTransition(pOGLTransition)
+    pTransition( 0 )
 {
 #if defined( WNT )
     GLWin.hWnd = 0;
@@ -1390,7 +1394,9 @@ public:
         if( !hasTransition( transitionType, transitionSubType ) )
             return uno::Reference< presentation::XTransition >();
 
-        bool bGLXPresent = OGLTransitionerImpl::initialize( view );
+        rtl::Reference< OGLTransitionerImpl > xRes( new OGLTransitionerImpl() );
+        if ( !xRes->initialize( view ) )
+            return uno::Reference< presentation::XTransition >();
 
         if( OGLTransitionerImpl::cbMesa && (
             ( transitionType == animations::TransitionType::FADE && transitionSubType == animations::TransitionSubType::CROSSFADE ) ||
@@ -1398,7 +1404,6 @@ public:
             ( transitionType == animations::TransitionType::IRISWIPE && transitionSubType == animations::TransitionSubType::DIAMOND ) ) )
             return uno::Reference< presentation::XTransition >();
 
-
         OGLTransitionImpl* pTransition = NULL;
 
         if( transitionType == animations::TransitionType::MISCSHAPEWIPE ) {
@@ -1462,13 +1467,11 @@ public:
             pTransition->makeNewsflash();
         }
 
-        rtl::Reference<OGLTransitionerImpl> xRes(
-            new OGLTransitionerImpl(pTransition) );
-        if( bGLXPresent ) {
-            if( !xRes->initWindowFromSlideShowView(view))
-                return uno::Reference< presentation::XTransition >();
-            xRes->setSlides(leavingBitmap,enteringBitmap);
-        }
+        if ( !pTransition )
+            return uno::Reference< presentation::XTransition >();
+
+        xRes->setTransition( pTransition );
+        xRes->setSlides(leavingBitmap,enteringBitmap);
 
         return uno::Reference<presentation::XTransition>(xRes.get());
     }
commit 1d5d8584a3bd312f58231dbc3e26684778637bb2
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Aug 30 09:51:58 2012 +0200

    shuffle #ifdefs around a bit
    
    Change-Id: I93b7c3796acf2da0ba28d3ae61aab4e15681683f

diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
index f25fea0..a1502e0 100644
--- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
@@ -469,8 +469,8 @@ bool OGLTransitionerImpl::createWindow( Window* pPWindow )
                                    GLWin.screen,
                                    *pAttributeTable );
 
-#if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
         if( vi ) {
+#if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
             if( !firstVisual )
                 firstVisual = vi;
             SAL_INFO("slideshow.opengl", "trying VisualID " << vi->visualid);
@@ -516,9 +516,7 @@ bool OGLTransitionerImpl::createWindow( Window* pPWindow )
                     vi = firstVisual;
                     mbHasTFPVisual = false;
                     SAL_INFO("slideshow.opengl", "did not find visual suitable for texture_from_pixmap, using " << vi->visualid);
-            }
-#else
-        if( vi ) {
+                }
 #endif
             SystemWindowData winData;
             winData.nSize = sizeof(winData);
@@ -531,10 +529,10 @@ bool OGLTransitionerImpl::createWindow( Window* pPWindow )
             } else {
                 delete pWindow, pWindow=NULL;
             }
-        }
 #if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
-    }
+        }
 #endif
+        }
 
         ++pAttributeTable;
     }
commit c0582db6f99e64e530e4b3097717b14180b64d6a
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Aug 30 09:43:27 2012 +0200

    more indentation fixes
    
    Change-Id: Ia4a3a2aede8240d98423dbf78da15b95e19bfa5b

diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
index 8db0a63..f25fea0 100644
--- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
@@ -406,7 +406,7 @@ bool OGLTransitionerImpl::createWindow( Window* pPWindow )
 #endif
     static int attrList3[] =
         {
-        GLX_RGBA,//only TrueColor or DirectColor
+            GLX_RGBA,//only TrueColor or DirectColor
             //single buffered
             GLX_RED_SIZE,4,//use the maximum red bits, with a minimum of 4 bits
             GLX_GREEN_SIZE,4,//use the maximum green bits, with a minimum of 4 bits
@@ -416,7 +416,7 @@ bool OGLTransitionerImpl::createWindow( Window* pPWindow )
         };
     static int attrList2[] =
     {
-        GLX_RGBA,//only TrueColor or DirectColor
+            GLX_RGBA,//only TrueColor or DirectColor
             /// single buffered
             GLX_RED_SIZE,4,/// use the maximum red bits, with a minimum of 4 bits
             GLX_GREEN_SIZE,4,/// use the maximum green bits, with a minimum of 4 bits
@@ -426,7 +426,7 @@ bool OGLTransitionerImpl::createWindow( Window* pPWindow )
         };
     static int attrList1[] =
         {
-        GLX_RGBA,//only TrueColor or DirectColor
+            GLX_RGBA,//only TrueColor or DirectColor
             GLX_DOUBLEBUFFER,/// only double buffer
             GLX_RED_SIZE,4,/// use the maximum red bits, with a minimum of 4 bits
             GLX_GREEN_SIZE,4,/// use the maximum green bits, with a minimum of 4 bits
@@ -436,7 +436,7 @@ bool OGLTransitionerImpl::createWindow( Window* pPWindow )
         };
     static int attrList0[] =
         {
-        GLX_RGBA,//only TrueColor or DirectColor
+            GLX_RGBA,//only TrueColor or DirectColor
             GLX_DOUBLEBUFFER,/// only double buffer
             GLX_RED_SIZE,4,/// use the maximum red bits, with a minimum of 4 bits
             GLX_GREEN_SIZE,4,/// use the maximum green bits, with a minimum of 4 bits
@@ -470,91 +470,91 @@ bool OGLTransitionerImpl::createWindow( Window* pPWindow )
                                    *pAttributeTable );
 
 #if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
-      if( vi ) {
-      if( !firstVisual )
-          firstVisual = vi;
-      SAL_INFO("slideshow.opengl", "trying VisualID " << vi->visualid);
-          fbconfigs = glXGetFBConfigs (GLWin.dpy, GLWin.screen, &nfbconfigs);
-          for ( ; i < nfbconfigs; i++)
-          {
-              visinfo = glXGetVisualFromFBConfig (GLWin.dpy, fbconfigs[i]);
-              if( !visinfo || visinfo->visualid != vi->visualid )
-                  continue;
-
-              glXGetFBConfigAttrib (GLWin.dpy, fbconfigs[i], GLX_DRAWABLE_TYPE, &value);
-              if (!(value & GLX_PIXMAP_BIT))
-                  continue;
-
-              glXGetFBConfigAttrib (GLWin.dpy, fbconfigs[i],
-                                    GLX_BIND_TO_TEXTURE_TARGETS_EXT,
-                                    &value);
-              if (!(value & GLX_TEXTURE_2D_BIT_EXT))
-                  continue;
-
-              glXGetFBConfigAttrib (GLWin.dpy, fbconfigs[i],
-                                    GLX_BIND_TO_TEXTURE_RGB_EXT,
-                                    &value);
-              if (value == sal_False)
-                  continue;
-
-              glXGetFBConfigAttrib (GLWin.dpy, fbconfigs[i],
-                                    GLX_BIND_TO_MIPMAP_TEXTURE_EXT,
-                                    &value);
-              if (value == sal_False)
-                  continue;
-
-              /* TODO: handle non Y inverted cases */
-              break;
-          }
-
-          if( i != nfbconfigs || ( firstVisual && pAttributeTable[1] == NULL ) ) {
-          if( i != nfbconfigs ) {
-          vi = glXGetVisualFromFBConfig( GLWin.dpy, fbconfigs[i] );
-          mbHasTFPVisual = true;
-          SAL_INFO("slideshow.opengl", "found visual suitable for texture_from_pixmap");
-          } else {
-          vi = firstVisual;
-          mbHasTFPVisual = false;
-          SAL_INFO("slideshow.opengl", "did not find visual suitable for texture_from_pixmap, using " << vi->visualid);
-          }
+        if( vi ) {
+            if( !firstVisual )
+                firstVisual = vi;
+            SAL_INFO("slideshow.opengl", "trying VisualID " << vi->visualid);
+            fbconfigs = glXGetFBConfigs (GLWin.dpy, GLWin.screen, &nfbconfigs);
+            for ( ; i < nfbconfigs; i++)
+            {
+                visinfo = glXGetVisualFromFBConfig (GLWin.dpy, fbconfigs[i]);
+                if( !visinfo || visinfo->visualid != vi->visualid )
+                    continue;
+
+                glXGetFBConfigAttrib (GLWin.dpy, fbconfigs[i], GLX_DRAWABLE_TYPE, &value);
+                if (!(value & GLX_PIXMAP_BIT))
+                    continue;
+
+                glXGetFBConfigAttrib (GLWin.dpy, fbconfigs[i],
+                                        GLX_BIND_TO_TEXTURE_TARGETS_EXT,
+                                        &value);
+                if (!(value & GLX_TEXTURE_2D_BIT_EXT))
+                    continue;
+
+                glXGetFBConfigAttrib (GLWin.dpy, fbconfigs[i],
+                                        GLX_BIND_TO_TEXTURE_RGB_EXT,
+                                        &value);
+                if (value == sal_False)
+                    continue;
+
+                glXGetFBConfigAttrib (GLWin.dpy, fbconfigs[i],
+                                        GLX_BIND_TO_MIPMAP_TEXTURE_EXT,
+                                        &value);
+                if (value == sal_False)
+                    continue;
+
+                /* TODO: handle non Y inverted cases */
+                break;
+            }
+
+            if( i != nfbconfigs || ( firstVisual && pAttributeTable[1] == NULL ) ) {
+                if( i != nfbconfigs ) {
+                    vi = glXGetVisualFromFBConfig( GLWin.dpy, fbconfigs[i] );
+                    mbHasTFPVisual = true;
+                    SAL_INFO("slideshow.opengl", "found visual suitable for texture_from_pixmap");
+                } else {
+                    vi = firstVisual;
+                    mbHasTFPVisual = false;
+                    SAL_INFO("slideshow.opengl", "did not find visual suitable for texture_from_pixmap, using " << vi->visualid);
+            }
 #else
-      if( vi ) {
+        if( vi ) {
 #endif
-              SystemWindowData winData;
-              winData.nSize = sizeof(winData);
-          SAL_INFO("slideshow.opengl", "using VisualID " << vi->visualid);
-              winData.pVisual = (void*)(vi->visual);
-              pWindow=new SystemChildWindow(pPWindow, 0, &winData, sal_False);
-              pChildSysData = pWindow->GetSystemData();
-              if( pChildSysData ) {
-                  break;
-              } else {
-                  delete pWindow, pWindow=NULL;
-              }
-          }
+            SystemWindowData winData;
+            winData.nSize = sizeof(winData);
+            SAL_INFO("slideshow.opengl", "using VisualID " << vi->visualid);
+            winData.pVisual = (void*)(vi->visual);
+            pWindow=new SystemChildWindow(pPWindow, 0, &winData, sal_False);
+            pChildSysData = pWindow->GetSystemData();
+            if( pChildSysData ) {
+                break;
+            } else {
+                delete pWindow, pWindow=NULL;
+            }
+        }
 #if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
-      }
+    }
 #endif
 
         ++pAttributeTable;
-      }
+    }
 #endif
 
 #if defined( WNT )
-      SystemWindowData winData;
-      winData.nSize = sizeof(winData);
-      pWindow=new SystemChildWindow(pPWindow, 0, &winData, sal_False);
-      pWindow->GetSystemData();
+    SystemWindowData winData;
+    winData.nSize = sizeof(winData);
+    pWindow=new SystemChildWindow(pPWindow, 0, &winData, sal_False);
+    pWindow->GetSystemData();
 #endif
 
-      if( pWindow )
-      {
-      pWindow->SetMouseTransparent( sal_True );
-      pWindow->SetParentClipMode( PARENTCLIPMODE_NOCLIP );
-      pWindow->EnableEraseBackground( sal_False );
-      pWindow->SetControlForeground();
-      pWindow->SetControlBackground();
-      pWindow->EnablePaint(sal_False);
+    if( pWindow )
+    {
+        pWindow->SetMouseTransparent( sal_True );
+        pWindow->SetParentClipMode( PARENTCLIPMODE_NOCLIP );
+        pWindow->EnableEraseBackground( sal_False );
+        pWindow->SetControlForeground();
+        pWindow->SetControlBackground();
+        pWindow->EnablePaint(sal_False);
 #if defined( WNT )
         GLWin.hWnd = sysData->hWnd;
 #elif defined( UNX )
@@ -564,12 +564,12 @@ bool OGLTransitionerImpl::createWindow( Window* pPWindow )
     if( mbHasTFPVisual )
         GLWin.fbc = fbconfigs[i];
 #endif
-    GLWin.vi = vi;
-    GLWin.GLXExtensions = unx::glXQueryExtensionsString( GLWin.dpy, GLWin.screen );
-    SAL_INFO("slideshow.opengl", "available GLX extensions: " << GLWin.GLXExtensions);
+        GLWin.vi = vi;
+        GLWin.GLXExtensions = unx::glXQueryExtensionsString( GLWin.dpy, GLWin.screen );
+        SAL_INFO("slideshow.opengl", "available GLX extensions: " << GLWin.GLXExtensions);
 #endif
 
-    return true;
+        return true;
     }
 
     return false;
@@ -584,7 +584,7 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta
 
     mxView.set( xView, UNO_QUERY );
     if( !mxView.is() )
-    return false;
+        return false;
 
 #if OSL_DEBUG_LEVEL > 1
     TimerContext aTimerContext("initWindowFromSlideShowView");
@@ -601,7 +601,7 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta
     sal_Int64 aVal = 0;
     aDeviceParams[1] >>= aVal;
     if( !createWindow( reinterpret_cast< Window* >( aVal ) ) )
-    return false;
+        return false;
 
     awt::Rectangle aCanvasArea = mxView->getCanvasArea();
     pWindow->SetPosSizePixel(aCanvasArea.X, aCanvasArea.Y, aCanvasArea.Width, aCanvasArea.Height);
@@ -610,15 +610,15 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta
     SAL_INFO("slideshow.opengl", "canvas area: " << aCanvasArea.X << "," << aCanvasArea.Y << " - " << aCanvasArea.Width << "x" << aCanvasArea.Height);
 
 #if defined( WNT )
-        GLWin.hDC = GetDC(GLWin.hWnd);
+    GLWin.hDC = GetDC(GLWin.hWnd);
 #elif defined( UNX )
     GLWin.ctx = glXCreateContext(GLWin.dpy,
                                  GLWin.vi,
                                  0,
                                  GL_TRUE);
     if( GLWin.ctx == NULL ) {
-    SAL_INFO("slideshow.opengl", "unable to create GLX context");
-    return false;
+        SAL_INFO("slideshow.opengl", "unable to create GLX context");
+        return false;
     }
 #endif
 
@@ -657,7 +657,7 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta
     int glxMinor, glxMajor;
     mnGLXVersion = 0;
     if( glXQueryVersion( GLWin.dpy, &glxMajor, &glxMinor ) )
-      mnGLXVersion = glxMajor + 0.1*glxMinor;
+        mnGLXVersion = glxMajor + 0.1*glxMinor;
     SAL_INFO("slideshow.opengl", "available GLX version: " << mnGLXVersion);
 
     GLWin.GLExtensions = glGetString( GL_EXTENSIONS );
@@ -671,26 +671,26 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta
         typedef GLint (*glXSwapIntervalProc)(GLint);
         glXSwapIntervalProc glXSwapInterval = (glXSwapIntervalProc) unx::glXGetProcAddress( (const GLubyte*) "glXSwapIntervalSGI" );
         if( glXSwapInterval ) {
-        int (*oldHandler)(unx::Display* /*dpy*/, unx::XErrorEvent* /*evnt*/);
+            int (*oldHandler)(unx::Display* /*dpy*/, unx::XErrorEvent* /*evnt*/);
 
-        // replace error handler temporarily
-        oldHandler = unx::XSetErrorHandler( oglErrorHandler );
+            // replace error handler temporarily
+            oldHandler = unx::XSetErrorHandler( oglErrorHandler );
 
-        errorTriggered = false;
+            errorTriggered = false;
 
-        glXSwapInterval( 1 );
+            glXSwapInterval( 1 );
 
-        // sync so that we possibly get an XError
-        unx::glXWaitGL();
-        XSync(GLWin.dpy, false);
+            // sync so that we possibly get an XError
+            unx::glXWaitGL();
+            XSync(GLWin.dpy, false);
 
-        if( errorTriggered )
-            SAL_INFO("slideshow.opengl", "error when trying to set swap interval, NVIDIA or Mesa bug?");
-        else
-            SAL_INFO("slideshow.opengl", "set swap interval to 1 (enable vsync)");
+            if( errorTriggered )
+                SAL_INFO("slideshow.opengl", "error when trying to set swap interval, NVIDIA or Mesa bug?");
+            else
+                SAL_INFO("slideshow.opengl", "set swap interval to 1 (enable vsync)");
 
-        // restore the error handler
-        unx::XSetErrorHandler( oldHandler );
+            // restore the error handler
+            unx::XSetErrorHandler( oldHandler );
         }
     }
 #endif
@@ -714,7 +714,7 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta
     glEnable(GL_NORMALIZE);
 
     if( LeavingBytes.hasElements() && EnteringBytes.hasElements())
-       GLInitSlides();//we already have uninitialized slides, let's initialize
+        GLInitSlides();//we already have uninitialized slides, let's initialize
 
     if( pTransition && pTransition->mnRequiredGLVersion <= cnGLVersion )
         pTransition->prepare( GLleavingSlide, GLenteringSlide );
@@ -876,17 +876,17 @@ void OGLTransitionerImpl::createTexture( unsigned int* texID,
     unx::PFNGLXBINDTEXIMAGEEXTPROC myglXBindTexImageEXT = (unx::PFNGLXBINDTEXIMAGEEXTPROC) unx::glXGetProcAddress( (const GLubyte*) "glXBindTexImageEXT" );
 
     if( usePixmap ) {
-      if( mbGenerateMipmap )
-          glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, True);
-      myglXBindTexImageEXT (GLWin.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);
-          glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR); //TRILINEAR FILTERING
-      } else {
-          glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
-          glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
-      }
+        if( mbGenerateMipmap )
+            glTexParameteri( GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, True);
+        myglXBindTexImageEXT (GLWin.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);
+            glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR); //TRILINEAR FILTERING
+        } else {
+            glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
+            glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
+        }
     } else {
 #endif
     if( !pFormat )
@@ -903,28 +903,28 @@ void OGLTransitionerImpl::createTexture( unsigned int* texID,
                           GL_RGBA,
                           GL_UNSIGNED_BYTE,
                           &tempBytes[0]);
-    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
-    glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR); //TRILINEAR FILTERING
-
-        //anistropic filtering (to make texturing not suck when looking at polygons from oblique angles)
-    GLfloat largest_supported_anisotropy;
-    glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy);
-    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, largest_supported_anisotropy);
-    } else {
-    if( pTransition && !cbBrokenTexturesATI && !useMipmap) {
-        glTexImage2D( GL_TEXTURE_2D, 0, pFormat->nInternalFormat, SlideSize.Width, SlideSize.Height, 0, pFormat->eFormat, pFormat->eType, &data[0] );
-        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
-        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
-    } else {
-        gluBuild2DMipmaps( GL_TEXTURE_2D, pFormat->nInternalFormat, SlideSize.Width, SlideSize.Height, pFormat->eFormat, pFormat->eType, &data[0] );
-        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
-        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR ); //TRILINEAR FILTERING
+        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
+        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_LINEAR); //TRILINEAR FILTERING
 
-        //anistropic filtering (to make texturing not suck when looking at polygons from oblique angles)
+            //anistropic filtering (to make texturing not suck when looking at polygons from oblique angles)
         GLfloat largest_supported_anisotropy;
-        glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy );
-        glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, largest_supported_anisotropy );
-    }
+        glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy);
+        glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, largest_supported_anisotropy);
+    } else {
+        if( pTransition && !cbBrokenTexturesATI && !useMipmap) {
+            glTexImage2D( GL_TEXTURE_2D, 0, pFormat->nInternalFormat, SlideSize.Width, SlideSize.Height, 0, pFormat->eFormat, pFormat->eType, &data[0] );
+            glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);
+            glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
+        } else {
+            gluBuild2DMipmaps( GL_TEXTURE_2D, pFormat->nInternalFormat, SlideSize.Width, SlideSize.Height, pFormat->eFormat, pFormat->eType, &data[0] );
+            glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+            glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR ); //TRILINEAR FILTERING
+
+            //anistropic filtering (to make texturing not suck when looking at polygons from oblique angles)
+            GLfloat largest_supported_anisotropy;
+            glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy );
+            glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, largest_supported_anisotropy );
+        }
     }
 #if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
     }
@@ -1093,7 +1093,7 @@ void OGLTransitionerImpl::GLInitSlides()
 
     const OGLFormat* pFormat = NULL;
     if( !mbUseLeavingPixmap || !mbUseEnteringPixmap )
-    pFormat = chooseFormats();
+        pFormat = chooseFormats();
 
     createTexture( &GLleavingSlide,
 #if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
@@ -1125,8 +1125,8 @@ void SAL_CALL OGLTransitionerImpl::update( double nTime ) throw (uno::RuntimeExc
     mnFrameCount ++;
     maUpdateStartTime = microsec_clock::local_time();
     if( mnFrameCount == 1 ) {
-    maStartTime = maUpdateStartTime;
-    maTotalUpdateDuration = seconds (0);
+        maStartTime = maUpdateStartTime;
+        maTotalUpdateDuration = seconds (0);
     }
 #endif
     osl::MutexGuard const guard( m_aMutex );
@@ -1145,7 +1145,7 @@ void SAL_CALL OGLTransitionerImpl::update( double nTime ) throw (uno::RuntimeExc
     glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
     if(pTransition)
-    pTransition->display( nTime, GLleavingSlide, GLenteringSlide,
+        pTransition->display( nTime, GLleavingSlide, GLenteringSlide,
                               SlideSize.Width, SlideSize.Height,
                               static_cast<double>(GLWin.Width),
                               static_cast<double>(GLWin.Height) );
@@ -1192,25 +1192,25 @@ void OGLTransitionerImpl::disposeContextAndWindow()
 #if defined( WNT )
     if (GLWin.hRC)
     {
-    wglMakeCurrent( GLWin.hDC, 0 );     // kill Device Context
-    wglDeleteContext( GLWin.hRC );      // Kill Render Context
-    ReleaseDC( GLWin.hWnd, GLWin.hDC );         // Release Window
+        wglMakeCurrent( GLWin.hDC, 0 );     // kill Device Context
+        wglDeleteContext( GLWin.hRC );      // Kill Render Context
+        ReleaseDC( GLWin.hWnd, GLWin.hDC );         // Release Window
     }
 #elif defined( UNX )
     if(GLWin.ctx)
     {
-    glXMakeCurrent(GLWin.dpy, None, NULL);
-    if( glGetError() != GL_NO_ERROR ) {
-        SAL_INFO("slideshow.opengl", "glError: " << (char *)gluErrorString(glGetError()));
-    }
-    glXDestroyContext(GLWin.dpy, GLWin.ctx);
-    GLWin.ctx = NULL;
+        glXMakeCurrent(GLWin.dpy, None, NULL);
+        if( glGetError() != GL_NO_ERROR ) {
+            SAL_INFO("slideshow.opengl", "glError: " << (char *)gluErrorString(glGetError()));
+        }
+        glXDestroyContext(GLWin.dpy, GLWin.ctx);
+        GLWin.ctx = NULL;
     }
 #endif
     if( pWindow ) {
-    delete pWindow;
-    pWindow = NULL;
-    GLWin.win = 0;
+        delete pWindow;
+        pWindow = NULL;
+        GLWin.win = 0;
     }
 }
 
@@ -1226,35 +1226,34 @@ void OGLTransitionerImpl::disposeTextures()
 #if defined( GLX_VERSION_1_3 ) && defined( GLX_EXT_texture_from_pixmap )
     unx::PFNGLXRELEASETEXIMAGEEXTPROC myglXReleaseTexImageEXT = (unx::PFNGLXRELEASETEXIMAGEEXTPROC) unx::glXGetProcAddress( (const GLubyte*) "glXReleaseTexImageEXT" );
     if( mbUseLeavingPixmap ) {
-
-    myglXReleaseTexImageEXT( GLWin.dpy, LeavingPixmap, GLX_FRONT_LEFT_EXT );
-    glXDestroyGLXPixmap( GLWin.dpy, LeavingPixmap );
-    LeavingPixmap = 0;
-    if( mbFreeLeavingPixmap ) {
-        unx::XFreePixmap( GLWin.dpy, maLeavingPixmap );
-        mbFreeLeavingPixmap = false;
-        maLeavingPixmap = 0;
-    }
+        myglXReleaseTexImageEXT( GLWin.dpy, LeavingPixmap, GLX_FRONT_LEFT_EXT );
+        glXDestroyGLXPixmap( GLWin.dpy, LeavingPixmap );
+        LeavingPixmap = 0;
+        if( mbFreeLeavingPixmap ) {
+            unx::XFreePixmap( GLWin.dpy, maLeavingPixmap );
+            mbFreeLeavingPixmap = false;
+            maLeavingPixmap = 0;
+        }
     }
     if( mbUseEnteringPixmap ) {
-    myglXReleaseTexImageEXT( GLWin.dpy, EnteringPixmap, GLX_FRONT_LEFT_EXT );
-    glXDestroyGLXPixmap( GLWin.dpy, EnteringPixmap );
-    EnteringPixmap = 0;
-    if( mbFreeEnteringPixmap ) {
-        unx::XFreePixmap( GLWin.dpy, maEnteringPixmap );
-        mbFreeEnteringPixmap = false;
-        maEnteringPixmap = 0;
-    }
+        myglXReleaseTexImageEXT( GLWin.dpy, EnteringPixmap, GLX_FRONT_LEFT_EXT );
+        glXDestroyGLXPixmap( GLWin.dpy, EnteringPixmap );
+        EnteringPixmap = 0;
+        if( mbFreeEnteringPixmap ) {
+            unx::XFreePixmap( GLWin.dpy, maEnteringPixmap );
+            mbFreeEnteringPixmap = false;
+            maEnteringPixmap = 0;
+        }
     }
 #endif
 
     if( !mbUseLeavingPixmap ) {
-    glDeleteTextures(1,&GLleavingSlide);
-    GLleavingSlide = 0;
+        glDeleteTextures(1,&GLleavingSlide);
+        GLleavingSlide = 0;
     }
     if( !mbUseEnteringPixmap ) {
-    glDeleteTextures(1,&GLenteringSlide);
-    GLleavingSlide = 0;
+        glDeleteTextures(1,&GLenteringSlide);
+        GLleavingSlide = 0;
     }
 
     mbUseLeavingPixmap = false;
@@ -1269,41 +1268,40 @@ void OGLTransitionerImpl::disposing()
 #if OSL_DEBUG_LEVEL > 1
     SAL_INFO("slideshow.opengl", "dispose " << this);
     if( mnFrameCount ) {
-    maEndTime = microsec_clock::local_time();
-    time_duration duration = maEndTime - maStartTime;
-    SAL_INFO("slideshow.opengl",
-            "whole transition (frames: " << mnFrameCount
-            << ") took: " << duration
-            << " fps: "
-            << (((double)mnFrameCount*1000000000.0)/duration.total_nanoseconds())
-            << " time spent in updates: " << maTotalUpdateDuration
-            << " percentage of transition time: "
-            << (100*(((double)maTotalUpdateDuration.total_nanoseconds())/((double)duration.total_nanoseconds())))
-            << '%'
-        );
+        maEndTime = microsec_clock::local_time();
+        time_duration duration = maEndTime - maStartTime;
+        SAL_INFO("slideshow.opengl",
+                "whole transition (frames: " << mnFrameCount
+                << ") took: " << duration
+                << " fps: "
+                << (((double)mnFrameCount*1000000000.0)/duration.total_nanoseconds())
+                << " time spent in updates: " << maTotalUpdateDuration
+                << " percentage of transition time: "
+                << (100*(((double)maTotalUpdateDuration.total_nanoseconds())/((double)duration.total_nanoseconds())))
+                << '%'
+            );
     }
 #endif
 
     if( pWindow ) {
+        disposeTextures();
 
-    disposeTextures();
-
-    if (pTransition)
-        pTransition->finish();
+        if (pTransition)
+            pTransition->finish();
 
 #ifdef UNX
-    if( mbRestoreSync ) {
-        // try to reestablish synchronize state
-        char* sal_synchronize = getenv("SAL_SYNCHRONIZE");
-        XSynchronize( GLWin.dpy, sal_synchronize && *sal_synchronize == '1' );
-    }
+        if( mbRestoreSync ) {
+            // try to reestablish synchronize state
+            char* sal_synchronize = getenv("SAL_SYNCHRONIZE");
+            XSynchronize( GLWin.dpy, sal_synchronize && *sal_synchronize == '1' );
+        }
 #endif
 
-    disposeContextAndWindow();
+        disposeContextAndWindow();
     }
 
     if (pTransition)
-    delete pTransition;
+        delete pTransition;
 
     mxLeavingBitmap.clear();
     mxEnteringBitmap.clear();
@@ -1351,7 +1349,7 @@ public:
     {
         if( transitionType == animations::TransitionType::MISCSHAPEWIPE ) {
             switch( transitionSubType )
-                {
+            {
                 case animations::TransitionSubType::ACROSS:
                 case animations::TransitionSubType::CORNERSOUT:
                 case animations::TransitionSubType::CIRCLE:
@@ -1370,7 +1368,7 @@ public:
 
                 default:
                     return sal_False;
-                }
+            }
         } else if( transitionType == animations::TransitionType::FADE && transitionSubType == animations::TransitionSubType::CROSSFADE ) {
             return sal_True;
         } else if( transitionType == animations::TransitionType::FADE && transitionSubType == animations::TransitionSubType::FADEOVERCOLOR ) {
commit 07bb32fdcb7cf58a1a5eb5d2f0c6318c8d6f8ca6
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Aug 30 09:28:22 2012 +0200

    drop useless nested anonymous namespace
    
    Change-Id: I0876e253b69fa4ec8262946339bb643aa43f3bad

diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
index 2c2aac0..8db0a63 100644
--- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
@@ -117,46 +117,43 @@ private:
 };
 #endif
 
-namespace
+struct OGLFormat
+{
+    GLint  nInternalFormat;
+    GLenum eFormat;
+    GLenum eType;
+};
+
+/* channel ordering: (0:rgba, 1:bgra, 2:argb, 3:abgr)
+ */
+int calcComponentOrderIndex(const uno::Sequence<sal_Int8>& rTags)
 {
-    struct OGLFormat
+    using namespace rendering::ColorComponentTag;
+
+    static const sal_Int8 aOrderTable[] =
     {
-        GLint  nInternalFormat;
-        GLenum eFormat;
-        GLenum eType;
+        RGB_RED, RGB_GREEN, RGB_BLUE, ALPHA,
+        RGB_BLUE, RGB_GREEN, RGB_RED, ALPHA,
+        ALPHA, RGB_RED, RGB_GREEN, RGB_BLUE,
+        ALPHA, RGB_BLUE, RGB_GREEN, RGB_RED,
     };
 
-    /* channel ordering: (0:rgba, 1:bgra, 2:argb, 3:abgr)
-    */
-    int calcComponentOrderIndex(const uno::Sequence<sal_Int8>& rTags)
+    const sal_Int32 nNumComps(rTags.getLength());
+    const sal_Int8* pLine=aOrderTable;
+    for(int i=0; i<4; ++i)
     {
-        using namespace rendering::ColorComponentTag;
-
-        static const sal_Int8 aOrderTable[] =
-        {
-            RGB_RED, RGB_GREEN, RGB_BLUE, ALPHA,
-            RGB_BLUE, RGB_GREEN, RGB_RED, ALPHA,
-            ALPHA, RGB_RED, RGB_GREEN, RGB_BLUE,
-            ALPHA, RGB_BLUE, RGB_GREEN, RGB_RED,
-        };
-
-        const sal_Int32 nNumComps(rTags.getLength());
-        const sal_Int8* pLine=aOrderTable;
-        for(int i=0; i<4; ++i)
-        {
-            int j=0;
-            while( j<4 && j<nNumComps && pLine[j] == rTags[j] )
-                ++j;
+        int j=0;
+        while( j<4 && j<nNumComps && pLine[j] == rTags[j] )
+            ++j;
 
-            // all of the line passed, this is a match!
-            if( j==nNumComps )
-                return i;
+        // all of the line passed, this is a match!
+        if( j==nNumComps )
+            return i;
 
-            pLine+=4;
-        }
-
-        return -1;
+        pLine+=4;
     }
+
+    return -1;
 }
 
 // not thread safe
commit 9a6544bc9fd7be64b373c622ca2dbd54fbe0746d
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Aug 30 09:27:28 2012 +0200

    add more timing code
    
    Change-Id: I481e1acfee06e56932bf7ba7bbe7f89f35ff0435

diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
index a2dd1de..2c2aac0 100644
--- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
@@ -589,6 +589,10 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< presenta
     if( !mxView.is() )
     return false;
 
+#if OSL_DEBUG_LEVEL > 1
+    TimerContext aTimerContext("initWindowFromSlideShowView");
+#endif
+
     /// take the XSlideShowView and extract the parent window from it. see viewmediashape.cxx
     uno::Reference< rendering::XCanvas > xCanvas(mxView->getCanvas(), uno::UNO_QUERY_THROW);
     uno::Sequence< uno::Any > aDeviceParams;
commit 38b70b169ce132eadef9fc3bcb5acd9171ea84fe
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Aug 30 09:04:19 2012 +0200

    simplify time profiling
    
    Change-Id: Ib5976cd3e0c6e3b90fc62fe8336317f259dd544b

diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
index ee8e006..a2dd1de 100644
--- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
@@ -82,9 +82,6 @@ namespace unx
 #include <boost/date_time/posix_time/posix_time.hpp>
 using namespace ::boost::posix_time;
 
-static ptime t1;
-static ptime t2;
-
 #endif
 
 using namespace ::com::sun::star;
@@ -100,6 +97,26 @@ namespace
 
 typedef cppu::WeakComponentImplHelper1<presentation::XTransition> OGLTransitionerImplBase;
 
+#if OSL_DEBUG_LEVEL > 1
+class TimerContext
+{
+public:
+    explicit TimerContext(rtl::OUString const& rWhat)
+        : m_aWhat(rWhat)
+        , m_aStartTime(microsec_clock::local_time())
+    {
+    }
+    ~TimerContext()
+    {
+        time_duration const aDuration(microsec_clock::local_time() - m_aStartTime);
+        SAL_INFO("slideshow.opengl", m_aWhat << " took: " << aDuration);
+    }
+private:
+    rtl::OUString const m_aWhat;
+    ptime const m_aStartTime;
+};
+#endif
+
 namespace
 {
     struct OGLFormat
@@ -733,10 +750,6 @@ void OGLTransitionerImpl::setSlides( const uno::Reference< rendering::XBitmap >&
     XSync(GLWin.dpy, false);
 #endif
 
-#if OSL_DEBUG_LEVEL > 1
-    t1 = microsec_clock::local_time();
-#endif
-
     mbUseLeavingPixmap = false;
     mbUseEnteringPixmap = false;
 
@@ -1071,6 +1084,10 @@ void OGLTransitionerImpl::GLInitSlides()
     if (isDisposed() || pTransition->mnRequiredGLVersion > cnGLVersion)
         return;
 
+#if OSL_DEBUG_LEVEL > 1
+    TimerContext aTimerContext("texture creation");
+#endif
+
     prepareEnvironment();
 
     const OGLFormat* pFormat = NULL;
@@ -1099,11 +1116,6 @@ void OGLTransitionerImpl::GLInitSlides()
     unx::glXWaitGL();
     XSync(GLWin.dpy, false);
 #endif
-
-#if OSL_DEBUG_LEVEL > 1
-    t2 = microsec_clock::local_time();
-    SAL_INFO("slideshow.opengl", "textures created in: " << ( t2 - t1 ));
-#endif
 }
 
 void SAL_CALL OGLTransitionerImpl::update( double nTime ) throw (uno::RuntimeException)
commit 7a545ea8bdcb7615a12a6601c9145ef55be3fce5
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Aug 30 08:39:48 2012 +0200

    use meaningful names for debugging variables
    
    Change-Id: I50918435903a053ce99487c6ad48d45552358cd2

diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
index 2c9bd5e..ee8e006 100644
--- a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx
@@ -311,12 +311,12 @@ public:
     bool mbHasTFPVisual;
 
 #if OSL_DEBUG_LEVEL > 1
-    ptime t3;
-    ptime t4;
-    ptime t5;
-    ptime t6;
-    time_duration total_update;
-    int frame_count;
+    ptime maUpdateStartTime;
+    ptime maUpdateEndTime;
+    ptime maStartTime;
+    ptime maEndTime;
+    time_duration maTotalUpdateDuration;
+    int mnFrameCount;
 #endif
 };
 
@@ -1109,11 +1109,11 @@ void OGLTransitionerImpl::GLInitSlides()
 void SAL_CALL OGLTransitionerImpl::update( double nTime ) throw (uno::RuntimeException)
 {
 #if OSL_DEBUG_LEVEL > 1
-    frame_count ++;
-    t3 = microsec_clock::local_time();
-    if( frame_count == 1 ) {
-    t5 = t3;
-    total_update = seconds (0);
+    mnFrameCount ++;
+    maUpdateStartTime = microsec_clock::local_time();
+    if( mnFrameCount == 1 ) {
+    maStartTime = maUpdateStartTime;
+    maTotalUpdateDuration = seconds (0);
     }
 #endif
     osl::MutexGuard const guard( m_aMutex );
@@ -1152,11 +1152,11 @@ void SAL_CALL OGLTransitionerImpl::update( double nTime ) throw (uno::RuntimeExc
 #endif
 
 #if OSL_DEBUG_LEVEL > 1
-    t4 = microsec_clock::local_time();
+    maUpdateEndTime = microsec_clock::local_time();
 
     SAL_INFO("slideshow.opengl", "update time: " << nTime);
-    SAL_INFO("slideshow.opengl", "update took: " << ( t4 - t3 ));
-    total_update += (t4 - t3);
+    SAL_INFO("slideshow.opengl", "update took: " << ( maUpdateEndTime - maUpdateStartTime ));
+    maTotalUpdateDuration += (maUpdateEndTime - maUpdateStartTime);
 #endif
 }
 
@@ -1255,17 +1255,17 @@ void OGLTransitionerImpl::disposing()
 
 #if OSL_DEBUG_LEVEL > 1
     SAL_INFO("slideshow.opengl", "dispose " << this);
-    if( frame_count ) {
-    t6 = microsec_clock::local_time();
-    time_duration duration = t6 - t5;
+    if( mnFrameCount ) {
+    maEndTime = microsec_clock::local_time();
+    time_duration duration = maEndTime - maStartTime;
     SAL_INFO("slideshow.opengl",
-            "whole transition (frames: " << frame_count
+            "whole transition (frames: " << mnFrameCount
             << ") took: " << duration
             << " fps: "
-            << (((double)frame_count*1000000000.0)/duration.total_nanoseconds())
-            << " time spent in updates: " << total_update
+            << (((double)mnFrameCount*1000000000.0)/duration.total_nanoseconds())
+            << " time spent in updates: " << maTotalUpdateDuration
             << " percentage of transition time: "
-            << (100*(((double)total_update.total_nanoseconds())/((double)duration.total_nanoseconds())))
+            << (100*(((double)maTotalUpdateDuration.total_nanoseconds())/((double)duration.total_nanoseconds())))
             << '%'
         );
     }
@@ -1320,7 +1320,7 @@ OGLTransitionerImpl::OGLTransitionerImpl(OGLTransitionImpl* pOGLTransition) :
 #endif
 
 #if OSL_DEBUG_LEVEL > 1
-    frame_count = 0;
+    mnFrameCount = 0;
 #endif
 }
 


More information about the Libreoffice-commits mailing list