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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user