mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-26 07:54:36 +00:00
Display thumbnail of current frame image in connection popup.
This commit is contained in:
parent
f367b16dc0
commit
0d2914bbe8
@ -1115,6 +1115,29 @@ bool View::DrawConnection()
|
||||
}
|
||||
}
|
||||
|
||||
const auto& fis = m_worker.GetFrameImages();
|
||||
if( !fis.empty() )
|
||||
{
|
||||
const auto scale = ImGui::GetTextLineHeight() / 15.f * 0.5f;
|
||||
const auto& fi = fis.back();
|
||||
if( fi != m_frameTextureConnPtr )
|
||||
{
|
||||
if( !m_frameTextureConn ) m_frameTextureConn = MakeTexture();
|
||||
UpdateTexture( m_frameTextureConn, m_worker.UnpackFrameImage( *fi ), fi->w, fi->h );
|
||||
m_frameTextureConnPtr = fi;
|
||||
}
|
||||
ImGui::Separator();
|
||||
if( fi->flip )
|
||||
{
|
||||
ImGui::Image( m_frameTextureConn, ImVec2( fi->w * scale, fi->h * scale ), ImVec2( 0, 1 ), ImVec2( 1, 0 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::Image( m_frameTextureConn, ImVec2( fi->w * scale, fi->h * scale ) );
|
||||
}
|
||||
}
|
||||
|
||||
ImGui::Separator();
|
||||
if( ImGui::Button( ICON_FA_SAVE " Save trace" ) && m_saveThreadState.load( std::memory_order_relaxed ) == SaveThreadState::Inert )
|
||||
{
|
||||
#ifndef TRACY_NO_FILESELECTOR
|
||||
|
@ -454,6 +454,9 @@ private:
|
||||
void* m_frameTexture = nullptr;
|
||||
const void* m_frameTexturePtr = nullptr;
|
||||
|
||||
void* m_frameTextureConn = nullptr;
|
||||
const void* m_frameTextureConnPtr = nullptr;
|
||||
|
||||
std::vector<std::unique_ptr<Annotation>> m_annotations;
|
||||
UserData m_userData;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user