Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
When calling update() on a QSGItem during the sync phase, we did not …
…update.

The QSGCanvas autotest did this.

Reviewed-by: Kim
  • Loading branch information
Gunnar Sletta committed May 12, 2011
1 parent 434eb95 commit 733bacb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/declarative/items/qsgcanvas.cpp
Expand Up @@ -299,7 +299,9 @@ void QSGCanvasPrivate::polishItems()

void QSGCanvasPrivate::syncSceneGraph()
{
inSync = true;
updateDirtyNodes();
inSync = false;
}


Expand Down Expand Up @@ -452,6 +454,7 @@ QSGCanvasPrivate::QSGCanvasPrivate()
, idle(false)
, needsRepaint(true)
, renderThreadAwakened(false)
, inSync(false)
, thread(new MyThread(this))
, animationDriver(0)
{
Expand Down Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions src/declarative/items/qsgcanvas_p.h
Expand Up @@ -163,6 +163,7 @@ class QSGCanvasPrivate : public QGLWidgetPrivate
uint idle : 1; // Set to true when render thread sees no change and enters a wait()
uint needsRepaint : 1; // Set by callback from render if scene needs repainting.
uint renderThreadAwakened : 1;
uint inSync: 1;

struct MyThread : public QThread {
MyThread(QSGCanvasPrivate *r) : renderer(r) {}
Expand Down

0 comments on commit 733bacb

Please sign in to comment.