Skip to content
Snippets Groups Projects
Unverified Commit 2eac155b authored by Sébastien Blin's avatar Sébastien Blin
Browse files

distantrenderer: update frame on rendering stopped and switch

A regression was introduced in c472fe83
where the distantRenderingStopped and setRendererId don't update
the current rendered frame

Change-Id: I5aa477e89ae2031ffd282a2f02ae363dffef569a
GitLab: #269
parent 6a77a27c
No related branches found
No related tags found
No related merge requests found
...@@ -30,13 +30,21 @@ DistantRenderer::DistantRenderer(QQuickItem* parent) ...@@ -30,13 +30,21 @@ DistantRenderer::DistantRenderer(QQuickItem* parent)
setPerformanceHint(QQuickPaintedItem::FastFBOResizing); setPerformanceHint(QQuickPaintedItem::FastFBOResizing);
connect(this, &DistantRenderer::lrcInstanceChanged, [this] { connect(this, &DistantRenderer::lrcInstanceChanged, [this] {
if (lrcInstance_) if (lrcInstance_) {
connect(lrcInstance_->renderer(), connect(lrcInstance_->renderer(),
&RenderManager::distantFrameUpdated, &RenderManager::distantFrameUpdated,
[this](const QString& id) { [this](const QString& id) {
if (distantRenderId_ == id) if (distantRenderId_ == id)
update(QRect(0, 0, width(), height())); update(QRect(0, 0, width(), height()));
}); });
connect(lrcInstance_->renderer(),
&RenderManager::distantRenderingStopped,
[this](const QString& id) {
if (distantRenderId_ == id)
update(QRect(0, 0, width(), height()));
});
}
}); });
} }
...@@ -46,6 +54,8 @@ void ...@@ -46,6 +54,8 @@ void
DistantRenderer::setRendererId(const QString& id) DistantRenderer::setRendererId(const QString& id)
{ {
distantRenderId_ = id; distantRenderId_ = id;
// Note: Force a paint to update frame as we change the renderer
update(QRect(0, 0, width(), height()));
} }
int int
......
...@@ -268,6 +268,11 @@ RenderManager::addDistantRenderer(const QString& id) ...@@ -268,6 +268,11 @@ RenderManager::addDistantRenderer(const QString& id)
[this](const QString& id) { [this](const QString& id) {
Q_EMIT distantFrameUpdated(id); Q_EMIT distantFrameUpdated(id);
}); });
distantConnectionMap_[id].stopped = QObject::connect(dfw.get(),
&FrameWrapper::renderingStopped,
[this](const QString& id) {
Q_EMIT distantRenderingStopped(id);
});
/* /*
* Connect FrameWrapper to avmodel. * Connect FrameWrapper to avmodel.
...@@ -301,6 +306,7 @@ RenderManager::removeDistantRenderer(const QString& id) ...@@ -301,6 +306,7 @@ RenderManager::removeDistantRenderer(const QString& id)
if (dcIt != distantConnectionMap_.end()) { if (dcIt != distantConnectionMap_.end()) {
QObject::disconnect(dcIt->second.started); QObject::disconnect(dcIt->second.started);
QObject::disconnect(dcIt->second.updated); QObject::disconnect(dcIt->second.updated);
QObject::disconnect(dcIt->second.stopped);
} }
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment