//Process Touches & Gestures
const bool gestureUpdated = ProcessGestures( bufferIndex, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds );
- const bool updateScene = // The scene-graph requires an update if..
+ bool updateScene = // The scene-graph requires an update if..
(mImpl->nodeDirtyFlags & RenderableUpdateFlags) || // ..nodes were dirty in previous frame OR
IsAnimationRunning() || // ..at least one animation is running OR
mImpl->messageQueue.IsSceneUpdateRequired() || // ..a message that modifies the scene graph node tree is queued OR
mImpl->transformManager.ResetToBaseValue();
}
- //Process the queued scene messages
- mImpl->messageQueue.ProcessMessages( bufferIndex );
+ // Process the queued scene messages. Note, MessageQueue::FlushQueue may be called
+ // between calling IsSceneUpdateRequired() above and here, so updateScene should
+ // be set again
+ updateScene |= mImpl->messageQueue.ProcessMessages( bufferIndex );
//Post Process Ids of resources updated by renderer
mImpl->resourceManager.PostProcessResources( bufferIndex );
void MessageQueue::EventProcessingStarted()
{
- mImpl->processingEvents = true;
+ mImpl->processingEvents = true; // called from event thread
}
+// Called from event thread
unsigned int* MessageQueue::ReserveMessageSlot( unsigned int requestedSize, bool updateScene )
{
DALI_ASSERT_DEBUG( 0 != requestedSize );
return mImpl->currentMessageBuffer->ReserveMessageSlot( requestedSize );
}
+// Called from event thread
bool MessageQueue::FlushQueue()
{
const bool messagesToProcess = ( NULL != mImpl->currentMessageBuffer );
return messagesToProcess;
}
-void MessageQueue::ProcessMessages( BufferIndex updateBufferIndex )
+bool MessageQueue::ProcessMessages( BufferIndex updateBufferIndex )
{
PERF_MONITOR_START(PerformanceMonitor::PROCESS_MESSAGES);
mImpl->processQueue.clear();
PERF_MONITOR_END(PerformanceMonitor::PROCESS_MESSAGES);
+
+ return ( mImpl->sceneUpdate & 0x01 ); // if it was previously 2, scene graph was updated.
}
bool MessageQueue::WasEmpty() const
/**
* Called once per update; process the previously flushed messages.
* @param updateBufferIndex to use
+ * @return true if the scene graph node tree is updated
*/
- void ProcessMessages( BufferIndex updateBufferIndex );
+ bool ProcessMessages( BufferIndex updateBufferIndex );
/**
* Query whether the queue was empty this frame.