2022-09-03 21:28:54 +00:00
|
|
|
#ifndef __TRACYTIMELINEITEMTHREAD_HPP__
|
|
|
|
#define __TRACYTIMELINEITEMTHREAD_HPP__
|
|
|
|
|
|
|
|
#include "TracyEvent.hpp"
|
|
|
|
#include "TracyTimelineItem.hpp"
|
2023-03-19 15:11:18 +00:00
|
|
|
#include "TracyTimelineDraw.hpp"
|
2022-09-03 21:28:54 +00:00
|
|
|
|
|
|
|
namespace tracy
|
|
|
|
{
|
|
|
|
|
|
|
|
class TimelineItemThread final : public TimelineItem
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TimelineItemThread( View& view, Worker& worker, const ThreadData* plot );
|
|
|
|
|
|
|
|
protected:
|
|
|
|
uint32_t HeaderColor() const override;
|
|
|
|
uint32_t HeaderColorInactive() const override;
|
|
|
|
uint32_t HeaderLineColor() const override;
|
|
|
|
const char* HeaderLabel() const override;
|
|
|
|
|
|
|
|
int64_t RangeBegin() const override;
|
|
|
|
int64_t RangeEnd() const override;
|
|
|
|
|
|
|
|
void HeaderTooltip( const char* label ) const override;
|
2023-03-18 15:07:56 +00:00
|
|
|
void HeaderExtraContents( const TimelineContext& ctx, int offset, float labelWidth ) override;
|
2022-09-03 21:28:54 +00:00
|
|
|
|
2023-03-18 15:07:56 +00:00
|
|
|
bool DrawContents( const TimelineContext& ctx, int& offset ) override;
|
2022-09-03 21:28:54 +00:00
|
|
|
void DrawOverlay( const ImVec2& ul, const ImVec2& dr ) override;
|
2023-03-19 15:11:18 +00:00
|
|
|
void DrawFinished() override;
|
2022-09-03 21:28:54 +00:00
|
|
|
|
|
|
|
bool IsEmpty() const override;
|
|
|
|
|
2023-04-05 16:07:09 +00:00
|
|
|
void Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible, int yPos ) override;
|
2023-03-19 15:11:18 +00:00
|
|
|
|
2022-09-03 21:28:54 +00:00
|
|
|
private:
|
2023-03-19 15:11:18 +00:00
|
|
|
#ifndef TRACY_NO_STATISTICS
|
2023-03-25 15:51:31 +00:00
|
|
|
int PreprocessGhostLevel( const TimelineContext& ctx, const Vector<GhostZone>& vec, int depth, bool visible );
|
2023-03-19 15:11:18 +00:00
|
|
|
#endif
|
2023-03-25 15:51:31 +00:00
|
|
|
int PreprocessZoneLevel( const TimelineContext& ctx, const Vector<short_ptr<ZoneEvent>>& vec, int depth, bool visible );
|
2023-03-19 15:11:18 +00:00
|
|
|
|
|
|
|
template<typename Adapter, typename V>
|
2023-03-25 15:51:31 +00:00
|
|
|
int PreprocessZoneLevel( const TimelineContext& ctx, const V& vec, int depth, bool visible );
|
2023-03-19 15:11:18 +00:00
|
|
|
|
2023-03-25 15:51:31 +00:00
|
|
|
void PreprocessContextSwitches( const TimelineContext& ctx, const ContextSwitch& ctxSwitch, bool visible );
|
2023-04-05 17:03:40 +00:00
|
|
|
void PreprocessSamples( const TimelineContext& ctx, const Vector<SampleData>& vec, bool visible, int yPos );
|
2023-04-05 16:55:23 +00:00
|
|
|
void PreprocessMessages( const TimelineContext& ctx, const Vector<short_ptr<MessageData>>& vec, uint64_t tid, bool visible, int yPos );
|
2023-03-22 18:38:36 +00:00
|
|
|
|
2022-09-03 21:28:54 +00:00
|
|
|
const ThreadData* m_thread;
|
|
|
|
bool m_ghost;
|
2023-03-19 15:11:18 +00:00
|
|
|
|
2023-03-22 21:07:36 +00:00
|
|
|
std::vector<SamplesDraw> m_samplesDraw;
|
2023-03-22 18:38:36 +00:00
|
|
|
std::vector<ContextSwitchDraw> m_ctxDraw;
|
2023-03-19 15:11:18 +00:00
|
|
|
std::vector<TimelineDraw> m_draw;
|
2023-03-23 20:47:40 +00:00
|
|
|
std::vector<MessagesDraw> m_msgDraw;
|
2023-03-19 15:11:18 +00:00
|
|
|
int m_depth;
|
2023-03-25 15:46:03 +00:00
|
|
|
bool m_hasCtxSwitch;
|
|
|
|
bool m_hasSamples;
|
|
|
|
bool m_hasMessages;
|
2022-09-03 21:28:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|