adjusted invalidatecache function

This commit is contained in:
itsmattkc
2019-09-02 20:11:42 +10:00
parent e87ed9dd3d
commit 3a9af58344
11 changed files with 68 additions and 30 deletions
+4 -3
View File
@@ -102,6 +102,9 @@ void Block::EdgeAddedSlot(NodeEdgePtr edge)
// The blocks surrounding this one have changed, we need to Refresh()
RefreshFollowing();
// Entire track will have shifted, so the whole cache needs to be re-validated
InvalidateCache(0, RATIONAL_MAX);
}
}
@@ -127,8 +130,6 @@ void Block::Refresh()
// Update out point by adding this clip's length to the just calculated in point
out_point_ = in_point_ + length();
InvalidateCache(nullptr, in_point_, out_point_);
emit Refreshed();
}
@@ -176,7 +177,7 @@ void Block::set_media_in(const rational &media_in)
media_in_ = media_in;
// Signal that this clips contents have changed
InvalidateCache(nullptr, in(), out());
InvalidateCache(in(), out());
}
}
+3 -3
View File
@@ -86,7 +86,7 @@ QVariant ClipBlock::Value(NodeOutput* param, const rational& time)
return Block::Value(param, time);
}
void ClipBlock::InvalidateCache(NodeInput *from, const rational &start_range, const rational &end_range)
void ClipBlock::InvalidateCache(const rational &start_range, const rational &end_range, NodeInput *from)
{
// If signal is from texture input, transform all times from media time to sequence time
if (from == texture_input_) {
@@ -97,10 +97,10 @@ void ClipBlock::InvalidateCache(NodeInput *from, const rational &start_range, co
start = qMax(start, in());
end = qMin(end, out());
Node::InvalidateCache(from, start, end);
Node::InvalidateCache(start, end, from);
} else {
// Otherwise, pass signal along normally
Node::InvalidateCache(from, start_range, end_range);
Node::InvalidateCache(start_range, end_range, from);
}
}
+1 -1
View File
@@ -42,7 +42,7 @@ public:
NodeInput* texture_input();
virtual void InvalidateCache(NodeInput *from, const rational &start_range, const rational &end_range) override;
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;