scopes: only update if visible

Updating scopes can require heavy processing so we limit updates to only
when the scope is visible
This commit is contained in:
itsmattkc
2020-04-28 23:55:40 +10:00
parent ad419754a9
commit 61dd75a2ed
4 changed files with 22 additions and 2 deletions
+10 -1
View File
@@ -49,7 +49,9 @@ void HistogramScope::SetBuffer(Frame* frame)
{
buffer_ = frame;
StartUpdate();
if (isVisible()) {
StartUpdate();
}
}
void HistogramScope::FinishedProcessing(QVector<double> red, QVector<double> green, QVector<double> blue)
@@ -111,6 +113,13 @@ void HistogramScope::StartUpdate()
}
}
void HistogramScope::showEvent(QShowEvent* e)
{
ManagedDisplayWidget::showEvent(e);
StartUpdate();
}
HistogramScopeWorker::HistogramScopeWorker() :
cancelled_(false)
{