update ooo310-m15
[ooovba.git] / applied_patches / 0573-transogl-debug-time.diff
blob66d94a5769f24131c91ccdb5fee9b5b2951c3cf2
1 diff -rup slideshow.orig/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx
2 --- slideshow.orig/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx 2008-09-09 17:03:49.000000000 +0200
3 +++ slideshow/source/engine/OGLTrans/OGLTrans_TransitionerImpl.cxx 2008-09-09 17:37:31.000000000 +0200
4 @@ -84,9 +84,10 @@ using namespace ::boost::posix_time;
6 static ptime t1;
7 static ptime t2;
8 -static ptime t3;
9 -static ptime t4;
11 +#define DBG(x) x
12 +#else
13 +#define DBG(x)
14 #endif
16 using namespace ::com::sun::star;
17 @@ -286,6 +287,14 @@ public:
18 bool mbTextureFromPixmap;
20 bool mbGenerateMipmap;
21 +#ifdef DEBUG
22 + ptime t3;
23 + ptime t4;
24 + ptime t5;
25 + ptime t6;
26 + time_duration total_update;
27 + int frame_count;
28 +#endif
31 // declare the static variables as some gcc versions have problems declaring them automaticaly
32 @@ -1048,15 +1057,19 @@ void OGLTransitionerImpl::GLInitSlides()
34 void SAL_CALL OGLTransitionerImpl::update( double nTime ) throw (uno::RuntimeException)
36 +#ifdef DEBUG
37 + frame_count ++;
38 + t3 = microsec_clock::local_time();
39 + if( frame_count == 1 ) {
40 + t5 = t3;
41 + total_update = seconds (0);
42 + }
43 +#endif
44 osl::MutexGuard const guard( m_aMutex );
46 if (isDisposed() || !cbGLXPresent || pTransition->mnRequiredGLVersion > cnGLVersion)
47 return;
49 -#ifdef DEBUG
50 - t3 = microsec_clock::local_time();
51 -#endif
53 #ifdef WNT
54 wglMakeCurrent(GLWin.hDC,GLWin.hRC);
55 #endif
56 @@ -1092,6 +1105,7 @@ void SAL_CALL OGLTransitionerImpl::updat
58 OSL_TRACE("update time: %f", nTime);
59 OSL_TRACE("update took: %s", to_simple_string( t4 - t3 ).c_str());
60 + total_update += (t4 - t3);
61 #endif
64 @@ -1100,7 +1114,19 @@ void OGLTransitionerImpl::disposing()
66 osl::MutexGuard const guard( m_aMutex );
68 +#ifdef DEBUG
69 OSL_TRACE("dispose %p\n", this);
70 + if( frame_count ) {
71 + t6 = microsec_clock::local_time();
72 + time_duration duration = t6 - t5;
73 + OSL_TRACE("whole transition (frames: %d) took: %s fps: %f time spent in updates: %s percentage of transition time: %f%%",
74 + frame_count, to_simple_string( duration ).c_str(),
75 + ((double)frame_count*1000000000.0)/duration.total_nanoseconds(),
76 + to_simple_string( total_update ).c_str(),
77 + 100*(((double)total_update.total_nanoseconds())/((double)duration.total_nanoseconds()))
78 + );
79 + }
80 +#endif
82 #ifdef WNT
83 wglMakeCurrent(GLWin.hDC,GLWin.hRC);
84 @@ -1193,6 +1219,8 @@ OGLTransitionerImpl::OGLTransitionerImpl
85 #elif defined( UNX )
86 GLWin.ctx = 0;
87 #endif
89 + DBG(frame_count = 0);
92 typedef cppu::WeakComponentImplHelper1<presentation::XTransitionFactory> OGLTransitionFactoryImplBase;