tracy/server/TracyTimelineItemCpuData.hpp
Bartosz Taudul 5eebc5d7cf
Preprocess CPU usage.
Things of note: Worker::GetCpuUsage() functionality was moved to
TimelineItemCpuData::PreprocessCpuUsage().
2023-03-25 17:55:15 +01:00

44 lines
1.1 KiB
C++

#ifndef __TRACYTIMELINEITEMCPUDATA_HPP__
#define __TRACYTIMELINEITEMCPUDATA_HPP__
#include "TracyEvent.hpp"
#include "TracyTimelineItem.hpp"
#include "TracyTimelineDraw.hpp"
namespace tracy
{
class TimelineItemCpuData final : public TimelineItem
{
public:
TimelineItemCpuData( View& view, Worker& worker, void* key );
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;
bool DrawContents( const TimelineContext& ctx, int& offset ) override;
void DrawFinished() override;
bool IsEmpty() const override;
void Preprocess( const TimelineContext& ctx, TaskDispatch& td, bool visible ) override;
private:
void PreprocessCpuUsage( const TimelineContext& ctx );
std::vector<CpuUsageDraw> m_cpuDraw;
};
}
#endif