aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgcanvas.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@nokia.com>2011-05-12 12:54:54 +0200
committerGunnar Sletta <gunnar.sletta@nokia.com>2011-05-12 12:56:49 +0200
commit733bacbcf92e402688e9d4b2ab23fab19c13f715 (patch)
treee1336b26bab41bea4f07a26d4007b412043bdd15 /src/declarative/items/qsgcanvas.cpp
parent434eb95e65b97809ec7aeca042bf76071dd17993 (diff)
When calling update() on a QSGItem during the sync phase, we did not update.
The QSGCanvas autotest did this. Reviewed-by: Kim
Diffstat (limited to 'src/declarative/items/qsgcanvas.cpp')
-rw-r--r--src/declarative/items/qsgcanvas.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp
index 895cc16299..6214da65c7 100644
--- a/src/declarative/items/qsgcanvas.cpp
+++ b/src/declarative/items/qsgcanvas.cpp
@@ -299,7 +299,9 @@ void QSGCanvasPrivate::polishItems()
void QSGCanvasPrivate::syncSceneGraph()
{
+ inSync = true;
updateDirtyNodes();
+ inSync = false;
}
@@ -452,6 +454,7 @@ QSGCanvasPrivate::QSGCanvasPrivate()
, idle(false)
, needsRepaint(true)
, renderThreadAwakened(false)
+ , inSync(false)
, thread(new MyThread(this))
, animationDriver(0)
{
@@ -1851,6 +1854,12 @@ void QSGCanvas::maybeUpdate()
qWarning("QSGRenderer: now maybe I should update...");
#endif
d->wait.wakeOne();
+ } else if (d->inSync) {
+ // If we are in sync (on scene graph thread) someone has explicitely asked us
+ // to redraw, hence we tell the render loop to not go idle.
+ // The primary usecase for this is updatePaintNode() calling update() without
+ // changing the scene graph.
+ d->needsRepaint = true;
}
if (locked)
d->mutex.unlock();