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
+8 -1
View File
@@ -49,6 +49,13 @@ void WaveformScope::SetBuffer(Frame *frame)
UploadTextureFromBuffer();
}
void WaveformScope::showEvent(QShowEvent* e)
{
ManagedDisplayWidget::showEvent(e);
UploadTextureFromBuffer();
}
void WaveformScope::initializeGL()
{
ManagedDisplayWidget::initializeGL();
@@ -93,7 +100,7 @@ void WaveformScope::paintGL()
void WaveformScope::UploadTextureFromBuffer()
{
if (!buffer_) {
if (!buffer_ || !isVisible()) {
return;
}