Make QSGCanvas::grabFrameBuffer() more reliable
authorAaron Kennedy <aaron.kennedy@nokia.com>
Wed, 22 Jun 2011 01:20:43 +0000 (11:20 +1000)
committerAaron Kennedy <aaron.kennedy@nokia.com>
Wed, 22 Jun 2011 03:04:55 +0000 (13:04 +1000)
src/declarative/items/qsgcanvas.cpp

index a27b14b..0500b75 100644 (file)
@@ -2096,7 +2096,7 @@ void QSGCanvasRenderThread::run()
         // but we don't want to lock an extra time.
         wake();
 
-        if (!d->animationRunning && !isExternalUpdatePending && !shouldExit) {
+        if (!d->animationRunning && !isExternalUpdatePending && !shouldExit && !doGrab) {
 #ifdef THREAD_DEBUG
             printf("                RenderThread: nothing to do, going to sleep...\n");
 #endif
@@ -2335,7 +2335,7 @@ QImage QSGCanvasRenderThread::grab()
     doGrab = true;
     isPaintCompleted = false;
     while (isRunning() && !isPaintCompleted) {
-        if (!isRenderBlocked)
+        if (isRenderBlocked)
             wake();
         wait();
     }