Commit e1ecd301 authored by Maciej Suminski's avatar Maciej Suminski

Added some debug informations.

parent 135149e2
...@@ -407,10 +407,12 @@ void VIEW::redrawRect( const BOX2I& aRect ) ...@@ -407,10 +407,12 @@ void VIEW::redrawRect( const BOX2I& aRect )
{ {
int totalItems = 0, totalCached = 0; int totalItems = 0, totalCached = 0;
uint64_t totalDrawTime = 0; uint64_t totalDrawTime = 0;
#ifdef __WXDEBUG__
prof_counter totalCycles, totalRealTime; prof_counter totalCycles, totalRealTime;
prof_start( &totalRealTime, false ); prof_start( &totalRealTime, false );
prof_start( &totalCycles, true ); prof_start( &totalCycles, true );
#endif /* __WXDEBUG__ */
BOOST_FOREACH( VIEW_LAYER* l, m_orderedLayers ) BOOST_FOREACH( VIEW_LAYER* l, m_orderedLayers )
{ {
...@@ -428,6 +430,7 @@ void VIEW::redrawRect( const BOX2I& aRect ) ...@@ -428,6 +430,7 @@ void VIEW::redrawRect( const BOX2I& aRect )
} }
} }
#ifdef __WXDEBUG__
prof_end( &totalCycles ); prof_end( &totalCycles );
prof_end( &totalRealTime ); prof_end( &totalRealTime );
...@@ -435,6 +438,7 @@ void VIEW::redrawRect( const BOX2I& aRect ) ...@@ -435,6 +438,7 @@ void VIEW::redrawRect( const BOX2I& aRect )
totalItems, totalCached, (double) totalRealTime.value / 1000.0, totalItems, totalCached, (double) totalRealTime.value / 1000.0,
1000000.0 / (double) totalRealTime.value, 1000000.0 / (double) totalRealTime.value,
(double) totalDrawTime / (double) totalCycles.value * 100.0 ); (double) totalDrawTime / (double) totalCycles.value * 100.0 );
#endif /* __WXDEBUG__ */
} }
...@@ -600,12 +604,23 @@ void VIEW::RecacheAllItems( bool aImmediately ) ...@@ -600,12 +604,23 @@ void VIEW::RecacheAllItems( bool aImmediately )
r.SetMaximum(); r.SetMaximum();
#ifdef __WXDEBUG__
wxLogDebug( wxT( "RecacheAllItems::immediately: %u" ), aImmediately ); wxLogDebug( wxT( "RecacheAllItems::immediately: %u" ), aImmediately );
prof_counter totalRealTime;
prof_start( &totalRealTime, false );
#endif /* __WXDEBUG__ */
for( LayerMapIter i = m_layers.begin(); i != m_layers.end(); ++i ) for( LayerMapIter i = m_layers.begin(); i != m_layers.end(); ++i )
{ {
VIEW_LAYER* l = & ( ( *i ).second ); VIEW_LAYER* l = & ( ( *i ).second );
recacheItem visitor( this, m_gal, l->id, aImmediately ); recacheItem visitor( this, m_gal, l->id, aImmediately );
l->items->Query( r, visitor ); l->items->Query( r, visitor );
} }
#ifdef __WXDEBUG__
prof_end( &totalRealTime );
wxLogDebug( wxT( "RecacheAllItems::%.1f ms" ), (double) totalRealTime.value / 1000.0 );
#endif /* __WXDEBUG__ */
} }
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