1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/common/vector-wrapper.h>
23 #include <dali/public-api/common/dali-common.h>
24 #include <dali/integration-api/resource-declarations.h>
25 #include <dali/internal/common/message.h>
26 #include <dali/internal/common/event-to-update.h>
27 #include <dali/internal/render/shaders/shader.h>
28 #include <dali/internal/update/nodes/node.h>
29 #include <dali/internal/update/node-attachments/node-attachment.h>
30 #include <dali/internal/update/common/scene-graph-buffers.h>
31 #include <dali/internal/update/animation/scene-graph-animation.h>
32 #include <dali/internal/update/common/scene-graph-property-notification.h>
33 #include <dali/internal/update/modeling/scene-graph-animatable-mesh.h>
34 #include <dali/internal/update/nodes/scene-graph-layer.h>
35 #include <dali/internal/common/type-abstraction-enums.h>
42 class GlSyncAbstraction;
43 class RenderController;
44 struct DynamicsWorldSettings;
46 } // namespace Integration
51 class PropertyNotifier;
53 struct DynamicsWorldSettings;
54 class NotificationManager;
55 class CompleteNotificationInterface;
56 class ResourceManager;
59 // value types used by messages
60 template <> struct ParameterType< PropertyNotification::NotifyMode >
61 : public BasicType< PropertyNotification::NotifyMode > {};
76 typedef OwnerContainer< AnimatableMesh* > AnimatableMeshContainer;
77 typedef OwnerContainer< Material* > MaterialContainer;
80 * UpdateManager holds a scene graph i.e. a tree of nodes.
81 * It controls the Update traversal, in which nodes are repositioned/animated,
82 * and organizes the the culling and rendering of the scene.
89 * Construct a new UpdateManager.
90 * @param[in] notificationManager This should be notified when animations have finished.
91 * @param[in] glSyncAbstraction Used to determine when framebuffers are ready
92 * @param[in] animationFinishedNotifier The CompleteNotificationInterface that handles animation completions
93 * @param[in] propertyNotifier The PropertyNotifier
94 * @param[in] resourceManager The resource manager used to load textures etc.
95 * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
96 * @param[in] controller After messages are flushed, we request a render from the RenderController.
97 * @param[in] renderManager This is responsible for rendering the results of each "update".
98 * @param[in] renderQueue Used to queue messages for the next render.
99 * @param[in] textureCache Used for caching textures.
100 * @param[in] touchResampler Used for re-sampling touch events.
102 UpdateManager( NotificationManager& notificationManager,
103 Integration::GlSyncAbstraction& glSyncAbstraction,
104 CompleteNotificationInterface& animationFinishedNotifier,
105 PropertyNotifier& propertyNotifier,
106 ResourceManager& resourceManager,
107 DiscardQueue& discardQueue,
108 Integration::RenderController& controller,
109 RenderManager& renderManager,
110 RenderQueue& renderQueue,
111 TextureCache& textureCache,
112 TouchResampler& touchResampler );
115 * Destructor. Not virtual as this is not a base class
120 * The event-thread uses this interface to queue messages for the next update.
121 * @return The event-to-update interface.
123 EventToUpdate& GetEventToUpdate();
126 * @return the event buffer index
128 BufferIndex GetEventBufferIndex() const
130 // inlined as its called often
131 return mSceneGraphBuffers.GetEventBufferIndex();
134 // Node connection methods
137 * Get the scene graph side list of RenderTasks.
138 * @param[in] systemLevel True if using the system-level overlay.
139 * @return The list of render tasks
141 RenderTaskList* GetRenderTaskList( bool systemLevel );
144 * Installs a new layer as the root node.
145 * @pre The UpdateManager does not already have an installed root node.
146 * @pre The layer is of derived Node type Layer.
147 * @pre The layer does not have a parent.
148 * @param[in] layer The new root node.
149 * @param[in] systemLevel True if using the system-level overlay.
150 * @post The node is owned by UpdateManager.
152 void InstallRoot( Layer* layer, bool systemLevel );
155 * Add a Node; UpdateManager takes ownership.
156 * @pre The node does not have a parent.
157 * @param[in] node The node to add.
159 void AddNode( Node* node );
162 * Connect a Node to the scene-graph.
163 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
164 * @pre The node does not already have a parent.
165 * @param[in] node The new parent node.
166 * @param[in] node The node to connect.
168 void ConnectNode( Node* parent, Node* node, int index );
171 * Disconnect a Node from the scene-graph.
172 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
173 * @pre The node has a parent.
174 * @param[in] node The node to disconnect.
176 void DisconnectNode( Node* node );
179 * Called when a property is set on a disconnected Node (via public API)
180 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
181 * @pre The node does not have a parent.
182 * @param[in] node The node to set as "active".
184 void SetNodeActive( Node* node );
187 * Destroy a Node owned by UpdateManager.
188 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
189 * In the following update, the previously queued Nodes may be deleted.
190 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
191 * @param[in] node The node to destroy.
193 void DestroyNode( Node* node );
196 * Attach an object to a Node.
197 * The UpdateManager is responsible for calling NodeAttachment::Initialize().
198 * @param[in] node The node which will own the attachment.
199 * @param[in] attachment The object to attach.
201 void AttachToNode( Node* node, NodeAttachment* attachment );
204 * Add a newly created object.
205 * @param[in] object The object to add.
206 * @post The object is owned by UpdateManager.
208 void AddObject( PropertyOwner* object );
212 * @param[in] object The object to remove.
214 void RemoveObject( PropertyOwner* object );
219 * Add a newly created animation.
220 * @param[in] animation The animation to add.
221 * @post The animation is owned by UpdateManager.
223 void AddAnimation( Animation* animation );
227 * @param[in] animation The animation to stop.
229 void StopAnimation( Animation* animation );
232 * Remove an animation.
233 * @param[in] animation The animation to remove.
235 void RemoveAnimation( Animation* animation );
238 * Query whether any animations are currently running.
239 * @return True if any animations are running.
241 bool IsAnimationRunning() const;
243 // Property Notification
246 * Add a newly created property notification
247 * @param[in] propertyNotification The notification to add
248 * @post The propertyNotification is owned by UpdateManager.
250 void AddPropertyNotification( PropertyNotification* propertyNotification );
253 * Remove a property notification
254 * @param[in] propertyNotification The notification to remove
256 void RemovePropertyNotification( PropertyNotification* propertyNotification );
259 * Set Notify state for PropertyNotification
260 * @param[in] propertyNotification The notification to remove
261 * @param[in] notifyMode The notification mode.
263 void PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode );
268 * Add a newly created shader.
269 * @param[in] shader The shader to add.
270 * @post The shader is owned by the UpdateManager.
272 void AddShader(Shader* shader);
276 * @pre The shader has been added to the UpdateManager.
277 * @param[in] shader The shader to remove.
278 * @post The shader is destroyed.
280 void RemoveShader(Shader* shader);
283 * Set the shader program for a specified GeometryType to a Shader object
284 * @param[in] shader The shader to modify
285 * @param[in] geometryType The GeometryType to map to the program
286 * @param[in] subType The program subtype
287 * @param[in] resourceId A ResourceManager ticket ID for the program data (source and compiled binary)
288 * @param[in] shaderHash hash key created with vertex and fragment shader code
289 * @param[in] modifiesGeometry True if the vertex shader modifies geometry
291 void SetShaderProgram( Shader* shader, GeometryType geometryType, ShaderSubTypes subType, Integration::ResourceId resourceId, size_t shaderHash, bool modifiesGeometry );
294 * Add an animatable mesh
295 * @param[in] animatableMesh The animatable mesh to add.
296 * @post the animatableMesh is owned by the UpdateManager.
298 void AddAnimatableMesh( AnimatableMesh* animatableMesh );
301 * Remove an animatable mesh
302 * @pre The animatable mesh has been added to the update manager
303 * @param[in] animatableMesh The animatable mesh to add.
305 void RemoveAnimatableMesh( AnimatableMesh* animatableMesh );
309 * @param[in] material The material to add
310 * @post the material remains owned by its event object
312 void AddMaterial(Material* material);
316 * @pre The material has been added to the UpdateManager
317 * @param[in] material The material to remove
319 void RemoveMaterial(Material* material);
322 * Add a newly created gesture.
323 * @param[in] gesture The gesture to add.
324 * @post The gesture is owned by the UpdateManager.
326 void AddGesture( PanGesture* gesture );
330 * @pre The gesture has been added to the UpdateManager.
331 * @param[in] gesture The gesture to remove.
332 * @post The gesture is destroyed.
334 void RemoveGesture( PanGesture* gesture );
339 * Performs an Update traversal on the scene-graph.
340 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
341 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
342 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
343 * @return True if further updates are required e.g. during animations.
345 unsigned int Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
348 * Set the background color i.e. the glClear color used at the beginning of each frame.
349 * @param[in] color The new background color.
351 void SetBackgroundColor(const Vector4& color);
354 * Set the default surface rect.
355 * @param[in] rect The rect value representing the surface.
357 void SetDefaultSurfaceRect( const Rect<int>& rect );
360 * @copydoc Dali::Stage::KeepRendering()
362 void KeepRendering( float durationSeconds );
365 * Sets the depths of all layers.
366 * @param layers The layers in depth order.
367 * @param[in] systemLevel True if using the system-level overlay.
369 void SetLayerDepths( const std::vector< Layer* >& layers, bool systemLevel );
371 #ifdef DYNAMICS_SUPPORT
374 * Initialize the dynamics world
375 * @param[in] world The dynamics world
376 * @param[in] worldSettings The dynamics world settings
377 * @param[in] debugShader The shader used for rendering dynamics debug information
379 void InitializeDynamicsWorld( DynamicsWorld* world, Integration::DynamicsWorldSettings* worldSettings );
382 * Terminate the dynamics world
384 void TerminateDynamicsWorld();
386 #endif // DYNAMICS_SUPPORT
391 UpdateManager(const UpdateManager&);
394 UpdateManager& operator=(const UpdateManager& rhs);
397 * Helper to check whether the update-thread should keep going.
398 * @param[in] elapsedSeconds The time in seconds since the previous update.
399 * @return True if the update-thread should keep going.
401 unsigned int KeepUpdatingCheck( float elapsedSeconds ) const;
404 * Helper to calculate new camera setup when root node resizes.
405 * @param[in] updateBuffer The buffer to read the root node size from.
407 void UpdateProjectionAndViewMatrices(int updateBuffer);
410 * Post process resources that have been updated by renderer
412 void PostProcessResources();
415 * Helper to reset a Node properties.
416 * @param[in] node The node.
418 void ResetNodeProperty( Node& node );
421 * Helper to reset all Node properties
423 void ResetProperties();
426 * Perform gesture updates.
427 * @param[in] lastVSyncTime The last VSync time in milliseconds.
428 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
429 * @return true, if any properties were updated.
431 bool ProcessGestures( unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
434 * Perform animation updates
435 * @param[in] elapsedSeconds time since last frame
437 void Animate( float elapsedSeconds );
440 * Perform constraint updates.
441 * @note Applies constraints to nodes first (depth first search order).
442 * Then shader constraints second (construction order)
444 void ApplyConstraints();
447 * Perform property notification updates
449 void ProcessPropertyNotifications();
452 * Update the default camera.
453 * This must be altered to match the root Node for 2D layouting.
454 * @param[in] updateBuffer The buffer to read the root node size from.
456 void UpdateDefaultCamera( int updateBuffer );
459 * Update node shaders, opacity, geometry etc.
464 * Update animatable meshes
466 void UpdateMeshes( BufferIndex updateBufferIndex, AnimatableMeshContainer& meshes );
469 * Update materials - Ensure all render materials are updated with texture pointers
472 void UpdateMaterials( BufferIndex updateBufferIndex, MaterialContainer& materials );
475 * PrepareMaterials - Ensure updated material properties are sent to render materials
477 void PrepareMaterials( BufferIndex updateBufferIndex, MaterialContainer& materials );
481 // needs to be direct member so that getter for event buffer can be inlined
482 SceneGraphBuffers mSceneGraphBuffers;
489 // Messages for UpdateManager
491 inline void InstallRootMessage( UpdateManager& manager, Layer& root, bool systemLevel )
493 typedef MessageValue2< UpdateManager, Layer*, bool > LocalType;
495 // Reserve some memory inside the message queue
496 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
498 // Construct message in the message queue memory; note that delete should not be called on the return value
499 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, &root, systemLevel );
502 inline void AddNodeMessage( UpdateManager& manager, Node& node )
504 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
506 // Reserve some memory inside the message queue
507 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
509 // Construct message in the message queue memory; note that delete should not be called on the return value
510 new (slot) LocalType( &manager, &UpdateManager::AddNode, &node );
513 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild, int index )
515 // Update thread can edit the object
516 Node& parent = const_cast< Node& >( constParent );
517 Node& child = const_cast< Node& >( constChild );
519 typedef MessageValue3< UpdateManager, Node*, Node*, int > LocalType;
521 // Reserve some memory inside the message queue
522 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
524 // Construct message in the message queue memory; note that delete should not be called on the return value
525 new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child, index );
528 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
530 // Scene graph thread can modify this object.
531 Node& node = const_cast< Node& >( constNode );
533 typedef MessageValue1< UpdateManager, Node* > LocalType;
535 // Reserve some memory inside the message queue
536 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
538 // Construct message in the message queue memory; note that delete should not be called on the return value
539 new (slot) LocalType( &manager, &UpdateManager::DisconnectNode, &node );
542 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
544 // Scene graph thread can destroy this object.
545 Node& node = const_cast< Node& >( constNode );
547 typedef MessageValue1< UpdateManager, Node* > LocalType;
549 // Reserve some memory inside the message queue
550 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
552 // Construct message in the message queue memory; note that delete should not be called on the return value
553 new (slot) LocalType( &manager, &UpdateManager::DestroyNode, &node );
556 inline void AttachToNodeMessage( UpdateManager& manager, const Node& constParent, NodeAttachment* attachment )
558 // Scene graph thread can modify this object.
559 Node& parent = const_cast< Node& >( constParent );
561 typedef MessageValue2< UpdateManager, Node*, NodeAttachmentOwner > LocalType;
563 // Reserve some memory inside the message queue
564 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
566 // Construct message in the message queue memory; note that delete should not be called on the return value
567 new (slot) LocalType( &manager, &UpdateManager::AttachToNode, &parent, attachment );
570 inline void AddObjectMessage( UpdateManager& manager, PropertyOwner* object )
572 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
574 // Reserve some memory inside the message queue
575 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
577 // Construct message in the message queue memory; note that delete should not be called on the return value
578 new (slot) LocalType( &manager, &UpdateManager::AddObject, object );
581 inline void RemoveObjectMessage( UpdateManager& manager, PropertyOwner* object )
583 typedef MessageValue1< UpdateManager, PropertyOwner* > LocalType;
585 // Reserve some memory inside the message queue
586 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
588 // Construct message in the message queue memory; note that delete should not be called on the return value
589 new (slot) LocalType( &manager, &UpdateManager::RemoveObject, object );
592 inline void AddAnimationMessage( UpdateManager& manager, Animation* animation )
594 typedef MessageValue1< UpdateManager, Animation* > LocalType;
596 // Reserve some memory inside the message queue
597 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
599 // Construct message in the message queue memory; note that delete should not be called on the return value
600 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
603 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
605 // The scene-graph thread owns this object so it can safely edit it.
606 Animation& animation = const_cast< Animation& >( constAnimation );
608 typedef MessageValue1< UpdateManager, Animation* > LocalType;
610 // Reserve some memory inside the message queue
611 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
613 // Construct message in the message queue memory; note that delete should not be called on the return value
614 new (slot) LocalType( &manager, &UpdateManager::StopAnimation, &animation );
617 inline void RemoveAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
619 // The scene-graph thread owns this object so it can safely edit it.
620 Animation& animation = const_cast< Animation& >( constAnimation );
622 typedef MessageValue1< UpdateManager, Animation* > LocalType;
624 // Reserve some memory inside the message queue
625 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
627 // Construct message in the message queue memory; note that delete should not be called on the return value
628 new (slot) LocalType( &manager, &UpdateManager::RemoveAnimation, &animation );
631 inline void AddPropertyNotificationMessage( UpdateManager& manager, PropertyNotification* propertyNotification )
633 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
635 // Reserve some memory inside the message queue
636 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
638 // Construct message in the message queue memory; note that delete should not be called on the return value
639 new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
642 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
644 // The scene-graph thread owns this object so it can safely edit it.
645 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
647 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
649 // Reserve some memory inside the message queue
650 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
652 // Construct message in the message queue memory; note that delete should not be called on the return value
653 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyNotification, &propertyNotification );
656 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
657 const PropertyNotification* constPropertyNotification,
658 PropertyNotification::NotifyMode notifyMode )
660 // The scene-graph thread owns this object so it can safely edit it.
661 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
663 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
665 // Reserve some memory inside the message queue
666 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
668 // Construct message in the message queue memory; note that delete should not be called on the return value
669 new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
672 // The render thread can safely change the Shader
673 inline void AddShaderMessage( UpdateManager& manager, Shader& shader )
675 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > LocalType;
677 // Reserve some memory inside the message queue
678 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
680 // Construct message in the message queue memory; note that delete should not be called on the return value
681 new (slot) LocalType( &manager, &UpdateManager::AddShader, &shader );
684 // The render thread can safely change the Shader
685 inline void RemoveShaderMessage( UpdateManager& manager, Shader& shader )
687 typedef MessageValue1< UpdateManager, Shader* > LocalType;
689 // Reserve some memory inside the message queue
690 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
692 // Construct message in the message queue memory; note that delete should not be called on the return value
693 new (slot) LocalType( &manager, &UpdateManager::RemoveShader, &shader );
696 inline void SetShaderProgramMessage( UpdateManager& manager,
698 GeometryType geometryType,
699 ShaderSubTypes subType,
700 Integration::ResourceId resourceId,
702 bool modifiesGeometry )
704 typedef MessageValue6< UpdateManager, Shader*, GeometryType, ShaderSubTypes, Integration::ResourceId, size_t, bool > LocalType;
706 // Reserve some memory inside the message queue
707 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
709 // Construct message in the message queue memory; note that delete should not be called on the return value
710 new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, &shader, geometryType, subType, resourceId, shaderHash, modifiesGeometry );
713 // The render thread can safely change the AnimatableMesh
714 inline void AddAnimatableMeshMessage( UpdateManager& manager, AnimatableMesh& animatableMesh )
716 typedef MessageValue1< UpdateManager, AnimatableMesh* > LocalType;
718 // Reserve some memory inside the message queue
719 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
721 // Construct message in the message queue memory; note that delete should not be called on the return value
722 new (slot) LocalType( &manager, &UpdateManager::AddAnimatableMesh, &animatableMesh );
725 // The render thread can safely change the AnimatableMesh
726 inline void RemoveAnimatableMeshMessage( UpdateManager& manager, AnimatableMesh& animatableMesh )
728 typedef MessageValue1< UpdateManager, AnimatableMesh* > LocalType;
730 // Reserve some memory inside the message queue
731 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
733 // Construct message in the message queue memory; note that delete should not be called on the return value
734 new (slot) LocalType( &manager, &UpdateManager::RemoveAnimatableMesh, &animatableMesh );
738 inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
740 typedef MessageValue1< UpdateManager, Vector4 > LocalType;
742 // Reserve some memory inside the message queue
743 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
745 // Construct message in the message queue memory; note that delete should not be called on the return value
746 new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
749 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int>& rect )
751 typedef MessageValue1< UpdateManager, Rect<int> > LocalType;
753 // Reserve some memory inside the message queue
754 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
756 // Construct message in the message queue memory; note that delete should not be called on the return value
757 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
760 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
762 typedef MessageValue1< UpdateManager, float > LocalType;
764 // Reserve some memory inside the message queue
765 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
767 // Construct message in the message queue memory; note that delete should not be called on the return value
768 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
772 * Create a message for setting the depth of a layer
773 * @param[in] manager The update manager
774 * @param[in] layers list of layers
775 * @param[in] systemLevel True if the layers are added via the SystemOverlay API
777 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, bool systemLevel )
779 typedef MessageValue2< UpdateManager, std::vector< Layer* >, bool > LocalType;
781 // Reserve some memory inside the message queue
782 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
784 // Construct message in the message queue memory; note that delete should not be called on the return value
785 new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, systemLevel );
788 inline void AddMaterialMessage( UpdateManager& manager, Material* material )
790 typedef MessageValue1< UpdateManager, Material* > LocalType;
792 // Reserve some memory inside the message queue
793 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
795 // Construct message in the message queue memory; note that delete should not be called on the return value
796 new (slot) LocalType( &manager, &UpdateManager::AddMaterial, material );
799 inline void RemoveMaterialMessage( UpdateManager& manager, Material* material )
801 typedef MessageValue1< UpdateManager, Material* > LocalType;
803 // Reserve some memory inside the message queue
804 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
806 // Construct message in the message queue memory; note that delete should not be called on the return value
807 new (slot) LocalType( &manager, &UpdateManager::RemoveMaterial, material );
810 inline void AddGestureMessage( UpdateManager& manager, PanGesture* gesture )
812 typedef MessageValue1< UpdateManager, PanGesture* > LocalType;
814 // Reserve some memory inside the message queue
815 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
817 // Construct message in the message queue memory; note that delete should not be called on the return value
818 new (slot) LocalType( &manager, &UpdateManager::AddGesture, gesture );
821 inline void RemoveGestureMessage( UpdateManager& manager, PanGesture* gesture )
823 typedef MessageValue1< UpdateManager, PanGesture* > LocalType;
825 // Reserve some memory inside the message queue
826 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
828 // Construct message in the message queue memory; note that delete should not be called on the return value
829 new (slot) LocalType( &manager, &UpdateManager::RemoveGesture, gesture );
832 #ifdef DYNAMICS_SUPPORT
835 inline void InitializeDynamicsWorldMessage( UpdateManager& manager, DynamicsWorld* dynamicsworld, Integration::DynamicsWorldSettings* worldSettings )
837 typedef MessageValue2< UpdateManager, DynamicsWorld*, Integration::DynamicsWorldSettings* > LocalType;
839 // Reserve some memory inside the message queue
840 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
842 // Construct message in the message queue memory; note that delete should not be called on the return value
843 new (slot) LocalType( &manager, &UpdateManager::InitializeDynamicsWorld, dynamicsworld, worldSettings );
846 inline void TerminateDynamicsWorldMessage(UpdateManager& manager)
848 typedef Message< UpdateManager > LocalType;
850 // Reserve some memory inside the message queue
851 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
853 // Construct message in the message queue memory; note that delete should not be called on the return value
854 new (slot) LocalType( &manager, &UpdateManager::TerminateDynamicsWorld );
857 #endif // DYNAMICS_SUPPORT
859 } // namespace SceneGraph
861 } // namespace Internal
865 #endif // __DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H__