renderer: share render backend for auto-cache tasks

Since auto-cache events start and stop fairly frequently (and are somewhat
heavy to create/destroy), we can save a lot of cycles over time by sharing
the same backend between them all.
This commit is contained in:
itsmattkc
2020-07-06 14:22:17 +10:00
parent 936d077077
commit a45f514f68
8 changed files with 128 additions and 58 deletions
+19
View File
@@ -537,6 +537,25 @@ bool Node::OutputsTo(const QString &id, bool recursively) const
return false;
}
bool Node::OutputsTo(NodeInput *input, bool recursively) const
{
QList<NodeOutput*> outputs = GetOutputs();
foreach (NodeOutput* output, outputs) {
foreach (NodeEdgePtr edge, output->edges()) {
NodeInput* connected = edge->input();
if (connected == input) {
return true;
} else if (recursively && connected->parentNode()->OutputsTo(input, recursively)) {
return true;
}
}
}
return false;
}
bool Node::InputsFrom(Node *n, bool recursively) const
{
QList<NodeInput*> inputs = GetInputsIncludingArrays();