2022-09-04 12:29:32 +00:00
|
|
|
#ifndef __TRACYTIMELINEITEMCPUDATA_HPP__
|
|
|
|
#define __TRACYTIMELINEITEMCPUDATA_HPP__
|
|
|
|
|
|
|
|
#include "TracyEvent.hpp"
|
|
|
|
#include "TracyTimelineItem.hpp"
|
2023-03-25 16:55:15 +00:00
|
|
|
#include "TracyTimelineDraw.hpp"
|
2022-09-04 12:29:32 +00:00
|
|
|
|
|
|
|
namespace tracy
|
|
|
|
{
|
|
|
|
|
|
|
|
class TimelineItemCpuData final : public TimelineItem
|
|
|
|
{
|
|
|
|
public:
|
2023-01-27 19:00:05 +00:00
|
|
|
TimelineItemCpuData( View& view, Worker& worker, void* key );
|
2022-09-04 12:29:32 +00:00
|
|
|
|
|
|
|
void SetVisible( bool visible ) override;
|
|
|
|
bool IsVisible() const override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
uint32_t HeaderColor() const override { return 0xFFDD88DD; }
|
|
|
|
uint32_t HeaderColorInactive() const override { return 0xFF6E446E; }
|
|
|
|
uint32_t HeaderLineColor() const override { return 0x66DD88DD; }
|
|
|
|
const char* HeaderLabel() const override { return "CPU data"; }
|
|
|
|
|
|
|
|
int64_t RangeBegin() const override;
|
|
|
|
int64_t RangeEnd() const override;
|
|
|
|
|
2023-03-18 15:07:56 +00:00
|
|
|
bool DrawContents( const TimelineContext& ctx, int& offset ) override;
|
2023-03-25 16:55:15 +00:00
|
|
|
void DrawFinished() override;
|
2022-09-04 12:29:32 +00:00
|
|
|
|
|
|
|
bool IsEmpty() const override;
|
2023-03-25 16:55:15 +00:00
|
|
|
|
2023-04-05 16:07:09 +00:00
|
|
|
void Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible, int yPos ) override;
|
2023-03-25 16:55:15 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void PreprocessCpuUsage( const TimelineContext& ctx );
|
2023-04-02 20:10:22 +00:00
|
|
|
void PreprocessCpuCtxSwitches( const TimelineContext& ctx, const Vector<ContextSwitchCpu>& cs, std::vector<CpuCtxDraw>& out );
|
2023-03-25 16:55:15 +00:00
|
|
|
|
|
|
|
std::vector<CpuUsageDraw> m_cpuDraw;
|
2023-04-02 20:10:22 +00:00
|
|
|
std::vector<std::vector<CpuCtxDraw>> m_ctxDraw;
|
2023-04-07 20:26:36 +00:00
|
|
|
|
|
|
|
bool m_hasCpuData;
|
2022-09-04 12:29:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|