#include <dali/internal/event/common/notification-manager.h>
#include <dali/internal/event/common/property-notification-impl.h>
#include <dali/internal/event/common/property-notifier.h>
-#include <dali/internal/event/animation/animation-finished-notifier.h>
-#include <dali/internal/event/render-tasks/render-task-list-impl.h>
#include <dali/internal/update/animation/scene-graph-animator.h>
#include <dali/internal/update/animation/scene-graph-animation.h>
#include <dali/internal/update/common/discard-queue.h>
-#include <dali/internal/update/common/double-buffered.h>
#include <dali/internal/update/manager/prepare-render-algorithms.h>
#include <dali/internal/update/manager/process-render-tasks.h>
#include <dali/internal/update/resources/resource-manager.h>
{
Impl( NotificationManager& notificationManager,
GlSyncAbstraction& glSyncAbstraction,
- AnimationFinishedNotifier& animationFinishedNotifier,
+ CompleteNotificationInterface& animationFinishedNotifier,
PropertyNotifier& propertyNotifier,
ResourceManager& resourceManager,
DiscardQueue& discardQueue,
systemLevelTaskList ( completeStatusManager ),
root( NULL ),
systemLevelRoot( NULL ),
- defaultShader( NULL ),
messageQueue( renderController, sceneGraphBuffers ),
dynamicsChanged( false ),
keepRenderingSeconds( 0.0f ),
previousUpdateScene( false ),
frameCounter( 0 ),
renderSortingHelper(),
- renderTaskList( NULL ),
renderTaskWaiting( false )
{
- sceneController = new SceneControllerImpl( renderMessageDispatcher, renderQueue, discardQueue, textureCache, completeStatusManager, defaultShader );
+ sceneController = new SceneControllerImpl( renderMessageDispatcher, renderQueue, discardQueue, textureCache, completeStatusManager );
}
~Impl()
SceneGraphBuffers sceneGraphBuffers; ///< Used to keep track of which buffers are being written or read
RenderMessageDispatcher renderMessageDispatcher; ///< Used for passing messages to the render-thread
NotificationManager& notificationManager; ///< Queues notification messages for the event-thread.
- AnimationFinishedNotifier& animationFinishedNotifier; ///< Provides notification to applications when animations are finished.
+ CompleteNotificationInterface& animationFinishedNotifier; ///< Provides notification to applications when animations are finished.
PropertyNotifier& propertyNotifier; ///< Provides notification to applications when properties are modified.
ResourceManager& resourceManager; ///< resource manager
DiscardQueue& discardQueue; ///< Nodes are added here when disconnected from the scene-graph.
AnimationContainer animations; ///< A container of owned animations
PropertyNotificationContainer propertyNotifications; ///< A container of owner property notifications.
- Shader* defaultShader; ///< The default shader; owned by ShaderContainer
ShaderContainer shaders; ///< A container of owned shaders
AnimatableMeshContainer animatableMeshes; ///< A container of owned animatable meshes
MaterialContainer materials; ///< A container of owned materials
int frameCounter; ///< Frame counter used in debugging to choose which frame to debug and which to ignore.
RendererSortingHelper renderSortingHelper; ///< helper used to sort transparent renderers
- Internal::RenderTaskList* renderTaskList; ///< Stores a pointer to the internal implementation to the render task list.
GestureContainer gestures; ///< A container of owned gesture detectors
bool renderTaskWaiting; ///< A REFRESH_ONCE render task is waiting to be rendered
};
UpdateManager::UpdateManager( NotificationManager& notificationManager,
GlSyncAbstraction& glSyncAbstraction,
- AnimationFinishedNotifier& animationFinishedNotifier,
+ CompleteNotificationInterface& animationFinishedNotifier,
PropertyNotifier& propertyNotifier,
ResourceManager& resourceManager,
DiscardQueue& discardQueue,
delete mImpl;
}
-void UpdateManager::SetRenderTaskList( Internal::RenderTaskList* renderTaskList )
-{
- mImpl->renderTaskList = renderTaskList;
-}
-
EventToUpdate& UpdateManager::GetEventToUpdate()
{
return mImpl->messageQueue;
mImpl->activeDisconnectedNodes.insert( node ); // Takes ownership of node
}
-void UpdateManager::ConnectNode( Node* parent, Node* node )
+void UpdateManager::ConnectNode( Node* parent, Node* node, int index )
{
DALI_ASSERT_ALWAYS( NULL != parent );
DALI_ASSERT_ALWAYS( NULL != node );
node->SetActive( true );
- parent->ConnectChild( node );
+ parent->ConnectChild( node, index );
}
void UpdateManager::DisconnectNode( Node* node )
propertyNotification->SetNotifyMode( notifyMode );
}
-Shader* UpdateManager::GetDefaultShader()
-{
- return mImpl->defaultShader;
-}
-
void UpdateManager::AddShader( Shader* shader )
{
DALI_ASSERT_DEBUG( NULL != shader );
- // Note: The first shader added becomes the default shader
- if( NULL == mImpl->defaultShader )
+ if( mImpl->shaders.Count() == 0 )
{
- mImpl->defaultShader = shader;
+ // the first added shader becomes our default shader
+ // Construct message in the render queue memory; note that delete should not be called on the return value
+ typedef MessageValue1< RenderManager, Shader* > DerivedType;
+
+ // Reserve some memory inside the render queue
+ unsigned int* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
+
+ // Construct message in the render queue memory; note that delete should not be called on the return value
+ new (slot) DerivedType( &mImpl->renderManager, &RenderManager::SetDefaultShader, shader );
}
mImpl->shaders.PushBack( shader );
- // Allows the shader to dispatch texture requests to the cache and "save shader"
- // requests to the resource manager from the render thread.
- shader->Initialize( mImpl->renderManager, mImpl->renderQueue, mImpl->sceneController->GetTextureCache() );
+ // Allows the shader to dispatch texture requests to the cache
+ shader->Initialize( mImpl->renderQueue, mImpl->sceneController->GetTextureCache() );
}
void UpdateManager::RemoveShader(Shader* shader)
DALI_ASSERT_ALWAYS( NULL != shader && "shader is uninitialized" );
Integration::ShaderDataPtr shaderData( mImpl->resourceManager.GetShaderData(resourceId) );
- shaderData->SetHashValue( shaderHash );
-
if( shaderData )
{
- // This is done in the render thread, to allow GL program compilation
- // Will trigger a NotifySaveRequest back to updateManager to forward onto ResourceClient
- typedef MessageValue6< Shader, GeometryType, Internal::ShaderSubTypes, Integration::ResourceId, Integration::ShaderDataPtr, Context*, bool> DerivedType;
+ shaderData->SetHashValue( shaderHash );
+ shaderData->SetResourceId( resourceId );
+
+ typedef MessageValue6< Shader, GeometryType, Internal::ShaderSubTypes, Integration::ResourceId, Integration::ShaderDataPtr, ProgramCache*, bool> DerivedType;
// Reserve some memory inside the render queue
unsigned int* slot = mImpl->renderQueue.ReserveMessageSlot( mSceneGraphBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
// Construct message in the render queue memory; note that delete should not be called on the return value
- new (slot) DerivedType( shader, &Shader::SetProgram, geometryType, subType, resourceId, shaderData, &(mImpl->renderManager.GetContext()), modifiesGeometry );
+ new (slot) DerivedType( shader, &Shader::SetProgram, geometryType, subType, resourceId, shaderData, mImpl->renderManager.GetProgramCache(), modifiesGeometry );
}
}
if ( mImpl->animationFinishedDuringUpdate )
{
// The application should be notified by NotificationManager, in another thread
- mImpl->notificationManager.QueueMessage( AnimationFinishedMessage( mImpl->animationFinishedNotifier ) );
+ mImpl->notificationManager.QueueCompleteNotification( &mImpl->animationFinishedNotifier );
}
PERF_MONITOR_END(PerformanceMonitor::ANIMATE_NODES);
}
}
- // check the countdown and notify
+ // check the countdown and notify (note, at the moment this is only done for normal tasks, not for systemlevel tasks)
bool doRenderOnceNotify = false;
mImpl->renderTaskWaiting = false;
const RenderTaskList::RenderTaskContainer& tasks = mImpl->taskList.GetTasks();
if( doRenderOnceNotify )
{
DALI_LOG_INFO(gRenderTaskLogFilter, Debug::General, "Notify a render task has finished\n");
- mImpl->notificationManager.QueueMessage( NotifyFinishedMessage( *mImpl->renderTaskList ) );
+ mImpl->notificationManager.QueueCompleteNotification( mImpl->taskList.GetCompleteNotificationInterface() );
}
PERF_MONITOR_END(PerformanceMonitor::PROCESS_RENDER_TASKS);