diff options
author | David Tardon <dtardon@redhat.com> | 2012-08-30 09:04:19 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2012-09-07 10:06:59 +0200 |
commit | 38b70b169ce132eadef9fc3bcb5acd9171ea84fe (patch) | |
tree | 7664ae59591c92175dd76fac792c57575db74348 /slideshow | |
parent | use meaningful names for debugging variables (diff) | |
download | core-38b70b169ce132eadef9fc3bcb5acd9171ea84fe.tar.gz core-38b70b169ce132eadef9fc3bcb5acd9171ea84fe.zip |
simplify time profiling
Change-Id: Ib5976cd3e0c6e3b90fc62fe8336317f259dd544b
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/unx/OGLTrans_TransitionerImpl.cxx index ee8e0061cae9..a2dd1deb2f70 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) |