Friendly janitor cleaning up unnecessary header dependencies
[platform/core/uifw/dali-core.git] / dali / internal / update / manager / update-manager.h
index de158b4..a8e814e 100644 (file)
 #include <dali/internal/update/common/scene-graph-buffers.h>
 #include <dali/internal/update/animation/scene-graph-animation.h>
 #include <dali/internal/update/common/scene-graph-property-notification.h>
-#include <dali/internal/update/common/double-buffered.h>
 #include <dali/internal/update/modeling/scene-graph-animatable-mesh.h>
 #include <dali/internal/update/nodes/scene-graph-layer.h>
-#include <dali/internal/event/effects/shader-declarations.h>
 #include <dali/internal/common/type-abstraction-enums.h>
 
 namespace Dali
@@ -50,13 +48,12 @@ struct DynamicsWorldSettings;
 namespace Internal
 {
 
-class AnimationFinishedNotifier;
 class PropertyNotifier;
 class EventToUpdate;
 struct DynamicsWorldSettings;
 class NotificationManager;
+class CompleteNotificationInterface;
 class ResourceManager;
-class RenderTaskList;
 class TouchResampler;
 
 // value types used by messages
@@ -92,7 +89,7 @@ public:
    * Construct a new UpdateManager.
    * @param[in] notificationManager This should be notified when animations have finished.
    * @param[in] glSyncAbstraction Used to determine when framebuffers are ready
-   * @param[in] animationFinishedNotifier The AnimationFinishedNotifier
+   * @param[in] animationFinishedNotifier The CompleteNotificationInterface that handles animation completions
    * @param[in] propertyNotifier The PropertyNotifier
    * @param[in] resourceManager The resource manager used to load textures etc.
    * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
@@ -104,7 +101,7 @@ public:
    */
   UpdateManager( NotificationManager& notificationManager,
                  Integration::GlSyncAbstraction& glSyncAbstraction,
-                 AnimationFinishedNotifier& animationFinishedNotifier,
+                 CompleteNotificationInterface& animationFinishedNotifier,
                  PropertyNotifier& propertyNotifier,
                  ResourceManager& resourceManager,
                  DiscardQueue& discardQueue,
@@ -120,15 +117,6 @@ public:
   ~UpdateManager();
 
   /**
-   * Sets a pointer to the internal render task list.
-   *
-   * The render task list is used to notify which render tasks with refresh rate REFRESH_ONCE have finished.
-   *
-   * @param[in] renderTaskList A pointer to the internal render task list.
-   */
-  void SetRenderTaskList( Internal::RenderTaskList* renderTaskList );
-
-  /**
    * The event-thread uses this interface to queue messages for the next update.
    * @return The event-to-update interface.
    */
@@ -177,7 +165,7 @@ public:
    * @param[in] node The new parent node.
    * @param[in] node The node to connect.
    */
-  void ConnectNode( Node* parent, Node* node );
+  void ConnectNode( Node* parent, Node* node, int index );
 
   /**
    * Disconnect a Node from the scene-graph.
@@ -277,12 +265,6 @@ public:
   // Shaders
 
   /**
-   * Retrieve the default shader.
-   * @return The default shader.
-   */
-  Shader* GetDefaultShader();
-
-  /**
    * Add a newly created shader.
    * @param[in] shader The shader to add.
    * @post The shader is owned by the UpdateManager.
@@ -303,9 +285,10 @@ public:
    * @param[in] geometryType  The GeometryType to map to the program
    * @param[in] subType       The program subtype
    * @param[in] resourceId    A ResourceManager ticket ID for the program data (source and compiled binary)
-   * @param[in] shaderHash  hash key created with vertex and fragment shader code
+   * @param[in] shaderHash    hash key created with vertex and fragment shader code
+   * @param[in] modifiesGeometry True if the vertex shader modifies geometry
    */
-  void SetShaderProgram( Shader* shader, GeometryType geometryType, ShaderSubTypes subType, Integration::ResourceId resourceId, size_t shaderHash );
+  void SetShaderProgram( Shader* shader, GeometryType geometryType, ShaderSubTypes subType, Integration::ResourceId resourceId, size_t shaderHash, bool modifiesGeometry );
 
   /**
    * Add an animatable mesh
@@ -355,11 +338,11 @@ public:
   /**
    * Performs an Update traversal on the scene-graph.
    * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
-   * @param[in] lastVSyncTime The last time, in milliseconds, that we had a VSync.
-   * @param[in] nextVSyncTime The estimated time, in milliseconds, of the next VSync.
+   * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
+   * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
    * @return True if further updates are required e.g. during animations.
    */
-  unsigned int Update( float elapsedSeconds, unsigned int lastVSyncTime, unsigned int nextVSyncTime );
+  unsigned int Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
 
   /**
    * Set the background color i.e. the glClear color used at the beginning of each frame.
@@ -393,7 +376,7 @@ public:
    * @param[in] worldSettings The dynamics world settings
    * @param[in] debugShader The shader used for rendering dynamics debug information
    */
-  void InitializeDynamicsWorld( DynamicsWorld* world, Integration::DynamicsWorldSettings* worldSettings, Shader* debugShader );
+  void InitializeDynamicsWorld( DynamicsWorld* world, Integration::DynamicsWorldSettings* worldSettings );
 
   /**
    * Terminate the dynamics world
@@ -441,11 +424,11 @@ private:
 
   /**
    * Perform gesture updates.
-   * @param[in]  lastVSyncTime  The last VSync time.
-   * @param[in]  nextVSyncTime  The estimated time of the next VSync.
+   * @param[in]  lastVSyncTime  The last VSync time in milliseconds.
+   * @param[in]  nextVSyncTime  The estimated time of the next VSync in milliseconds.
    * @return true, if any properties were updated.
    */
-  bool ProcessGestures( unsigned int lastVSyncTime, unsigned int nextVSyncTime );
+  bool ProcessGestures( unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
 
   /**
    * Perform animation updates
@@ -527,19 +510,19 @@ inline void AddNodeMessage( UpdateManager& manager, Node& node )
   new (slot) LocalType( &manager, &UpdateManager::AddNode, &node );
 }
 
-inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild )
+inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild, int index )
 {
   // Update thread can edit the object
   Node& parent = const_cast< Node& >( constParent );
   Node& child = const_cast< Node& >( constChild );
 
-  typedef MessageValue2< UpdateManager, Node*, Node* > LocalType;
+  typedef MessageValue3< UpdateManager, Node*, Node*, int > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child );
+  new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child, index );
 }
 
 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
@@ -715,15 +698,16 @@ inline void SetShaderProgramMessage( UpdateManager& manager,
                                      GeometryType geometryType,
                                      ShaderSubTypes subType,
                                      Integration::ResourceId resourceId,
-                                     size_t shaderHash )
+                                     size_t shaderHash,
+                                     bool modifiesGeometry )
 {
-  typedef MessageValue5< UpdateManager, Shader*, GeometryType, ShaderSubTypes, Integration::ResourceId, size_t > LocalType;
+  typedef MessageValue6< UpdateManager, Shader*, GeometryType, ShaderSubTypes, Integration::ResourceId, size_t, bool > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, &shader, geometryType, subType, resourceId, shaderHash );
+  new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, &shader, geometryType, subType, resourceId, shaderHash, modifiesGeometry );
 }
 
 // The render thread can safely change the AnimatableMesh
@@ -848,15 +832,15 @@ inline void RemoveGestureMessage( UpdateManager& manager, PanGesture* gesture )
 #ifdef DYNAMICS_SUPPORT
 
 // Dynamics messages
-inline void InitializeDynamicsWorldMessage(UpdateManager& manager, DynamicsWorld* dynamicsworld, Integration::DynamicsWorldSettings* worldSettings, const Shader* debugShader)
+inline void InitializeDynamicsWorldMessage( UpdateManager& manager, DynamicsWorld* dynamicsworld, Integration::DynamicsWorldSettings* worldSettings )
 {
-  typedef MessageValue3< UpdateManager, DynamicsWorld*, Integration::DynamicsWorldSettings*, Shader*> LocalType;
+  typedef MessageValue2< UpdateManager, DynamicsWorld*, Integration::DynamicsWorldSettings* > LocalType;
 
   // Reserve some memory inside the message queue
   unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
 
   // Construct message in the message queue memory; note that delete should not be called on the return value
-  new (slot) LocalType( &manager, &UpdateManager::InitializeDynamicsWorld, dynamicsworld, worldSettings, const_cast<Shader*>(debugShader) );
+  new (slot) LocalType( &manager, &UpdateManager::InitializeDynamicsWorld, dynamicsworld, worldSettings );
 }
 
 inline void TerminateDynamicsWorldMessage(UpdateManager& manager)