removed another unnecessary node function

This commit is contained in:
itsmattkc
2019-11-02 18:12:54 +11:00
parent 16ac2fc0e1
commit 788502cd11
8 changed files with 27 additions and 72 deletions
-11
View File
@@ -79,17 +79,6 @@ void ClipBlock::InvalidateCache(const rational &start_range, const rational &end
}
}
QList<NodeDependency> ClipBlock::RunDependencies(NodeOutput *output, const rational &time)
{
QList<NodeDependency> deps;
if (output == buffer_output() && texture_input_->IsConnected()) {
deps.append(NodeDependency(texture_input_->get_connected_output(), SequenceToMediaTime(time), SequenceToMediaTime(time)));
}
return deps;
}
TimeRange ClipBlock::InputTimeAdjustment(NodeInput *input, const TimeRange &input_time)
{
if (input == texture_input_) {
-2
View File
@@ -44,8 +44,6 @@ public:
virtual void InvalidateCache(const rational &start_range, const rational &end_range, NodeInput *from = nullptr) override;
virtual QList<NodeDependency> RunDependencies(NodeOutput *output, const rational &time) override;
virtual TimeRange InputTimeAdjustment(NodeInput* input, const TimeRange& input_time) override;
private:
-24
View File
@@ -290,30 +290,6 @@ QString Node::Code(NodeOutput *output)
return QString();
}
QList<NodeDependency> Node::RunDependencies(NodeOutput *output, const rational &time)
{
Q_UNUSED(output)
QList<NodeDependency> run_deps;
foreach (NodeParam* p, params_) {
if (p->type() == NodeParam::kInput) {
NodeInput* input = static_cast<NodeInput*>(p);
// Check if Node is dependent on this input or not
if (input->dependent()) {
NodeOutput* potential_dep = input->get_connected_output();
if (potential_dep != nullptr) {
run_deps.append(NodeDependency(potential_dep, time, time));
}
}
}
}
return run_deps;
}
bool Node::OutputsTo(Node *n)
{
foreach (NodeParam* param, params_) {
-7
View File
@@ -129,13 +129,6 @@ public:
*/
virtual QString Code(NodeOutput* output);
/**
* @brief For nodes that have different dependencies at different times, this function can be used for that purpose
*
* Only retrieves immmediate dependencies, meaning only nodes that are directly
*/
virtual QList<NodeDependency> RunDependencies(NodeOutput* output, const rational& time);
/**
* @brief Returns whether this Node outputs data to the Node `n` in any way
*/
-15
View File
@@ -122,21 +122,6 @@ void TrackOutput::SetIndex(const int &index)
index_ = index;
}
QList<NodeDependency> TrackOutput::RunDependencies(NodeOutput* output, const rational &time)
{
QList<NodeDependency> deps;
if (output == buffer_output()) {
ValidateCurrentBlock(time);
if (current_block_ != this) {
deps.append(NodeDependency(current_block_->buffer_output(), time, time));
}
}
return deps;
}
TrackOutput *TrackOutput::next_track()
{
return ValueToPtr<TrackOutput>(track_input_->get_realtime_value_of_connected_output());
-5
View File
@@ -50,11 +50,6 @@ public:
const int& Index();
void SetIndex(const int& index);
/**
* @brief Override swaps "attached block" with "current block"
*/
virtual QList<NodeDependency> RunDependencies(NodeOutput* param, const rational& time) override;
TrackOutput* next_track();
NodeInput* track_input();
+26 -7
View File
@@ -62,24 +62,25 @@ void OpenGLWorker::Render(const NodeDependency &path)
NodeOutput* output = path.node();
Node* node = output->parent();
QList<Node*> all_deps = node->GetDependencies();
QList<Node*> all_nodes_in_graph;
all_nodes_in_graph.append(node);
all_nodes_in_graph.append(node->GetDependencies());
// Lock all Nodes to prevent UI changes during this render
foreach (Node* dep, all_deps) {
foreach (Node* dep, all_nodes_in_graph) {
dep->LockUserInput();
}
node->LockUserInput();
// FIXME: Write traversal code
// Start traversing graph
RenderAsSibling(path);
// Start OpenGL flushing now while we do clean up work on the CPU
functions_->glFlush();
// Unlock all Nodes so changes can be made again
foreach (Node* dep, all_deps) {
foreach (Node* dep, all_nodes_in_graph) {
dep->UnlockUserInput();
}
node->UnlockUserInput();
// Now we need the texture done so we call glFinish()
functions_->glFinish();
@@ -112,6 +113,24 @@ void OpenGLWorker::FinishInit()
qDebug() << "Context in" << ctx_->thread() << "successfully finished";
}
void OpenGLWorker::RenderAsSibling(const NodeDependency &)
void OpenGLWorker::RenderAsSibling(const NodeDependency &dep)
{
NodeOutput* output = dep.node();
Node* node = output->parent();
node->LockProcessing();
// Check if block
// If yes, traverse previous and next until we find the right block
// Check all inputs for ones that are dependents
// If input is NOT connected, set stored value to keyframe at time
// Some inputs we handle ourselves such as FOOTAGE
// If input IS connected, we need to traverse down it
// If more than one input is connected, signal out for a sibling to handle it
// Keep iterating inputs until all are up to date
// Finally get value from output
// If we have shader code, the output is a texture and we handle the I/O
// If we don't, the output is some other value and the Node will produce the output
node->UnlockProcessing();
}
+1 -1
View File
@@ -71,7 +71,7 @@ private:
private slots:
void FinishInit();
void RenderAsSibling(const NodeDependency& path);
void RenderAsSibling(const NodeDependency& dep);
};
#endif // OPENGLPROCESSOR_H