ooo-build r13865 - in branches/ooo-build-3-0: . patches/dev300



Author: rodo
Date: Wed Sep 10 09:48:40 2008
New Revision: 13865
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13865&view=rev

Log:
2008-09-09  Radek Doulik  <rodo novell>

        * patches/dev300/apply: added transogl-debug-time.diff, changes
        described below

        * build/ooo300-m4/slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx:
        added measuring time per update, per transition and reporting
        numbers as fps, ...



Added:
   branches/ooo-build-3-0/patches/dev300/transogl-debug-time.diff
Modified:
   branches/ooo-build-3-0/ChangeLog
   branches/ooo-build-3-0/patches/dev300/apply

Modified: branches/ooo-build-3-0/patches/dev300/apply
==============================================================================
--- branches/ooo-build-3-0/patches/dev300/apply	(original)
+++ branches/ooo-build-3-0/patches/dev300/apply	Wed Sep 10 09:48:40 2008
@@ -1828,6 +1828,7 @@
 transogl-fix-dual-head.diff
 transogl-buildfix-pixmap-ext.diff
 transogl-fix-presenter-view.diff
+transogl-debug-time.diff
 
 [ Experimental ]
 # sal_uInt32 -> sal_uIntPtr for events on some places

Added: branches/ooo-build-3-0/patches/dev300/transogl-debug-time.diff
==============================================================================
--- (empty file)
+++ branches/ooo-build-3-0/patches/dev300/transogl-debug-time.diff	Wed Sep 10 09:48:40 2008
@@ -0,0 +1,184 @@
+diff -rup slideshow.orig/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx
+--- slideshow.orig/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx	2008-09-09 17:03:49.000000000 +0200
++++ slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx	2008-09-09 17:37:31.000000000 +0200
+@@ -84,9 +84,10 @@ using namespace ::boost::posix_time;
+ 
+ static ptime t1;
+ static ptime t2;
+-static ptime t3;
+-static ptime t4;
+ 
++#define DBG(x) x
++#else
++#define DBG(x)
+ #endif
+ 
+ using namespace ::com::sun::star;
+@@ -286,6 +287,14 @@ public:
+     bool mbTextureFromPixmap;
+ 
+     bool mbGenerateMipmap;
++#ifdef DEBUG
++    ptime t3;
++    ptime t4;
++    ptime t5;
++    ptime t6;
++    time_duration total_update;
++    int frame_count;
++#endif
+ };
+ 
+ // declare the static variables as some gcc versions have problems declaring them automaticaly
+@@ -1048,15 +1057,19 @@ void OGLTransitionerImpl::GLInitSlides()
+ 
+ void SAL_CALL OGLTransitionerImpl::update( double nTime ) throw (uno::RuntimeException)
+ {
++#ifdef DEBUG
++    frame_count ++;
++    t3 = microsec_clock::local_time();
++    if( frame_count == 1 ) {
++	t5 = t3;
++	total_update = seconds (0);
++    }
++#endif
+     osl::MutexGuard const guard( m_aMutex );
+ 
+     if (isDisposed() || !cbGLXPresent || pTransition->mnRequiredGLVersion > cnGLVersion)
+         return;
+ 
+-#ifdef DEBUG
+-    t3 = microsec_clock::local_time();
+-#endif
+-
+ #ifdef WNT
+     wglMakeCurrent(GLWin.hDC,GLWin.hRC);
+ #endif
+@@ -1092,6 +1105,7 @@ void SAL_CALL OGLTransitionerImpl::updat
+ 
+     OSL_TRACE("update time: %f", nTime);
+     OSL_TRACE("update took: %s", to_simple_string( t4 - t3 ).c_str());
++    total_update += (t4 - t3);
+ #endif
+ }
+ 
+@@ -1100,7 +1114,19 @@ void OGLTransitionerImpl::disposing()
+ {
+     osl::MutexGuard const guard( m_aMutex );
+ 
++#ifdef DEBUG
+     OSL_TRACE("dispose %p\n", this);
++    if( frame_count ) {
++	t6 = microsec_clock::local_time();
++	time_duration duration = t6 - t5;
++	OSL_TRACE("whole transition (frames: %d) took: %s fps: %f time spent in updates: %s percentage of transition time: %f%%",
++		  frame_count, to_simple_string( duration ).c_str(),
++		  ((double)frame_count*1000000000.0)/duration.total_nanoseconds(),
++		  to_simple_string( total_update ).c_str(),
++		  100*(((double)total_update.total_nanoseconds())/((double)duration.total_nanoseconds()))
++	    );
++    }
++#endif
+ 
+ #ifdef WNT
+     wglMakeCurrent(GLWin.hDC,GLWin.hRC);
+@@ -1193,6 +1219,8 @@ OGLTransitionerImpl::OGLTransitionerImpl
+ #elif defined( UNX )
+     GLWin.ctx = 0;
+ #endif
++
++    DBG(frame_count = 0);
+ }
+ 
+ typedef cppu::WeakComponentImplHelper1<presentation::XTransitionFactory> OGLTransitionFactoryImplBase;
+diff -rup slideshow.orig/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx
+--- slideshow.orig/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx	2008-09-09 17:03:49.000000000 +0200
++++ slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx	2008-09-09 17:37:31.000000000 +0200
+@@ -84,9 +84,10 @@ using namespace ::boost::posix_time;
+ 
+ static ptime t1;
+ static ptime t2;
+-static ptime t3;
+-static ptime t4;
+ 
++#define DBG(x) x
++#else
++#define DBG(x)
+ #endif
+ 
+ using namespace ::com::sun::star;
+@@ -286,6 +287,14 @@ public:
+     bool mbTextureFromPixmap;
+ 
+     bool mbGenerateMipmap;
++#ifdef DEBUG
++    ptime t3;
++    ptime t4;
++    ptime t5;
++    ptime t6;
++    time_duration total_update;
++    int frame_count;
++#endif
+ };
+ 
+ // declare the static variables as some gcc versions have problems declaring them automaticaly
+@@ -1048,15 +1057,19 @@ void OGLTransitionerImpl::GLInitSlides()
+ 
+ void SAL_CALL OGLTransitionerImpl::update( double nTime ) throw (uno::RuntimeException)
+ {
++#ifdef DEBUG
++    frame_count ++;
++    t3 = microsec_clock::local_time();
++    if( frame_count == 1 ) {
++	t5 = t3;
++	total_update = seconds (0);
++    }
++#endif
+     osl::MutexGuard const guard( m_aMutex );
+ 
+     if (isDisposed() || !cbGLXPresent || pTransition->mnRequiredGLVersion > cnGLVersion)
+         return;
+ 
+-#ifdef DEBUG
+-    t3 = microsec_clock::local_time();
+-#endif
+-
+ #ifdef WNT
+     wglMakeCurrent(GLWin.hDC,GLWin.hRC);
+ #endif
+@@ -1092,6 +1105,7 @@ void SAL_CALL OGLTransitionerImpl::updat
+ 
+     OSL_TRACE("update time: %f", nTime);
+     OSL_TRACE("update took: %s", to_simple_string( t4 - t3 ).c_str());
++    total_update += (t4 - t3);
+ #endif
+ }
+ 
+@@ -1100,7 +1114,19 @@ void OGLTransitionerImpl::disposing()
+ {
+     osl::MutexGuard const guard( m_aMutex );
+ 
++#ifdef DEBUG
+     OSL_TRACE("dispose %p\n", this);
++    if( frame_count ) {
++	t6 = microsec_clock::local_time();
++	time_duration duration = t6 - t5;
++	OSL_TRACE("whole transition (frames: %d) took: %s fps: %f time spent in updates: %s percentage of transition time: %f%%",
++		  frame_count, to_simple_string( duration ).c_str(),
++		  ((double)frame_count*1000000000.0)/duration.total_nanoseconds(),
++		  to_simple_string( total_update ).c_str(),
++		  100*(((double)total_update.total_nanoseconds())/((double)duration.total_nanoseconds()))
++	    );
++    }
++#endif
+ 
+ #ifdef WNT
+     wglMakeCurrent(GLWin.hDC,GLWin.hRC);
+@@ -1193,6 +1219,8 @@ OGLTransitionerImpl::OGLTransitionerImpl
+ #elif defined( UNX )
+     GLWin.ctx = 0;
+ #endif
++
++    DBG(frame_count = 0);
+ }
+ 
+ typedef cppu::WeakComponentImplHelper1<presentation::XTransitionFactory> OGLTransitionFactoryImplBase;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]