mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 20:33:52 +00:00
Move adding annotations to a separate function.
This commit is contained in:
parent
42688c9bf3
commit
f17a579753
@ -346,6 +346,18 @@ void View::DrawHelpMarker( const char* desc ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void View::AddAnnotation( int64_t start, int64_t end )
|
||||||
|
{
|
||||||
|
auto ann = std::make_unique<Annotation>();
|
||||||
|
ann->range.active = true;
|
||||||
|
ann->range.min = start;
|
||||||
|
ann->range.max = end;
|
||||||
|
ann->color = 0x888888;
|
||||||
|
m_selectedAnnotation = ann.get();
|
||||||
|
m_annotations.emplace_back( std::move( ann ) );
|
||||||
|
pdqsort_branchless( m_annotations.begin(), m_annotations.end(), []( const auto& lhs, const auto& rhs ) { return lhs->range.min < rhs->range.min; } );
|
||||||
|
}
|
||||||
|
|
||||||
static const char* CompressionName[] = {
|
static const char* CompressionName[] = {
|
||||||
"LZ4",
|
"LZ4",
|
||||||
"LZ4 HC",
|
"LZ4 HC",
|
||||||
@ -1163,14 +1175,7 @@ bool View::DrawImpl()
|
|||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
if( ImGui::Selectable( ICON_FA_STICKY_NOTE " Add annotation" ) )
|
if( ImGui::Selectable( ICON_FA_STICKY_NOTE " Add annotation" ) )
|
||||||
{
|
{
|
||||||
auto ann = std::make_unique<Annotation>();
|
AddAnnotation( s, e );
|
||||||
ann->range.active = true;
|
|
||||||
ann->range.min = s;
|
|
||||||
ann->range.max = e;
|
|
||||||
ann->color = 0x888888;
|
|
||||||
m_selectedAnnotation = ann.get();
|
|
||||||
m_annotations.emplace_back( std::move( ann ) );
|
|
||||||
pdqsort_branchless( m_annotations.begin(), m_annotations.end(), []( const auto& lhs, const auto& rhs ) { return lhs->range.min < rhs->range.min; } );
|
|
||||||
}
|
}
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
}
|
}
|
||||||
|
@ -253,6 +253,8 @@ private:
|
|||||||
void HandleRange( Range& range, int64_t timespan, const ImVec2& wpos, float w );
|
void HandleRange( Range& range, int64_t timespan, const ImVec2& wpos, float w );
|
||||||
void HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, double& pxns );
|
void HandleZoneViewMouse( int64_t timespan, const ImVec2& wpos, float w, double& pxns );
|
||||||
|
|
||||||
|
void AddAnnotation( int64_t start, int64_t end );
|
||||||
|
|
||||||
uint32_t GetThreadColor( uint64_t thread, int depth );
|
uint32_t GetThreadColor( uint64_t thread, int depth );
|
||||||
uint32_t GetSrcLocColor( const SourceLocation& srcloc, int depth );
|
uint32_t GetSrcLocColor( const SourceLocation& srcloc, int depth );
|
||||||
uint32_t GetRawSrcLocColor( const SourceLocation& srcloc, int depth );
|
uint32_t GetRawSrcLocColor( const SourceLocation& srcloc, int depth );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user