mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Show frame images in frame tooltips.
This commit is contained in:
parent
82d4fe7236
commit
beea31edd0
@ -419,6 +419,8 @@ View::View( const char* addr, ImFont* fixedWidth, SetTitleCallback stcb )
|
||||
assert( s_instance == nullptr );
|
||||
s_instance = this;
|
||||
|
||||
m_frameTexture = MakeTexture();
|
||||
|
||||
InitTextEditor();
|
||||
}
|
||||
|
||||
@ -436,6 +438,8 @@ View::View( FileRead& f, ImFont* fixedWidth, SetTitleCallback stcb )
|
||||
m_notificationTime = 4;
|
||||
m_notificationText = std::string( "Trace loaded in " ) + TimeToString( m_worker.GetLoadTime() );
|
||||
|
||||
m_frameTexture = MakeTexture();
|
||||
|
||||
InitTextEditor();
|
||||
SetViewToLastFrames();
|
||||
}
|
||||
@ -447,6 +451,8 @@ View::~View()
|
||||
if( m_compare.loadThread.joinable() ) m_compare.loadThread.join();
|
||||
if( m_saveThread.joinable() ) m_saveThread.join();
|
||||
|
||||
FreeTexture( m_frameTexture );
|
||||
|
||||
assert( s_instance != nullptr );
|
||||
s_instance = nullptr;
|
||||
}
|
||||
@ -1640,6 +1646,15 @@ bool View::DrawZoneFrames( const FrameData& frames )
|
||||
ImGui::TextUnformatted( GetFrameText( frames, i, ftime, m_worker.GetFrameOffset() ) );
|
||||
ImGui::Separator();
|
||||
TextFocused( "Time from start of program:", TimeToString( m_worker.GetFrameBegin( frames, i ) - m_worker.GetTimeBegin() ) );
|
||||
auto fi = m_worker.GetFrameImage( frames, i );
|
||||
if( fi )
|
||||
{
|
||||
if( fi != m_frameTexturePtr )
|
||||
{
|
||||
UpdateTexture( m_frameTexture, fi->ptr, fi->w, fi->h );
|
||||
}
|
||||
ImGui::Image( m_frameTexture, ImVec2( fi->w, fi->h ) );
|
||||
}
|
||||
ImGui::EndTooltip();
|
||||
|
||||
if( ImGui::IsMouseClicked( 2 ) )
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
#include "TracyBuzzAnim.hpp"
|
||||
#include "TracyDecayValue.hpp"
|
||||
#include "TracyTexture.hpp"
|
||||
#include "TracyVector.hpp"
|
||||
#include "TracyWorker.hpp"
|
||||
#include "tracy_flat_hash_map.hpp"
|
||||
@ -326,6 +327,9 @@ private:
|
||||
std::atomic<SaveThreadState> m_saveThreadState { SaveThreadState::Inert };
|
||||
std::thread m_saveThread;
|
||||
|
||||
void* m_frameTexture;
|
||||
void* m_frameTexturePtr = nullptr;
|
||||
|
||||
struct FindZone {
|
||||
enum : uint64_t { Unselected = std::numeric_limits<uint64_t>::max() - 1 };
|
||||
enum class GroupBy : int { Thread, UserText, Callstack };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user