Add an exhaust delay to QSGGuiThreadRenderLoop. Some updates
may be done with posted events, and maybeUpdate event competed
with those, leading to partial updates and frames drawn twice.
Change-Id: I532bff692c597eeba5bbd6def89ae68c80fdd69b
Done-with: Mikko Harju <mikko.harju@jollamobile.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
QSGRenderContext *rc;
QImage grabContent;
+ int m_update_timer;
bool eventPending;
};
m_windows[window].updatePending = true;
if (!eventPending) {
- QCoreApplication::postEvent(this, new QEvent(QEvent::User));
+ const int exhaust_delay = 5;
+ m_update_timer = startTimer(exhaust_delay, Qt::PreciseTimer);
eventPending = true;
}
}
bool QSGGuiThreadRenderLoop::event(QEvent *e)
{
- if (e->type() == QEvent::User) {
+ if (e->type() == QEvent::Timer) {
eventPending = false;
+ killTimer(m_update_timer);
+ m_update_timer = 0;
for (QHash<QQuickWindow *, WindowData>::const_iterator it = m_windows.constBegin();
it != m_windows.constEnd(); ++it) {
const WindowData &data = it.value();