aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp10
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp9
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop_p.h1
3 files changed, 20 insertions, 0 deletions
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index 6f83085745..f5234bbf5e 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -191,6 +191,7 @@ public:
QSGRenderContext *rc;
QImage grabContent;
+ bool m_inPolish = false;
};
#endif
@@ -591,7 +592,9 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
Q_TRACE(QSG_polishItems_entry);
Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphPolishFrame);
+ m_inPolish = true;
cd->polishItems();
+ m_inPolish = false;
if (profileFrames)
polishTime = renderTimer.nsecsElapsed();
@@ -782,6 +785,13 @@ void QSGGuiThreadRenderLoop::maybeUpdate(QQuickWindow *window)
if (!cd->isRenderable())
return;
+ // An updatePolish() implementation may call update() to get the QQuickItem
+ // dirtied. That's fine but it also leads to calling this function.
+ // Requesting another update is a waste then since the updatePolish() call
+ // will be followed up with a round of sync and render.
+ if (m_inPolish)
+ return;
+
window->requestUpdate();
}
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index a4524b5b33..a47aa4f359 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -1401,6 +1401,13 @@ void QSGThreadedRenderLoop::maybeUpdate(Window *w)
return;
}
+ // An updatePolish() implementation may call update() to get the QQuickItem
+ // dirtied. That's fine but it also leads to calling this function.
+ // Requesting another update is a waste then since the updatePolish() call
+ // will be followed up with a round of sync and render.
+ if (m_inPolish)
+ return;
+
postUpdateRequest(w);
}
@@ -1507,7 +1514,9 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w, bool inExpose)
Q_TRACE(QSG_polishItems_entry);
QQuickWindowPrivate *d = QQuickWindowPrivate::get(window);
+ m_inPolish = true;
d->polishItems();
+ m_inPolish = false;
if (profileFrames)
polishTime = timer.nsecsElapsed();
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop_p.h b/src/quick/scenegraph/qsgthreadedrenderloop_p.h
index 60d3e7781d..1a99cc7ddf 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop_p.h
+++ b/src/quick/scenegraph/qsgthreadedrenderloop_p.h
@@ -134,6 +134,7 @@ private:
int m_animation_timer;
bool m_lockedForSync;
+ bool m_inPolish = false;
};
QT_END_NAMESPACE