tracy/server/TracyUtility.hpp
Bartosz Taudul 55a82ea714
Make plot color/value formatting generic utilities.
Previous implementations of these functions (in TracyView) are still used
throughout the code. They will be removed in subsequent commits.
2022-09-03 17:51:32 +02:00

34 lines
742 B
C++

#ifndef __TRACYUTILITY_HPP__
#define __TRACYUTILITY_HPP__
#include <stdint.h>
#include "imgui.h"
#include "TracyEvent.hpp"
namespace tracy
{
class Worker;
enum class ShortenName : uint8_t
{
Never,
Always,
OnlyNormalize,
NoSpace,
NoSpaceAndNormalize,
};
const char* ShortenZoneName( ShortenName type, const char* name, ImVec2& tsz, float zsz );
void TooltipNormalizedName( const char* name, const char* normalized );
static inline const char* ShortenZoneName( ShortenName type, const char* name ) { ImVec2 tsz = {}; return ShortenZoneName( type, name, tsz, 0 ); }
uint32_t GetPlotColor( const PlotData& plot, const Worker& worker );
const char* FormatPlotValue( double val, PlotValueFormatting format );
}
#endif