previousUpdateScene( false ),
renderTaskWaiting( false ),
renderersAdded( false ),
- surfaceRectChanged( false ),
- renderingRequired( false )
+ surfaceRectChanged( false )
{
sceneController = new SceneControllerImpl( renderMessageDispatcher, renderQueue, discardQueue );
bool renderTaskWaiting; ///< A REFRESH_ONCE render task is waiting to be rendered
bool renderersAdded; ///< Flag to keep track when renderers have been added to avoid unnecessary processing
bool surfaceRectChanged; ///< True if the default surface rect is changed
- bool renderingRequired; ///< True if required to render the current frame
private:
return gestureUpdated;
}
-bool UpdateManager::Animate( BufferIndex bufferIndex, float elapsedSeconds )
+void UpdateManager::Animate( BufferIndex bufferIndex, float elapsedSeconds )
{
- bool animationActive = false;
-
auto&& iter = mImpl->animations.Begin();
bool animationLooped = false;
bool progressMarkerReached = false;
animation->Update( bufferIndex, elapsedSeconds, looped, finished, progressMarkerReached );
- animationActive = animationActive || animation->IsActive();
-
if ( progressMarkerReached )
{
mImpl->notificationManager.QueueMessage( Internal::NotifyProgressReachedMessage( mImpl->animationPlaylist, animation ) );
// The application should be notified by NotificationManager, in another thread
mImpl->notificationManager.QueueCompleteNotification( &mImpl->animationPlaylist );
}
-
- return animationActive;
}
void UpdateManager::ConstrainCustomObjects( BufferIndex bufferIndex )
//Apply constraints
ConstrainPropertyOwner( *renderer, bufferIndex );
- mImpl->renderingRequired = renderer->PrepareRender( bufferIndex ) || mImpl->renderingRequired;
+ renderer->PrepareRender( bufferIndex );
}
}
//Clear nodes/resources which were previously discarded
mImpl->discardQueue.Clear( bufferIndex );
- bool isAnimationRunning = IsAnimationRunning();
-
//Process Touches & Gestures
const bool gestureUpdated = ProcessGestures( bufferIndex, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds );
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
+ IsAnimationRunning() || // ..at least one animation is running OR
mImpl->messageQueue.IsSceneUpdateRequired() || // ..a message that modifies the scene graph node tree is queued OR
mImpl->frameCallbackProcessor || // ..a frame callback processor is existed OR
gestureUpdated; // ..a gesture property was updated
bool keepRendererRendering = false;
- mImpl->renderingRequired = false;
// Although the scene-graph may not require an update, we still need to synchronize double-buffered
// values if the scene was updated in the previous frame.
if( updateScene || mImpl->previousUpdateScene )
{
//Animate
- bool animationActive = Animate( bufferIndex, elapsedSeconds );
+ Animate( bufferIndex, elapsedSeconds );
//Constraint custom objects
ConstrainCustomObjects( bufferIndex );
UpdateRenderers( bufferIndex );
//Update the transformations of all the nodes
- if ( mImpl->transformManager.Update() )
- {
- mImpl->nodeDirtyFlags |= NodePropertyFlags::TRANSFORM;
- }
+ mImpl->transformManager.Update();
//Process Property Notifications
ProcessPropertyNotifications( bufferIndex );
}
}
+
std::size_t numberOfRenderInstructions = 0;
for ( auto&& scene : mImpl->scenes )
{
scene->scene->GetRenderInstructions().ResetAndReserve( bufferIndex,
static_cast<uint32_t>( scene->taskList->GetTasks().Count() ) );
- // If there are animations running, only add render instruction if at least one animation is currently active (i.e. not delayed)
- // or the nodes are dirty
- if ( !isAnimationRunning || animationActive || mImpl->renderingRequired || (mImpl->nodeDirtyFlags & RenderableUpdateFlags) )
- {
- keepRendererRendering |= mImpl->renderTaskProcessor.Process( bufferIndex,
- *scene->taskList,
- *scene->root,
- scene->sortedLayerList,
- scene->scene->GetRenderInstructions(),
- renderToFboEnabled,
- isRenderingToFbo );
-
- }
+ keepRendererRendering |= mImpl->renderTaskProcessor.Process( bufferIndex,
+ *scene->taskList,
+ *scene->root,
+ scene->sortedLayerList,
+ scene->scene->GetRenderInstructions(),
+ renderToFboEnabled,
+ isRenderingToFbo );
numberOfRenderInstructions += scene->scene->GetRenderInstructions().Count( bufferIndex );
}
mImpl->renderingBehavior = renderingBehavior;
}
-void UpdateManager::RequestRendering()
-{
- mImpl->renderingRequired = true;
-}
-
void UpdateManager::SetLayerDepths( const SortedLayerPointers& layers, const Layer* rootLayer )
{
for ( auto&& scene : mImpl->scenes )