mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-24 01:30:47 +00:00
Fix frame image race condition + refactor
- In the connection state, retrieve the FrameImage while owning the data lock. - Use actual image data pointer as caching key instead of the address of ImageCache which may change during executation (unstable). - Fixes scale Messages image tooltip scale. - Free the connection image
This commit is contained in:
@@ -153,22 +153,8 @@ void View::DrawTimelineFrames( const FrameData& frames )
|
||||
auto fi = m_worker.GetFrameImage( frames, i );
|
||||
if( fi )
|
||||
{
|
||||
const auto scale = GetScale();
|
||||
if( fi != m_frameTexturePtr )
|
||||
{
|
||||
if( !m_frameTexture ) m_frameTexture = MakeTexture();
|
||||
UpdateTexture( m_frameTexture, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h );
|
||||
m_frameTexturePtr = fi;
|
||||
}
|
||||
ImGui::Separator();
|
||||
if( fi->flip )
|
||||
{
|
||||
ImGui::Image( m_frameTexture, ImVec2( fi->w * scale, fi->h * scale ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::Image( m_frameTexture, ImVec2( fi->w * scale, fi->h * scale ) );
|
||||
}
|
||||
DrawFrameImage( m_FrameTextureCache, *fi );
|
||||
|
||||
if( ImGui::GetIO().KeyCtrl && IsMouseClicked( 0 ) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user