Kaydet (Commit) 38b70b16 authored tarafından David Tardon's avatar David Tardon

simplify time profiling

Change-Id: Ib5976cd3e0c6e3b90fc62fe8336317f259dd544b
üst 7a545ea8
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment