Timeline items may have preprocessing.

This commit is contained in:
Bartosz Taudul 2023-03-14 02:02:21 +01:00
parent 988de5b594
commit 7dd31ab609
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
6 changed files with 12 additions and 6 deletions

View File

@ -8,10 +8,11 @@
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_showFull( true )
, m_height( 0 )
, m_wantPreprocess( wantPreprocess )
, m_key( key )
, m_view( view )
, m_worker( worker )

View File

@ -1,6 +1,7 @@
#ifndef __TRACYTIMELINEITEM_HPP__
#define __TRACYTIMELINEITEM_HPP__
#include <assert.h>
#include <stdint.h>
#include "imgui.h"
@ -14,12 +15,15 @@ class Worker;
class TimelineItem
{
public:
TimelineItem( View& view, Worker& worker, const void* key );
TimelineItem( View& view, Worker& worker, const void* key, bool wantPreprocess );
virtual ~TimelineItem() = default;
// 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 );
bool WantPreprocess() const { return m_wantPreprocess; }
virtual void Preprocess() { assert( false ); }
void VisibilityCheckbox();
virtual void SetVisible( bool visible ) { m_visible = visible; }
virtual bool IsVisible() const { return m_visible; }
@ -55,6 +59,7 @@ private:
void AdjustThreadHeight( bool firstFrame, int yBegin, int yEnd );
int m_height;
bool m_wantPreprocess;
const void* m_key;

View File

@ -9,7 +9,7 @@ namespace tracy
{
TimelineItemCpuData::TimelineItemCpuData( View& view, Worker& worker, void* key )
: TimelineItem( view, worker, key )
: TimelineItem( view, worker, key, false )
{
}

View File

@ -10,7 +10,7 @@ namespace tracy
{
TimelineItemGpu::TimelineItemGpu( View& view, Worker& worker, GpuCtxData* gpu )
: TimelineItem( view, worker, gpu )
: TimelineItem( view, worker, gpu, false )
, m_gpu( gpu )
, m_idx( view.GetNextGpuIdx() )
{

View File

@ -9,7 +9,7 @@ namespace tracy
{
TimelineItemPlot::TimelineItemPlot( View& view, Worker& worker, PlotData* plot )
: TimelineItem( view, worker, plot )
: TimelineItem( view, worker, plot, false )
, m_plot( plot )
{
}

View File

@ -12,7 +12,7 @@ namespace tracy
{
TimelineItemThread::TimelineItemThread( View& view, Worker& worker, const ThreadData* thread )
: TimelineItem( view, worker, thread )
: TimelineItem( view, worker, thread, false )
, m_thread( thread )
, m_ghost( false )
{