X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fscopes%2Fcolorscopes%2Fabstractgfxscopewidget.cpp;h=f39963f3e6a1c48ec4cf1dcc66fa2ef6d88f6cd6;hb=8a6e4eb1dea318ecd1c0b313c28b764e89a524c4;hp=430b33190524f4507ba120523c55f2dface65162;hpb=a1f0a54b93ab364a37fd8242c1881c61d066ada7;p=kdenlive diff --git a/src/scopes/colorscopes/abstractgfxscopewidget.cpp b/src/scopes/colorscopes/abstractgfxscopewidget.cpp index 430b3319..f39963f3 100644 --- a/src/scopes/colorscopes/abstractgfxscopewidget.cpp +++ b/src/scopes/colorscopes/abstractgfxscopewidget.cpp @@ -12,18 +12,12 @@ #include "renderer.h" #include "monitormanager.h" -#include -#include -#include -#include #include -#include // Uncomment for debugging. //#define DEBUG_AGSW #ifdef DEBUG_AGSW -#include #endif const int REALTIME_FPS = 30; @@ -37,6 +31,7 @@ AbstractGfxScopeWidget::~AbstractGfxScopeWidget() { } QImage AbstractGfxScopeWidget::renderScope(uint accelerationFactor) { + QMutexLocker lock(&m_mutex); return renderGfxScope(accelerationFactor, m_scopeImage); } @@ -50,9 +45,10 @@ void AbstractGfxScopeWidget::mouseReleaseEvent(QMouseEvent *event) ///// Slots ///// -void AbstractGfxScopeWidget::slotRenderZoneUpdated(QImage frame) +void AbstractGfxScopeWidget::slotRenderZoneUpdated(const QImage &frame) { - m_scopeImage = frame; + QMutexLocker lock(&m_mutex); + m_scopeImage = frame.rgbSwapped(); AbstractScopeWidget::slotRenderZoneUpdated(); } @@ -67,3 +63,5 @@ void AbstractGfxScopeWidget::slotAutoRefreshToggled(bool autoRefresh) #ifdef DEBUG_AGSW #undef DEBUG_AGSW #endif + +#include "abstractgfxscopewidget.moc"