Qt: Refactor and fix dequeueAll so keep mode keeps last draw tex too

This commit is contained in:
Vicki Pfau 2022-12-17 00:21:07 -08:00
parent 0ac446beda
commit 83578d915b
1 changed files with 13 additions and 7 deletions

View File

@ -861,17 +861,23 @@ void PainterGL::dequeueAll(bool keep) {
m_free.append(buffer);
}
}
m_queueTex.clear();
m_freeTex.clear();
for (auto tex : m_bridgeTexes) {
m_freeTex.enqueue(tex);
}
m_bridgeTexIn = m_freeTex.dequeue();
m_bridgeTexOut = std::numeric_limits<GLuint>::max();
if (m_buffer && !keep) {
m_free.append(m_buffer);
m_buffer = nullptr;
}
m_queueTex.clear();
m_freeTex.clear();
for (auto tex : m_bridgeTexes) {
if (keep && tex == m_bridgeTexIn) {
continue;
}
m_freeTex.enqueue(tex);
}
if (!keep) {
m_bridgeTexIn = m_freeTex.dequeue();
m_bridgeTexOut = std::numeric_limits<GLuint>::max();
}
}
void PainterGL::setVideoProxy(std::shared_ptr<VideoProxy> proxy) {