mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Stay in fast loop until there's something to draw.
This commit is contained in:
parent
257f9818ed
commit
d1789f1e3a
@ -2308,24 +2308,21 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
|
|||||||
|
|
||||||
while( vbegin < vend )
|
while( vbegin < vend )
|
||||||
{
|
{
|
||||||
if( state == LockState::Nothing )
|
if( state == LockState::Nothing || ( m_onlyContendedLocks && state == LockState::HasLock ) )
|
||||||
{
|
{
|
||||||
LockState nextState;
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
vbegin = GetNextLockEvent( vbegin, vend, state, nextState, thread );
|
vbegin = GetNextLockEvent( vbegin, vend, state, state, thread );
|
||||||
}
|
}
|
||||||
while( nextState == LockState::Nothing && vbegin < vend );
|
while( vbegin < vend && ( state == LockState::Nothing || ( m_onlyContendedLocks && state == LockState::HasLock ) ) );
|
||||||
if( nextState == LockState::Nothing ) break;
|
if( vbegin >= vend ) break;
|
||||||
state = nextState;
|
state = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
LockState nextState;
|
LockState nextState;
|
||||||
auto next = GetNextLockEvent( vbegin, vend, state, nextState, thread );
|
auto next = GetNextLockEvent( vbegin, vend, state, nextState, thread );
|
||||||
|
|
||||||
assert( state != LockState::Nothing );
|
assert( state != LockState::Nothing && ( !m_onlyContendedLocks || state != LockState::HasLock ) );
|
||||||
if( !m_onlyContendedLocks || state != LockState::HasLock )
|
|
||||||
{
|
|
||||||
drawn = true;
|
drawn = true;
|
||||||
const auto t0 = (*vbegin)->time;
|
const auto t0 = (*vbegin)->time;
|
||||||
const auto t1 = next == tl.end() ? GetLastTime() : (*next)->time;
|
const auto t1 = next == tl.end() ? GetLastTime() : (*next)->time;
|
||||||
@ -2482,7 +2479,6 @@ int View::DrawLocks( uint64_t tid, bool hover, double pxns, const ImVec2& wpos,
|
|||||||
draw->AddLine( wpos + ImVec2( px1 + rsz, offset + ty/4 ), wpos + ImVec2( px1 + rsz, offset + 3*ty/4 ), 0xAAFFFFFF );
|
draw->AddLine( wpos + ImVec2( px1 + rsz, offset + ty/4 ), wpos + ImVec2( px1 + rsz, offset + 3*ty/4 ), 0xAAFFFFFF );
|
||||||
draw->AddLine( wpos + ImVec2( px1 - rsz, offset + ty/4 ), wpos + ImVec2( px1 - rsz, offset + 3*ty/4 ), 0xAAFFFFFF );
|
draw->AddLine( wpos + ImVec2( px1 - rsz, offset + ty/4 ), wpos + ImVec2( px1 - rsz, offset + 3*ty/4 ), 0xAAFFFFFF );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
vbegin = next;
|
vbegin = next;
|
||||||
state = nextState;
|
state = nextState;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user