From: Peter Lohrmann Date: Wed, 14 Jan 2015 01:20:21 +0000 (-0800) Subject: glvdebug: Add 'Step' functionality to ReplayWidget X-Git-Tag: sdk-0.1.0~648 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=623f6f5a827e4b4d49dc66710bd13a5e84253c39;p=platform%2Fupstream%2FVulkan-LoaderAndValidationLayers.git glvdebug: Add 'Step' functionality to ReplayWidget * Stepping is enabled initially so that the user can step through the initial API Calls. * Stepping is disabled while the trace is playing, and re-enabled if the replay is paused or stopped. * Stepping is implement by setting the pause flag and then continuing the replay, so that it will pause after replaying a single packet. * As a result of this new feature, Stopping the replay now specifically resets the replay back to packet 0, so that stepping will restart at the beginning of the trace file. --- diff --git a/tools/glave/src/glvdebug/glvdebug_QReplayWidget.h b/tools/glave/src/glvdebug/glvdebug_QReplayWidget.h index 105ecc0..63f0ce6 100755 --- a/tools/glave/src/glvdebug/glvdebug_QReplayWidget.h +++ b/tools/glave/src/glvdebug/glvdebug_QReplayWidget.h @@ -53,6 +53,12 @@ public: m_pToolBar->addWidget(m_pPlayButton); connect(m_pPlayButton, SIGNAL(clicked()), this, SLOT(onPlayButtonClicked())); + m_pStepButton = new QToolButton(m_pToolBar); + m_pStepButton->setText("Step"); + m_pStepButton->setEnabled(true); + m_pToolBar->addWidget(m_pStepButton); + connect(m_pStepButton, SIGNAL(clicked()), this, SLOT(onStepButtonClicked())); + m_pPauseButton = new QToolButton(m_pToolBar); m_pPauseButton->setText("Pause"); m_pPauseButton->setEnabled(false); @@ -75,6 +81,7 @@ public: pLayout->addWidget(m_pReplayWindow); connect(this, SIGNAL(PlayButtonClicked()), m_pWorker, SLOT(StartReplay())); + connect(this, SIGNAL(StepButtonClicked()), m_pWorker, SLOT(StepReplay())); connect(this, SIGNAL(PauseButtonClicked()), m_pWorker, SLOT(PauseReplay())); connect(this, SIGNAL(ContinueButtonClicked()), m_pWorker, SLOT(ContinueReplay())); connect(this, SIGNAL(StopButtonClicked()), m_pWorker, SLOT(StopReplay())); @@ -83,6 +90,7 @@ public: // connect worker signals to widget actions connect(m_pWorker, SIGNAL(ReplayStarted()), this, SLOT(slotReplayStarted())); + connect(m_pWorker, SIGNAL(ReplayStepped()), this, SLOT(slotReplayStepped())); connect(m_pWorker, SIGNAL(ReplayPaused(uint64_t)), this, SLOT(slotReplayPaused(uint64_t))); connect(m_pWorker, SIGNAL(ReplayContinued()), this, SLOT(slotReplayContinued())); connect(m_pWorker, SIGNAL(ReplayStopped(uint64_t)), this, SLOT(slotReplayStopped(uint64_t))); @@ -117,6 +125,7 @@ public: signals: void PlayButtonClicked(); + void StepButtonClicked(); void PauseButtonClicked(); void ContinueButtonClicked(); void StopButtonClicked(); @@ -132,14 +141,22 @@ private slots: void slotReplayStarted() { m_pPlayButton->setEnabled(false); + m_pStepButton->setEnabled(false); m_pPauseButton->setEnabled(true); m_pContinueButton->setEnabled(false); m_pStopButton->setEnabled(true); } + void slotReplayStepped() + { + // treated the same as continue + slotReplayContinued(); + } + void slotReplayPaused(uint64_t) { m_pPlayButton->setEnabled(false); + m_pStepButton->setEnabled(true); m_pPauseButton->setEnabled(false); m_pContinueButton->setEnabled(true); m_pStopButton->setEnabled(false); @@ -148,6 +165,7 @@ private slots: void slotReplayContinued() { m_pPlayButton->setEnabled(false); + m_pStepButton->setEnabled(false); m_pPauseButton->setEnabled(true); m_pContinueButton->setEnabled(false); m_pStopButton->setEnabled(true); @@ -156,6 +174,7 @@ private slots: void slotReplayStopped(uint64_t) { m_pPlayButton->setEnabled(true); + m_pStepButton->setEnabled(true); m_pPauseButton->setEnabled(false); m_pContinueButton->setEnabled(false); m_pStopButton->setEnabled(false); @@ -164,6 +183,7 @@ private slots: void slotReplayFinished() { m_pPlayButton->setEnabled(true); + m_pStepButton->setEnabled(true); m_pPauseButton->setEnabled(false); m_pContinueButton->setEnabled(false); m_pStopButton->setEnabled(false); @@ -175,6 +195,11 @@ public slots: emit PlayButtonClicked(); } + void onStepButtonClicked() + { + emit StepButtonClicked(); + } + void onPauseButtonClicked() { m_pPlayButton->setEnabled(false); @@ -208,6 +233,7 @@ private: QWidget* m_pReplayWindow; QToolBar* m_pToolBar; QToolButton* m_pPlayButton; + QToolButton* m_pStepButton; QToolButton* m_pPauseButton; QToolButton* m_pContinueButton; QToolButton* m_pStopButton; diff --git a/tools/glave/src/glvdebug/glvdebug_QReplayWorker.h b/tools/glave/src/glvdebug/glvdebug_QReplayWorker.h index f8fd570..a44447f 100644 --- a/tools/glave/src/glvdebug/glvdebug_QReplayWorker.h +++ b/tools/glave/src/glvdebug/glvdebug_QReplayWorker.h @@ -179,6 +179,7 @@ protected slots: if (m_bStopReplay) { emit ReplayStopped(m_currentReplayPacketIndex); + m_currentReplayPacketIndex = 0; return; } } @@ -196,6 +197,13 @@ public slots: playCurrentTraceFile(0); } + void StepReplay() + { + emit ReplayContinued(); + m_bPauseReplay = true; + playCurrentTraceFile(m_currentReplayPacketIndex+1); + } + void PauseReplay() { m_bPauseReplay = true;