render: further simplified job times

Outside of silly mistakes, this should be significantly faster and more stable.
This commit is contained in:
itsmattkc
2021-07-12 15:14:37 -07:00
parent dc34f80386
commit c374a03e9d
15 changed files with 300 additions and 190 deletions
+32
View File
@@ -81,6 +81,36 @@ public:
void remove(const TimeRange& remove);
template <typename T>
static void util_remove(QVector<T> *list, const TimeRange &remove)
{
int sz = list->size();
for (int i=0;i<sz;i++) {
T& compare = (*list)[i];
if (remove.Contains(compare)) {
// This element is entirely encompassed in this range, remove it
list->removeAt(i);
i--;
sz--;
} else if (compare.Contains(remove, false, false)) {
// The remove range is within this element, only choice is to split the element into two
T new_range = compare;
new_range.set_in(remove.out());
compare.set_out(remove.in());
list->append(new_range);
break;
} else if (compare.in() < remove.in() && compare.out() > remove.in()) {
// This element's out point overlaps the range's in, we'll trim it
compare.set_out(remove.in());
} else if (compare.in() < remove.out() && compare.out() > remove.out()) {
// This element's in point overlaps the range's out, we'll trim it
compare.set_in(remove.out());
}
}
}
bool contains(const TimeRange& range, bool in_inclusive = true, bool out_inclusive = true) const;
bool isEmpty() const
@@ -156,6 +186,8 @@ public:
bool GetNext(rational *out);
bool HasNext() const;
QVector<rational> ToVector() const
{
TimeRangeListFrameIterator copy(list_, timebase_);