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/scene-graph-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/nodes/scene-graph-layer.h>
34 #include <dali/internal/common/type-abstraction-enums.h>
41 class GlSyncAbstraction;
42 class RenderController;
43 struct DynamicsWorldSettings;
45 } // namespace Integration
50 class PropertyNotifier;
52 struct DynamicsWorldSettings;
53 class NotificationManager;
54 class CompleteNotificationInterface;
55 class ResourceManager;
58 // value types used by messages
59 template <> struct ParameterType< PropertyNotification::NotifyMode >
60 : public BasicType< PropertyNotification::NotifyMode > {};
75 * UpdateManager holds a scene graph i.e. a tree of nodes.
76 * It controls the Update traversal, in which nodes are repositioned/animated,
77 * and organizes the the culling and rendering of the scene.
84 * Construct a new UpdateManager.
85 * @param[in] notificationManager This should be notified when animations have finished.
86 * @param[in] glSyncAbstraction Used to determine when framebuffers are ready
87 * @param[in] animationFinishedNotifier The CompleteNotificationInterface that handles animation completions
88 * @param[in] propertyNotifier The PropertyNotifier
89 * @param[in] resourceManager The resource manager used to load textures etc.
90 * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
91 * @param[in] controller After messages are flushed, we request a render from the RenderController.
92 * @param[in] renderManager This is responsible for rendering the results of each "update".
93 * @param[in] renderQueue Used to queue messages for the next render.
94 * @param[in] textureCache Used for caching textures.
95 * @param[in] touchResampler Used for re-sampling touch events.
97 UpdateManager( NotificationManager& notificationManager,
98 Integration::GlSyncAbstraction& glSyncAbstraction,
99 CompleteNotificationInterface& animationFinishedNotifier,
100 PropertyNotifier& propertyNotifier,
101 ResourceManager& resourceManager,
102 DiscardQueue& discardQueue,
103 Integration::RenderController& controller,
104 RenderManager& renderManager,
105 RenderQueue& renderQueue,
106 TextureCache& textureCache,
107 TouchResampler& touchResampler );
110 * Destructor. Not virtual as this is not a base class
115 * The event-thread uses this interface to queue messages for the next update.
116 * @return The event-to-update interface.
118 EventToUpdate& GetEventToUpdate();
121 * @return the event buffer index
123 BufferIndex GetEventBufferIndex() const
125 // inlined as its called often
126 return mSceneGraphBuffers.GetEventBufferIndex();
129 // Node connection methods
132 * Get the scene graph side list of RenderTasks.
133 * @param[in] systemLevel True if using the system-level overlay.
134 * @return The list of render tasks
136 RenderTaskList* GetRenderTaskList( bool systemLevel );
139 * Installs a new layer as the root node.
140 * @pre The UpdateManager does not already have an installed root node.
141 * @pre The layer is of derived Node type Layer.
142 * @pre The layer does not have a parent.
143 * @param[in] layer The new root node.
144 * @param[in] systemLevel True if using the system-level overlay.
145 * @post The node is owned by UpdateManager.
147 void InstallRoot( Layer* layer, bool systemLevel );
150 * Add a Node; UpdateManager takes ownership.
151 * @pre The node does not have a parent.
152 * @param[in] node The node to add.
154 void AddNode( Node* node );
157 * Connect a Node to the scene-graph.
158 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
159 * @pre The node does not already have a parent.
160 * @param[in] node The new parent node.
161 * @param[in] node The node to connect.
163 void ConnectNode( Node* parent, Node* node, int index );
166 * Disconnect a Node from the scene-graph.
167 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
168 * @pre The node has a parent.
169 * @param[in] node The node to disconnect.
171 void DisconnectNode( Node* node );
174 * Called when a property is set on a disconnected Node (via public API)
175 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
176 * @pre The node does not have a parent.
177 * @param[in] node The node to set as "active".
179 void SetNodeActive( Node* node );
182 * Destroy a Node owned by UpdateManager.
183 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
184 * In the following update, the previously queued Nodes may be deleted.
185 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
186 * @param[in] node The node to destroy.
188 void DestroyNode( Node* node );
191 * Attach an object to a Node.
192 * The UpdateManager is responsible for calling NodeAttachment::Initialize().
193 * @param[in] node The node which will own the attachment.
194 * @param[in] attachment The object to attach.
196 void AttachToNode( Node* node, NodeAttachment* attachment );
199 * Add a newly created object.
200 * @param[in] object The object to add.
201 * @post The object is owned by UpdateManager.
203 void AddObject( PropertyOwner* object );
207 * @param[in] object The object to remove.
209 void RemoveObject( PropertyOwner* object );
214 * Add a newly created animation.
215 * @param[in] animation The animation to add.
216 * @post The animation is owned by UpdateManager.
218 void AddAnimation( Animation* animation );
222 * @param[in] animation The animation to stop.
224 void StopAnimation( Animation* animation );
227 * Remove an animation.
228 * @param[in] animation The animation to remove.
230 void RemoveAnimation( Animation* animation );
233 * Query whether any animations are currently running.
234 * @return True if any animations are running.
236 bool IsAnimationRunning() const;
238 // Property Notification
241 * Add a newly created property notification
242 * @param[in] propertyNotification The notification to add
243 * @post The propertyNotification is owned by UpdateManager.
245 void AddPropertyNotification( PropertyNotification* propertyNotification );
248 * Remove a property notification
249 * @param[in] propertyNotification The notification to remove
251 void RemovePropertyNotification( PropertyNotification* propertyNotification );
254 * Set Notify state for PropertyNotification
255 * @param[in] propertyNotification The notification to remove
256 * @param[in] notifyMode The notification mode.
258 void PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode );
263 * Add a newly created shader.
264 * @param[in] shader The shader to add.
265 * @post The shader is owned by the UpdateManager.
267 void AddShader(Shader* shader);
271 * @pre The shader has been added to the UpdateManager.
272 * @param[in] shader The shader to remove.
273 * @post The shader is destroyed.
275 void RemoveShader(Shader* shader);
278 * Set the shader program for a specified GeometryType to a Shader object
279 * @param[in] shader The shader to modify
280 * @param[in] geometryType The GeometryType to map to the program
281 * @param[in] subType The program subtype
282 * @param[in] resourceId A ResourceManager ticket ID for the program data (source and compiled binary)
283 * @param[in] shaderHash hash key created with vertex and fragment shader code
284 * @param[in] modifiesGeometry True if the vertex shader modifies geometry
286 void SetShaderProgram( Shader* shader, GeometryType geometryType, ShaderSubTypes subType, Integration::ResourceId resourceId, size_t shaderHash, bool modifiesGeometry );
289 * Add a newly created gesture.
290 * @param[in] gesture The gesture to add.
291 * @post The gesture is owned by the UpdateManager.
293 void AddGesture( PanGesture* gesture );
297 * @pre The gesture has been added to the UpdateManager.
298 * @param[in] gesture The gesture to remove.
299 * @post The gesture is destroyed.
301 void RemoveGesture( PanGesture* gesture );
306 * Performs an Update traversal on the scene-graph.
307 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
308 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
309 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
310 * @return True if further updates are required e.g. during animations.
312 unsigned int Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
315 * Set the background color i.e. the glClear color used at the beginning of each frame.
316 * @param[in] color The new background color.
318 void SetBackgroundColor(const Vector4& color);
321 * Set the default surface rect.
322 * @param[in] rect The rect value representing the surface.
324 void SetDefaultSurfaceRect( const Rect<int>& rect );
327 * @copydoc Dali::Stage::KeepRendering()
329 void KeepRendering( float durationSeconds );
332 * Sets the depths of all layers.
333 * @param layers The layers in depth order.
334 * @param[in] systemLevel True if using the system-level overlay.
336 void SetLayerDepths( const std::vector< Layer* >& layers, bool systemLevel );
338 #ifdef DYNAMICS_SUPPORT
341 * Initialize the dynamics world
342 * @param[in] world The dynamics world
343 * @param[in] worldSettings The dynamics world settings
344 * @param[in] debugShader The shader used for rendering dynamics debug information
346 void InitializeDynamicsWorld( DynamicsWorld* world, Integration::DynamicsWorldSettings* worldSettings );
349 * Terminate the dynamics world
351 void TerminateDynamicsWorld();
353 #endif // DYNAMICS_SUPPORT
358 UpdateManager(const UpdateManager&);
361 UpdateManager& operator=(const UpdateManager& rhs);
364 * Helper to check whether the update-thread should keep going.
365 * @param[in] elapsedSeconds The time in seconds since the previous update.
366 * @return True if the update-thread should keep going.
368 unsigned int KeepUpdatingCheck( float elapsedSeconds ) const;
371 * Helper to calculate new camera setup when root node resizes.
372 * @param[in] updateBuffer The buffer to read the root node size from.
374 void UpdateProjectionAndViewMatrices(int updateBuffer);
377 * Post process resources that have been updated by renderer
379 void PostProcessResources();
382 * Helper to reset a Node properties.
383 * @param[in] node The node.
385 void ResetNodeProperty( Node& node );
388 * Helper to reset all Node properties
390 void ResetProperties();
393 * Perform gesture updates.
394 * @param[in] lastVSyncTime The last VSync time in milliseconds.
395 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
396 * @return true, if any properties were updated.
398 bool ProcessGestures( unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
401 * Perform animation updates
402 * @param[in] elapsedSeconds time since last frame
404 void Animate( float elapsedSeconds );
407 * Perform constraint updates.
408 * @note Applies constraints to nodes first (depth first search order).
409 * Then shader constraints second (construction order)
411 void ApplyConstraints();
414 * Perform property notification updates
416 void ProcessPropertyNotifications();
419 * Update the default camera.
420 * This must be altered to match the root Node for 2D layouting.
421 * @param[in] updateBuffer The buffer to read the root node size from.
423 void UpdateDefaultCamera( int updateBuffer );
426 * Update node shaders, opacity, geometry etc.
432 // needs to be direct member so that getter for event buffer can be inlined
433 SceneGraphBuffers mSceneGraphBuffers;
440 // Messages for UpdateManager
442 inline void InstallRootMessage( UpdateManager& manager, Layer& root, bool systemLevel )
444 typedef MessageValue2< UpdateManager, Layer*, bool > LocalType;
446 // Reserve some memory inside the message queue
447 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
449 // Construct message in the message queue memory; note that delete should not be called on the return value
450 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, &root, systemLevel );
453 inline void AddNodeMessage( UpdateManager& manager, Node& node )
455 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
457 // Reserve some memory inside the message queue
458 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
460 // Construct message in the message queue memory; note that delete should not be called on the return value
461 new (slot) LocalType( &manager, &UpdateManager::AddNode, &node );
464 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild, int index )
466 // Update thread can edit the object
467 Node& parent = const_cast< Node& >( constParent );
468 Node& child = const_cast< Node& >( constChild );
470 typedef MessageValue3< UpdateManager, Node*, Node*, int > LocalType;
472 // Reserve some memory inside the message queue
473 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
475 // Construct message in the message queue memory; note that delete should not be called on the return value
476 new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child, index );
479 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
481 // Scene graph thread can modify this object.
482 Node& node = const_cast< Node& >( constNode );
484 typedef MessageValue1< UpdateManager, Node* > LocalType;
486 // Reserve some memory inside the message queue
487 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
489 // Construct message in the message queue memory; note that delete should not be called on the return value
490 new (slot) LocalType( &manager, &UpdateManager::DisconnectNode, &node );
493 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
495 // Scene graph thread can destroy this object.
496 Node& node = const_cast< Node& >( constNode );
498 typedef MessageValue1< UpdateManager, Node* > LocalType;
500 // Reserve some memory inside the message queue
501 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
503 // Construct message in the message queue memory; note that delete should not be called on the return value
504 new (slot) LocalType( &manager, &UpdateManager::DestroyNode, &node );
507 inline void AttachToNodeMessage( UpdateManager& manager, const Node& constParent, NodeAttachment* attachment )
509 // Scene graph thread can modify this object.
510 Node& parent = const_cast< Node& >( constParent );
512 typedef MessageValue2< UpdateManager, Node*, NodeAttachmentOwner > LocalType;
514 // Reserve some memory inside the message queue
515 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
517 // Construct message in the message queue memory; note that delete should not be called on the return value
518 new (slot) LocalType( &manager, &UpdateManager::AttachToNode, &parent, attachment );
521 inline void AddObjectMessage( UpdateManager& manager, PropertyOwner* object )
523 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
525 // Reserve some memory inside the message queue
526 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
528 // Construct message in the message queue memory; note that delete should not be called on the return value
529 new (slot) LocalType( &manager, &UpdateManager::AddObject, object );
532 inline void RemoveObjectMessage( UpdateManager& manager, PropertyOwner* object )
534 typedef MessageValue1< UpdateManager, PropertyOwner* > LocalType;
536 // Reserve some memory inside the message queue
537 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
539 // Construct message in the message queue memory; note that delete should not be called on the return value
540 new (slot) LocalType( &manager, &UpdateManager::RemoveObject, object );
543 inline void AddAnimationMessage( UpdateManager& manager, Animation* animation )
545 typedef MessageValue1< UpdateManager, Animation* > LocalType;
547 // Reserve some memory inside the message queue
548 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
550 // Construct message in the message queue memory; note that delete should not be called on the return value
551 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
554 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
556 // The scene-graph thread owns this object so it can safely edit it.
557 Animation& animation = const_cast< Animation& >( constAnimation );
559 typedef MessageValue1< UpdateManager, Animation* > LocalType;
561 // Reserve some memory inside the message queue
562 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
564 // Construct message in the message queue memory; note that delete should not be called on the return value
565 new (slot) LocalType( &manager, &UpdateManager::StopAnimation, &animation );
568 inline void RemoveAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
570 // The scene-graph thread owns this object so it can safely edit it.
571 Animation& animation = const_cast< Animation& >( constAnimation );
573 typedef MessageValue1< UpdateManager, Animation* > LocalType;
575 // Reserve some memory inside the message queue
576 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
578 // Construct message in the message queue memory; note that delete should not be called on the return value
579 new (slot) LocalType( &manager, &UpdateManager::RemoveAnimation, &animation );
582 inline void AddPropertyNotificationMessage( UpdateManager& manager, PropertyNotification* propertyNotification )
584 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
586 // Reserve some memory inside the message queue
587 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
589 // Construct message in the message queue memory; note that delete should not be called on the return value
590 new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
593 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
595 // The scene-graph thread owns this object so it can safely edit it.
596 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
598 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
600 // Reserve some memory inside the message queue
601 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
603 // Construct message in the message queue memory; note that delete should not be called on the return value
604 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyNotification, &propertyNotification );
607 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
608 const PropertyNotification* constPropertyNotification,
609 PropertyNotification::NotifyMode notifyMode )
611 // The scene-graph thread owns this object so it can safely edit it.
612 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
614 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
616 // Reserve some memory inside the message queue
617 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
619 // Construct message in the message queue memory; note that delete should not be called on the return value
620 new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
623 // The render thread can safely change the Shader
624 inline void AddShaderMessage( UpdateManager& manager, Shader& shader )
626 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > LocalType;
628 // Reserve some memory inside the message queue
629 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
631 // Construct message in the message queue memory; note that delete should not be called on the return value
632 new (slot) LocalType( &manager, &UpdateManager::AddShader, &shader );
635 // The render thread can safely change the Shader
636 inline void RemoveShaderMessage( UpdateManager& manager, Shader& shader )
638 typedef MessageValue1< UpdateManager, Shader* > LocalType;
640 // Reserve some memory inside the message queue
641 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
643 // Construct message in the message queue memory; note that delete should not be called on the return value
644 new (slot) LocalType( &manager, &UpdateManager::RemoveShader, &shader );
647 inline void SetShaderProgramMessage( UpdateManager& manager,
649 GeometryType geometryType,
650 ShaderSubTypes subType,
651 Integration::ResourceId resourceId,
653 bool modifiesGeometry )
655 typedef MessageValue6< UpdateManager, Shader*, GeometryType, ShaderSubTypes, Integration::ResourceId, size_t, bool > LocalType;
657 // Reserve some memory inside the message queue
658 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
660 // Construct message in the message queue memory; note that delete should not be called on the return value
661 new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, &shader, geometryType, subType, resourceId, shaderHash, modifiesGeometry );
664 inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
666 typedef MessageValue1< UpdateManager, Vector4 > LocalType;
668 // Reserve some memory inside the message queue
669 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
671 // Construct message in the message queue memory; note that delete should not be called on the return value
672 new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
675 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int>& rect )
677 typedef MessageValue1< UpdateManager, Rect<int> > LocalType;
679 // Reserve some memory inside the message queue
680 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
682 // Construct message in the message queue memory; note that delete should not be called on the return value
683 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
686 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
688 typedef MessageValue1< UpdateManager, float > LocalType;
690 // Reserve some memory inside the message queue
691 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
693 // Construct message in the message queue memory; note that delete should not be called on the return value
694 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
698 * Create a message for setting the depth of a layer
699 * @param[in] manager The update manager
700 * @param[in] layers list of layers
701 * @param[in] systemLevel True if the layers are added via the SystemOverlay API
703 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, bool systemLevel )
705 typedef MessageValue2< UpdateManager, std::vector< Layer* >, bool > LocalType;
707 // Reserve some memory inside the message queue
708 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
710 // Construct message in the message queue memory; note that delete should not be called on the return value
711 new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, systemLevel );
714 inline void AddGestureMessage( UpdateManager& manager, PanGesture* gesture )
716 typedef MessageValue1< UpdateManager, PanGesture* > 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::AddGesture, gesture );
725 inline void RemoveGestureMessage( UpdateManager& manager, PanGesture* gesture )
727 typedef MessageValue1< UpdateManager, PanGesture* > LocalType;
729 // Reserve some memory inside the message queue
730 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
732 // Construct message in the message queue memory; note that delete should not be called on the return value
733 new (slot) LocalType( &manager, &UpdateManager::RemoveGesture, gesture );
736 #ifdef DYNAMICS_SUPPORT
739 inline void InitializeDynamicsWorldMessage( UpdateManager& manager, DynamicsWorld* dynamicsworld, Integration::DynamicsWorldSettings* worldSettings )
741 typedef MessageValue2< UpdateManager, DynamicsWorld*, Integration::DynamicsWorldSettings* > LocalType;
743 // Reserve some memory inside the message queue
744 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
746 // Construct message in the message queue memory; note that delete should not be called on the return value
747 new (slot) LocalType( &manager, &UpdateManager::InitializeDynamicsWorld, dynamicsworld, worldSettings );
750 inline void TerminateDynamicsWorldMessage(UpdateManager& manager)
752 typedef Message< UpdateManager > LocalType;
754 // Reserve some memory inside the message queue
755 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
757 // Construct message in the message queue memory; note that delete should not be called on the return value
758 new (slot) LocalType( &manager, &UpdateManager::TerminateDynamicsWorld );
761 #endif // DYNAMICS_SUPPORT
763 } // namespace SceneGraph
765 } // namespace Internal
769 #endif // __DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H__