renderer: use qvectors instead of qlists
Should be much more efficient for large-scale projects.
This commit is contained in:
@@ -113,15 +113,15 @@ void RenderBackend::ClearVideoQueue()
|
||||
render_queue_.clear();
|
||||
}
|
||||
|
||||
QFuture<QList<QByteArray> > RenderBackend::Hash(const QList<rational> ×)
|
||||
QFuture<QVector<QByteArray> > RenderBackend::Hash(const QVector<rational> ×)
|
||||
{
|
||||
return QtConcurrent::run(&pool_, [this](const QList<rational> ×){
|
||||
QList<QByteArray> hashes;
|
||||
return QtConcurrent::run(&pool_, [this](const QVector<rational> ×){
|
||||
QVector<QByteArray> hashes(times.size());
|
||||
|
||||
foreach (const rational& t, times) {
|
||||
hashes.append(HashNode(copied_viewer_node_->texture_input()->get_connected_node(),
|
||||
video_params_,
|
||||
t));
|
||||
for (int i=0;i<hashes.size();i++) {
|
||||
hashes[i] = HashNode(copied_viewer_node_->texture_input()->get_connected_node(),
|
||||
video_params_,
|
||||
times.at(i));
|
||||
}
|
||||
|
||||
return hashes;
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
/**
|
||||
* @brief Asynchronously generate a hash at a given time
|
||||
*/
|
||||
QFuture<QList<QByteArray> > Hash(const QList<rational>& times);
|
||||
QFuture<QVector<QByteArray> > Hash(const QVector<rational> ×);
|
||||
|
||||
/**
|
||||
* @brief Asynchronously generate a frame at a given time
|
||||
|
||||
@@ -139,9 +139,9 @@ QString FrameHashCache::GetFormatExtension()
|
||||
return QStringLiteral(".exr");
|
||||
}
|
||||
|
||||
QList<rational> FrameHashCache::GetFrameListFromTimeRange(TimeRangeList range_list, const rational &timebase)
|
||||
QVector<rational> FrameHashCache::GetFrameListFromTimeRange(TimeRangeList range_list, const rational &timebase)
|
||||
{
|
||||
QList<rational> times;
|
||||
QVector<rational> times;
|
||||
|
||||
while (!range_list.isEmpty()) {
|
||||
const TimeRange& range = range_list.first();
|
||||
@@ -164,14 +164,14 @@ QList<rational> FrameHashCache::GetFrameListFromTimeRange(TimeRangeList range_li
|
||||
return times;
|
||||
}
|
||||
|
||||
QList<rational> FrameHashCache::GetFrameListFromTimeRange(const TimeRangeList &range)
|
||||
QVector<rational> FrameHashCache::GetFrameListFromTimeRange(const TimeRangeList &range)
|
||||
{
|
||||
QMutexLocker locker(lock());
|
||||
|
||||
return GetFrameListFromTimeRange(range, timebase_);
|
||||
}
|
||||
|
||||
QList<rational> FrameHashCache::GetInvalidatedFrames()
|
||||
QVector<rational> FrameHashCache::GetInvalidatedFrames()
|
||||
{
|
||||
QMutexLocker locker(lock());
|
||||
|
||||
|
||||
@@ -68,9 +68,9 @@ public:
|
||||
|
||||
static QString GetFormatExtension();
|
||||
|
||||
static QList<rational> GetFrameListFromTimeRange(TimeRangeList range_list, const rational& timebase);
|
||||
QList<rational> GetFrameListFromTimeRange(const TimeRangeList &range);
|
||||
QList<rational> GetInvalidatedFrames();
|
||||
static QVector<rational> GetFrameListFromTimeRange(TimeRangeList range_list, const rational& timebase);
|
||||
QVector<rational> GetFrameListFromTimeRange(const TimeRangeList &range);
|
||||
QVector<rational> GetInvalidatedFrames();
|
||||
|
||||
protected:
|
||||
virtual void LengthChangedEvent(const rational& old, const rational& newlen) override;
|
||||
|
||||
Reference in New Issue
Block a user