mirror of
https://github.com/wolfpld/tracy.git
synced 2025-03-20 07:40:02 +08:00
Allow running specific tasks on main thread.
This commit is contained in:
@@ -129,7 +129,7 @@ enum { MinFrameSize = 5 };
|
||||
|
||||
static View* s_instance = nullptr;
|
||||
|
||||
View::View( const char* addr, int port, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, GetWindowCallback gwcb )
|
||||
View::View( void(*cbMainThread)(std::function<void()>), const char* addr, int port, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, GetWindowCallback gwcb )
|
||||
: m_worker( addr, port )
|
||||
, m_staticView( false )
|
||||
, m_pause( false )
|
||||
@@ -142,6 +142,7 @@ View::View( const char* addr, int port, ImFont* fixedWidth, ImFont* smallFont, I
|
||||
, m_stcb( stcb )
|
||||
, m_gwcb( gwcb )
|
||||
, m_userData()
|
||||
, m_cbMainThread( cbMainThread )
|
||||
{
|
||||
assert( s_instance == nullptr );
|
||||
s_instance = this;
|
||||
@@ -149,7 +150,7 @@ View::View( const char* addr, int port, ImFont* fixedWidth, ImFont* smallFont, I
|
||||
InitTextEditor( fixedWidth );
|
||||
}
|
||||
|
||||
View::View( FileRead& f, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, GetWindowCallback gwcb )
|
||||
View::View( void(*cbMainThread)(std::function<void()>), FileRead& f, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont, SetTitleCallback stcb, GetWindowCallback gwcb )
|
||||
: m_worker( f )
|
||||
, m_filename( f.GetFilename() )
|
||||
, m_staticView( true )
|
||||
@@ -161,6 +162,7 @@ View::View( FileRead& f, ImFont* fixedWidth, ImFont* smallFont, ImFont* bigFont,
|
||||
, m_stcb( stcb )
|
||||
, m_gwcb( gwcb )
|
||||
, m_userData( m_worker.GetCaptureProgram().c_str(), m_worker.GetCaptureTime() )
|
||||
, m_cbMainThread( cbMainThread )
|
||||
{
|
||||
assert( s_instance == nullptr );
|
||||
s_instance = this;
|
||||
|
||||
Reference in New Issue
Block a user