fixes jitters by using signals/slots to pass image buffers around
Updating values rapidly would cause strange jitters as a byproduct of the viewer trying to update from the renderer while it was still working. Rather than the viewer trying to access the the renderer, we now send textures in the initial update signal to keep everything synchronized.
This commit is contained in:
@@ -29,9 +29,9 @@ void VideoRenderWorker::RenderInternal(const NodeDependency& path)
|
||||
emit HashAlreadyExists(path, hash);
|
||||
} else if (frame_cache_->TryCache(hash)) {
|
||||
// This hash is available for us to cache, start traversing graph
|
||||
RenderAsSibling(path);
|
||||
QVariant value = RenderAsSibling(path);
|
||||
|
||||
emit CompletedFrame(path, hash);
|
||||
emit CompletedFrame(path, hash, value);
|
||||
} else {
|
||||
// Another thread must be caching this already, nothing to be done
|
||||
emit HashAlreadyBeingCached();
|
||||
@@ -115,7 +115,7 @@ void VideoRenderWorker::CloseInternal()
|
||||
download_buffer_.clear();
|
||||
}
|
||||
|
||||
void VideoRenderWorker::RenderAsSibling(NodeDependency dep)
|
||||
QVariant VideoRenderWorker::RenderAsSibling(NodeDependency dep)
|
||||
{
|
||||
NodeOutput* output = dep.node();
|
||||
Node* original_node = output->parent();
|
||||
@@ -158,6 +158,8 @@ void VideoRenderWorker::RenderAsSibling(NodeDependency dep)
|
||||
|
||||
// End this working state
|
||||
working_--;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
void VideoRenderWorker::Download(NodeDependency dep, QByteArray hash, QVariant texture, QString filename)
|
||||
|
||||
Reference in New Issue
Block a user