From d77c87ae1c6826e3d6ee1c1b2d32b07c1094a792 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 13 Aug 2019 03:28:18 +0200 Subject: [PATCH] Allow disabling context switch drawing. --- server/TracyView.cpp | 16 ++++++++++++---- server/TracyView.hpp | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 8f47a8da..2141d6f6 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -1883,11 +1883,14 @@ void View::DrawZones() offset += ostep; if( showFull ) { - auto ctxSwitch = m_worker.GetContextSwitchData( v->id ); - if( ctxSwitch ) + if( m_drawContextSwitches ) { - DrawContextSwitches( ctxSwitch, pxns, int64_t( nspx ), wpos, offset ); - offset += round( ostep * 0.75f ); + auto ctxSwitch = m_worker.GetContextSwitchData( v->id ); + if( ctxSwitch ) + { + DrawContextSwitches( ctxSwitch, pxns, int64_t( nspx ), wpos, offset ); + offset += round( ostep * 0.75f ); + } } if( m_drawZones ) @@ -5344,6 +5347,11 @@ void View::DrawOptions() ImGui::Checkbox( ICON_FA_EXPAND " Draw empty labels", &m_drawEmptyLabels ); #else ImGui::Checkbox( "Draw empty labels", &m_drawEmptyLabels ); +#endif +#ifdef TRACY_EXTENDED_FONT + ImGui::Checkbox( ICON_FA_HIKING " Draw context switches", &m_drawContextSwitches ); +#else + ImGui::Checkbox( "Draw context switches", &m_drawContextSwitches ); #endif ImGui::Separator(); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 0c330b6f..8ed3c844 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -291,6 +291,7 @@ private: bool m_onlyContendedLocks = true; bool m_goToFrame = false; bool m_drawEmptyLabels = false; + bool m_drawContextSwitches = true; int m_statSort = 0; bool m_statSelf = false;