mirror of
https://github.com/wolfpld/tracy.git
synced 2026-10-14 04:45:22 +00:00
DrawSourceTooltip reports if source was printed.
This commit is contained in:
@@ -1420,12 +1420,12 @@ void View::CrashTooltip()
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
|
||||
void View::DrawSourceTooltip( const char* filename, uint32_t srcline, int before, int after, bool separateTooltip )
|
||||
bool View::DrawSourceTooltip( const char* filename, uint32_t srcline, int before, int after, bool separateTooltip )
|
||||
{
|
||||
if( !filename ) return;
|
||||
if( !SourceFileValid( filename, m_worker.GetCaptureTime(), *this, m_worker ) ) return;
|
||||
if( !filename ) return false;
|
||||
if( !SourceFileValid( filename, m_worker.GetCaptureTime(), *this, m_worker ) ) return false;
|
||||
m_srcHintCache.Parse( filename, m_worker, *this );
|
||||
if( m_srcHintCache.empty() ) return;
|
||||
if( m_srcHintCache.empty() ) return false;
|
||||
ImGui::PushStyleVar( ImGuiStyleVar_ItemSpacing, ImVec2( 0, 0 ) );
|
||||
if( separateTooltip ) ImGui::BeginTooltip();
|
||||
ImGui::PushFont( g_fonts.mono, FontNormal );
|
||||
@@ -1478,6 +1478,7 @@ void View::DrawSourceTooltip( const char* filename, uint32_t srcline, int before
|
||||
ImGui::PopFont();
|
||||
if( separateTooltip ) ImGui::EndTooltip();
|
||||
ImGui::PopStyleVar();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool View::Save( const char* fn, FileCompression comp, int zlevel, bool buildDict, int streams )
|
||||
|
||||
@@ -181,7 +181,7 @@ public:
|
||||
bool DrawGpu( const TimelineContext& ctx, const GpuCtxData& gpu, int& offset );
|
||||
bool DrawCpuData( const TimelineContext& ctx, const std::vector<CpuUsageDraw>& cpuDraw, const std::vector<std::vector<CpuCtxDraw>>& ctxDraw, int& offset, bool hasCpuData );
|
||||
void DrawThreadMigrations( const TimelineContext& ctx, const int origOffset, uint64_t thread );
|
||||
void DrawSourceTooltip( const char* filename, uint32_t line, int before = 3, int after = 3, bool separateTooltip = true );
|
||||
bool DrawSourceTooltip( const char* filename, uint32_t line, int before = 3, int after = 3, bool separateTooltip = true );
|
||||
|
||||
bool IsBackgroundDone() const { return m_worker.IsBackgroundDone(); }
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "TracySourceView.hpp"
|
||||
#include "TracyTimelineContext.hpp"
|
||||
#include "TracyTimelineDraw.hpp"
|
||||
#include "TracyUtility.hpp"
|
||||
#include "TracyView.hpp"
|
||||
#include "tracy_pdqsort.h"
|
||||
#include "../Fonts.hpp"
|
||||
|
||||
Reference in New Issue
Block a user