/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
GestureManager& gestureManager, ResourcePolicy::DataRetention dataRetentionPolicy)
: mRenderController( renderController ),
mPlatform(platform),
- mIsActive(true),
mProcessingEvent(false)
{
// Create the thread local storage
mRenderManager->SetShaderSaver( *mUpdateManager );
- mStage = IntrusivePtr<Stage>( Stage::New( *mAnimationPlaylist, *mPropertyNotificationManager, *mUpdateManager, *mNotificationManager ) );
+ mStage = IntrusivePtr<Stage>( Stage::New( *mAnimationPlaylist, *mPropertyNotificationManager, *mUpdateManager, *mNotificationManager, mRenderController ) );
// This must be called after stage is created but before stage initialization
mRelayoutController = IntrusivePtr< RelayoutController >( new RelayoutController( mRenderController ) );
mStage->Initialize();
- mGestureEventProcessor = new GestureEventProcessor(*mStage, gestureManager, mRenderController);
- mEventProcessor = new EventProcessor(*mStage, *mNotificationManager, *mGestureEventProcessor);
+ mGestureEventProcessor = new GestureEventProcessor( *mStage, *mUpdateManager, gestureManager, mRenderController );
+ mEventProcessor = new EventProcessor( *mStage, *mNotificationManager, *mGestureEventProcessor );
mShaderFactory = new ShaderFactory();
mUpdateManager->SetShaderSaver( *mShaderFactory );
void Core::Render( RenderStatus& status )
{
- bool updateRequired = mRenderManager->Render( status );
-
- status.SetNeedsUpdate( updateRequired );
-}
-
-void Core::Suspend()
-{
- mIsActive = false;
-}
-
-void Core::Resume()
-{
- mIsActive = true;
-
- // trigger processing of events queued up while paused
- ProcessEvents();
+ mRenderManager->Render( status );
}
void Core::SceneCreated()
if( mProcessingEvent )
{
DALI_LOG_ERROR( "ProcessEvents should not be called from within ProcessEvents!\n" );
- mRenderController.RequestProcessEventsOnIdle();
+ mRenderController.RequestProcessEventsOnIdle( false );
return;
}
mNotificationManager->ProcessMessages();
- // Avoid allocating MessageBuffers, triggering size-negotiation or sending any other spam whilst paused
- if( mIsActive )
- {
- // Emit signal here to inform listeners that event processing has finished.
- mStage->EmitEventProcessingFinishedSignal();
+ // Emit signal here to inform listeners that event processing has finished.
+ mStage->EmitEventProcessingFinishedSignal();
- // Run the size negotiation after event processing finished signal
- mRelayoutController->Relayout();
+ // Run the size negotiation after event processing finished signal
+ mRelayoutController->Relayout();
- // Flush any queued messages for the update-thread
- const bool messagesToProcess = mUpdateManager->FlushQueue();
+ // Rebuild depth tree after event processing has finished
+ mStage->RebuildDepthTree();
- // Check if the touch or gestures require updates.
- const bool gestureNeedsUpdate = mGestureEventProcessor->NeedsUpdate();
+ // Flush any queued messages for the update-thread
+ const bool messagesToProcess = mUpdateManager->FlushQueue();
- if( messagesToProcess || gestureNeedsUpdate )
- {
- // tell the render controller to keep update thread running
- mRenderController.RequestUpdate();
- }
+ // Check if the touch or gestures require updates.
+ const bool gestureNeedsUpdate = mGestureEventProcessor->NeedsUpdate();
+ // Check if the next update is forced.
+ const bool forceUpdate = mStage->IsNextUpdateForced();
+
+ if( messagesToProcess || gestureNeedsUpdate || forceUpdate )
+ {
+ // tell the render controller to keep update thread running
+ mRenderController.RequestUpdate( forceUpdate );
}
mRelayoutController->SetProcessingCoreEvents( false );