mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Timeline items may have preprocessing.
This commit is contained in:
parent
988de5b594
commit
7dd31ab609
@ -8,10 +8,11 @@
|
|||||||
namespace tracy
|
namespace tracy
|
||||||
{
|
{
|
||||||
|
|
||||||
TimelineItem::TimelineItem( View& view, Worker& worker, const void* key )
|
TimelineItem::TimelineItem( View& view, Worker& worker, const void* key, bool wantPreprocess )
|
||||||
: m_visible( true )
|
: m_visible( true )
|
||||||
, m_showFull( true )
|
, m_showFull( true )
|
||||||
, m_height( 0 )
|
, m_height( 0 )
|
||||||
|
, m_wantPreprocess( wantPreprocess )
|
||||||
, m_key( key )
|
, m_key( key )
|
||||||
, m_view( view )
|
, m_view( view )
|
||||||
, m_worker( worker )
|
, m_worker( worker )
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef __TRACYTIMELINEITEM_HPP__
|
#ifndef __TRACYTIMELINEITEM_HPP__
|
||||||
#define __TRACYTIMELINEITEM_HPP__
|
#define __TRACYTIMELINEITEM_HPP__
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
@ -14,12 +15,15 @@ class Worker;
|
|||||||
class TimelineItem
|
class TimelineItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TimelineItem( View& view, Worker& worker, const void* key );
|
TimelineItem( View& view, Worker& worker, const void* key, bool wantPreprocess );
|
||||||
virtual ~TimelineItem() = default;
|
virtual ~TimelineItem() = default;
|
||||||
|
|
||||||
// draws the timeline item and also updates the next frame height value
|
// draws the timeline item and also updates the next frame height value
|
||||||
void Draw( bool firstFrame, double pxns, int yOffset, const ImVec2& wpos, bool hover, float yMin, float yMax );
|
void Draw( bool firstFrame, double pxns, int yOffset, const ImVec2& wpos, bool hover, float yMin, float yMax );
|
||||||
|
|
||||||
|
bool WantPreprocess() const { return m_wantPreprocess; }
|
||||||
|
virtual void Preprocess() { assert( false ); }
|
||||||
|
|
||||||
void VisibilityCheckbox();
|
void VisibilityCheckbox();
|
||||||
virtual void SetVisible( bool visible ) { m_visible = visible; }
|
virtual void SetVisible( bool visible ) { m_visible = visible; }
|
||||||
virtual bool IsVisible() const { return m_visible; }
|
virtual bool IsVisible() const { return m_visible; }
|
||||||
@ -55,6 +59,7 @@ private:
|
|||||||
void AdjustThreadHeight( bool firstFrame, int yBegin, int yEnd );
|
void AdjustThreadHeight( bool firstFrame, int yBegin, int yEnd );
|
||||||
|
|
||||||
int m_height;
|
int m_height;
|
||||||
|
bool m_wantPreprocess;
|
||||||
|
|
||||||
const void* m_key;
|
const void* m_key;
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ namespace tracy
|
|||||||
{
|
{
|
||||||
|
|
||||||
TimelineItemCpuData::TimelineItemCpuData( View& view, Worker& worker, void* key )
|
TimelineItemCpuData::TimelineItemCpuData( View& view, Worker& worker, void* key )
|
||||||
: TimelineItem( view, worker, key )
|
: TimelineItem( view, worker, key, false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ namespace tracy
|
|||||||
{
|
{
|
||||||
|
|
||||||
TimelineItemGpu::TimelineItemGpu( View& view, Worker& worker, GpuCtxData* gpu )
|
TimelineItemGpu::TimelineItemGpu( View& view, Worker& worker, GpuCtxData* gpu )
|
||||||
: TimelineItem( view, worker, gpu )
|
: TimelineItem( view, worker, gpu, false )
|
||||||
, m_gpu( gpu )
|
, m_gpu( gpu )
|
||||||
, m_idx( view.GetNextGpuIdx() )
|
, m_idx( view.GetNextGpuIdx() )
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ namespace tracy
|
|||||||
{
|
{
|
||||||
|
|
||||||
TimelineItemPlot::TimelineItemPlot( View& view, Worker& worker, PlotData* plot )
|
TimelineItemPlot::TimelineItemPlot( View& view, Worker& worker, PlotData* plot )
|
||||||
: TimelineItem( view, worker, plot )
|
: TimelineItem( view, worker, plot, false )
|
||||||
, m_plot( plot )
|
, m_plot( plot )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace tracy
|
|||||||
{
|
{
|
||||||
|
|
||||||
TimelineItemThread::TimelineItemThread( View& view, Worker& worker, const ThreadData* thread )
|
TimelineItemThread::TimelineItemThread( View& view, Worker& worker, const ThreadData* thread )
|
||||||
: TimelineItem( view, worker, thread )
|
: TimelineItem( view, worker, thread, false )
|
||||||
, m_thread( thread )
|
, m_thread( thread )
|
||||||
, m_ghost( false )
|
, m_ghost( false )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user