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/common/double-buffered.h>
34 #include <dali/internal/update/modeling/scene-graph-animatable-mesh.h>
35 #include <dali/internal/update/nodes/scene-graph-layer.h>
36 #include <dali/internal/event/effects/shader-declarations.h>
37 #include <dali/internal/common/type-abstraction-enums.h>
44 class GlSyncAbstraction;
45 class RenderController;
46 struct DynamicsWorldSettings;
48 } // namespace Integration
53 class PropertyNotifier;
55 struct DynamicsWorldSettings;
56 class NotificationManager;
57 class CompleteNotificationInterface;
58 class ResourceManager;
61 // value types used by messages
62 template <> struct ParameterType< PropertyNotification::NotifyMode >
63 : public BasicType< PropertyNotification::NotifyMode > {};
78 typedef OwnerContainer< AnimatableMesh* > AnimatableMeshContainer;
79 typedef OwnerContainer< Material* > MaterialContainer;
82 * UpdateManager holds a scene graph i.e. a tree of nodes.
83 * It controls the Update traversal, in which nodes are repositioned/animated,
84 * and organizes the the culling and rendering of the scene.
91 * Construct a new UpdateManager.
92 * @param[in] notificationManager This should be notified when animations have finished.
93 * @param[in] glSyncAbstraction Used to determine when framebuffers are ready
94 * @param[in] animationFinishedNotifier The CompleteNotificationInterface that handles animation completions
95 * @param[in] propertyNotifier The PropertyNotifier
96 * @param[in] resourceManager The resource manager used to load textures etc.
97 * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
98 * @param[in] controller After messages are flushed, we request a render from the RenderController.
99 * @param[in] renderManager This is responsible for rendering the results of each "update".
100 * @param[in] renderQueue Used to queue messages for the next render.
101 * @param[in] textureCache Used for caching textures.
102 * @param[in] touchResampler Used for re-sampling touch events.
104 UpdateManager( NotificationManager& notificationManager,
105 Integration::GlSyncAbstraction& glSyncAbstraction,
106 CompleteNotificationInterface& animationFinishedNotifier,
107 PropertyNotifier& propertyNotifier,
108 ResourceManager& resourceManager,
109 DiscardQueue& discardQueue,
110 Integration::RenderController& controller,
111 RenderManager& renderManager,
112 RenderQueue& renderQueue,
113 TextureCache& textureCache,
114 TouchResampler& touchResampler );
117 * Destructor. Not virtual as this is not a base class
122 * The event-thread uses this interface to queue messages for the next update.
123 * @return The event-to-update interface.
125 EventToUpdate& GetEventToUpdate();
128 * @return the event buffer index
130 BufferIndex GetEventBufferIndex() const
132 // inlined as its called often
133 return mSceneGraphBuffers.GetEventBufferIndex();
136 // Node connection methods
139 * Get the scene graph side list of RenderTasks.
140 * @param[in] systemLevel True if using the system-level overlay.
141 * @return The list of render tasks
143 RenderTaskList* GetRenderTaskList( bool systemLevel );
146 * Installs a new layer as the root node.
147 * @pre The UpdateManager does not already have an installed root node.
148 * @pre The layer is of derived Node type Layer.
149 * @pre The layer does not have a parent.
150 * @param[in] layer The new root node.
151 * @param[in] systemLevel True if using the system-level overlay.
152 * @post The node is owned by UpdateManager.
154 void InstallRoot( Layer* layer, bool systemLevel );
157 * Add a Node; UpdateManager takes ownership.
158 * @pre The node does not have a parent.
159 * @param[in] node The node to add.
161 void AddNode( Node* node );
164 * Connect a Node to the scene-graph.
165 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
166 * @pre The node does not already have a parent.
167 * @param[in] node The new parent node.
168 * @param[in] node The node to connect.
170 void ConnectNode( Node* parent, Node* node, int index );
173 * Disconnect a Node from the scene-graph.
174 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
175 * @pre The node has a parent.
176 * @param[in] node The node to disconnect.
178 void DisconnectNode( Node* node );
181 * Called when a property is set on a disconnected Node (via public API)
182 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
183 * @pre The node does not have a parent.
184 * @param[in] node The node to set as "active".
186 void SetNodeActive( Node* node );
189 * Destroy a Node owned by UpdateManager.
190 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
191 * In the following update, the previously queued Nodes may be deleted.
192 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
193 * @param[in] node The node to destroy.
195 void DestroyNode( Node* node );
198 * Attach an object to a Node.
199 * The UpdateManager is responsible for calling NodeAttachment::Initialize().
200 * @param[in] node The node which will own the attachment.
201 * @param[in] attachment The object to attach.
203 void AttachToNode( Node* node, NodeAttachment* attachment );
206 * Add a newly created object.
207 * @param[in] object The object to add.
208 * @post The object is owned by UpdateManager.
210 void AddObject( PropertyOwner* object );
214 * @param[in] object The object to remove.
216 void RemoveObject( PropertyOwner* object );
221 * Add a newly created animation.
222 * @param[in] animation The animation to add.
223 * @post The animation is owned by UpdateManager.
225 void AddAnimation( Animation* animation );
229 * @param[in] animation The animation to stop.
231 void StopAnimation( Animation* animation );
234 * Remove an animation.
235 * @param[in] animation The animation to remove.
237 void RemoveAnimation( Animation* animation );
240 * Query whether any animations are currently running.
241 * @return True if any animations are running.
243 bool IsAnimationRunning() const;
245 // Property Notification
248 * Add a newly created property notification
249 * @param[in] propertyNotification The notification to add
250 * @post The propertyNotification is owned by UpdateManager.
252 void AddPropertyNotification( PropertyNotification* propertyNotification );
255 * Remove a property notification
256 * @param[in] propertyNotification The notification to remove
258 void RemovePropertyNotification( PropertyNotification* propertyNotification );
261 * Set Notify state for PropertyNotification
262 * @param[in] propertyNotification The notification to remove
263 * @param[in] notifyMode The notification mode.
265 void PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode );
270 * Add a newly created shader.
271 * @param[in] shader The shader to add.
272 * @post The shader is owned by the UpdateManager.
274 void AddShader(Shader* shader);
278 * @pre The shader has been added to the UpdateManager.
279 * @param[in] shader The shader to remove.
280 * @post The shader is destroyed.
282 void RemoveShader(Shader* shader);
285 * Set the shader program for a specified GeometryType to a Shader object
286 * @param[in] shader The shader to modify
287 * @param[in] geometryType The GeometryType to map to the program
288 * @param[in] subType The program subtype
289 * @param[in] resourceId A ResourceManager ticket ID for the program data (source and compiled binary)
290 * @param[in] shaderHash hash key created with vertex and fragment shader code
291 * @param[in] modifiesGeometry True if the vertex shader modifies geometry
293 void SetShaderProgram( Shader* shader, GeometryType geometryType, ShaderSubTypes subType, Integration::ResourceId resourceId, size_t shaderHash, bool modifiesGeometry );
296 * Add an animatable mesh
297 * @param[in] animatableMesh The animatable mesh to add.
298 * @post the animatableMesh is owned by the UpdateManager.
300 void AddAnimatableMesh( AnimatableMesh* animatableMesh );
303 * Remove an animatable mesh
304 * @pre The animatable mesh has been added to the update manager
305 * @param[in] animatableMesh The animatable mesh to add.
307 void RemoveAnimatableMesh( AnimatableMesh* animatableMesh );
311 * @param[in] material The material to add
312 * @post the material remains owned by its event object
314 void AddMaterial(Material* material);
318 * @pre The material has been added to the UpdateManager
319 * @param[in] material The material to remove
321 void RemoveMaterial(Material* material);
324 * Add a newly created gesture.
325 * @param[in] gesture The gesture to add.
326 * @post The gesture is owned by the UpdateManager.
328 void AddGesture( PanGesture* gesture );
332 * @pre The gesture has been added to the UpdateManager.
333 * @param[in] gesture The gesture to remove.
334 * @post The gesture is destroyed.
336 void RemoveGesture( PanGesture* gesture );
341 * Performs an Update traversal on the scene-graph.
342 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
343 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
344 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
345 * @return True if further updates are required e.g. during animations.
347 unsigned int Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
350 * Set the background color i.e. the glClear color used at the beginning of each frame.
351 * @param[in] color The new background color.
353 void SetBackgroundColor(const Vector4& color);
356 * Set the default surface rect.
357 * @param[in] rect The rect value representing the surface.
359 void SetDefaultSurfaceRect( const Rect<int>& rect );
362 * @copydoc Dali::Stage::KeepRendering()
364 void KeepRendering( float durationSeconds );
367 * Sets the depths of all layers.
368 * @param layers The layers in depth order.
369 * @param[in] systemLevel True if using the system-level overlay.
371 void SetLayerDepths( const std::vector< Layer* >& layers, bool systemLevel );
373 #ifdef DYNAMICS_SUPPORT
376 * Initialize the dynamics world
377 * @param[in] world The dynamics world
378 * @param[in] worldSettings The dynamics world settings
379 * @param[in] debugShader The shader used for rendering dynamics debug information
381 void InitializeDynamicsWorld( DynamicsWorld* world, Integration::DynamicsWorldSettings* worldSettings );
384 * Terminate the dynamics world
386 void TerminateDynamicsWorld();
388 #endif // DYNAMICS_SUPPORT
393 UpdateManager(const UpdateManager&);
396 UpdateManager& operator=(const UpdateManager& rhs);
399 * Helper to check whether the update-thread should keep going.
400 * @param[in] elapsedSeconds The time in seconds since the previous update.
401 * @return True if the update-thread should keep going.
403 unsigned int KeepUpdatingCheck( float elapsedSeconds ) const;
406 * Helper to calculate new camera setup when root node resizes.
407 * @param[in] updateBuffer The buffer to read the root node size from.
409 void UpdateProjectionAndViewMatrices(int updateBuffer);
412 * Post process resources that have been updated by renderer
414 void PostProcessResources();
417 * Helper to reset a Node properties.
418 * @param[in] node The node.
420 void ResetNodeProperty( Node& node );
423 * Helper to reset all Node properties
425 void ResetProperties();
428 * Perform gesture updates.
429 * @param[in] lastVSyncTime The last VSync time in milliseconds.
430 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
431 * @return true, if any properties were updated.
433 bool ProcessGestures( unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
436 * Perform animation updates
437 * @param[in] elapsedSeconds time since last frame
439 void Animate( float elapsedSeconds );
442 * Perform constraint updates.
443 * @note Applies constraints to nodes first (depth first search order).
444 * Then shader constraints second (construction order)
446 void ApplyConstraints();
449 * Perform property notification updates
451 void ProcessPropertyNotifications();
454 * Update the default camera.
455 * This must be altered to match the root Node for 2D layouting.
456 * @param[in] updateBuffer The buffer to read the root node size from.
458 void UpdateDefaultCamera( int updateBuffer );
461 * Update node shaders, opacity, geometry etc.
466 * Update animatable meshes
468 void UpdateMeshes( BufferIndex updateBufferIndex, AnimatableMeshContainer& meshes );
471 * Update materials - Ensure all render materials are updated with texture pointers
474 void UpdateMaterials( BufferIndex updateBufferIndex, MaterialContainer& materials );
477 * PrepareMaterials - Ensure updated material properties are sent to render materials
479 void PrepareMaterials( BufferIndex updateBufferIndex, MaterialContainer& materials );
483 // needs to be direct member so that getter for event buffer can be inlined
484 SceneGraphBuffers mSceneGraphBuffers;
491 // Messages for UpdateManager
493 inline void InstallRootMessage( UpdateManager& manager, Layer& root, bool systemLevel )
495 typedef MessageValue2< UpdateManager, Layer*, bool > LocalType;
497 // Reserve some memory inside the message queue
498 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
500 // Construct message in the message queue memory; note that delete should not be called on the return value
501 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, &root, systemLevel );
504 inline void AddNodeMessage( UpdateManager& manager, Node& node )
506 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
508 // Reserve some memory inside the message queue
509 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
511 // Construct message in the message queue memory; note that delete should not be called on the return value
512 new (slot) LocalType( &manager, &UpdateManager::AddNode, &node );
515 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild, int index )
517 // Update thread can edit the object
518 Node& parent = const_cast< Node& >( constParent );
519 Node& child = const_cast< Node& >( constChild );
521 typedef MessageValue3< UpdateManager, Node*, Node*, int > LocalType;
523 // Reserve some memory inside the message queue
524 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
526 // Construct message in the message queue memory; note that delete should not be called on the return value
527 new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child, index );
530 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
532 // Scene graph thread can modify this object.
533 Node& node = const_cast< Node& >( constNode );
535 typedef MessageValue1< UpdateManager, Node* > LocalType;
537 // Reserve some memory inside the message queue
538 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
540 // Construct message in the message queue memory; note that delete should not be called on the return value
541 new (slot) LocalType( &manager, &UpdateManager::DisconnectNode, &node );
544 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
546 // Scene graph thread can destroy this object.
547 Node& node = const_cast< Node& >( constNode );
549 typedef MessageValue1< UpdateManager, Node* > LocalType;
551 // Reserve some memory inside the message queue
552 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
554 // Construct message in the message queue memory; note that delete should not be called on the return value
555 new (slot) LocalType( &manager, &UpdateManager::DestroyNode, &node );
558 inline void AttachToNodeMessage( UpdateManager& manager, const Node& constParent, NodeAttachment* attachment )
560 // Scene graph thread can modify this object.
561 Node& parent = const_cast< Node& >( constParent );
563 typedef MessageValue2< UpdateManager, Node*, NodeAttachmentOwner > LocalType;
565 // Reserve some memory inside the message queue
566 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
568 // Construct message in the message queue memory; note that delete should not be called on the return value
569 new (slot) LocalType( &manager, &UpdateManager::AttachToNode, &parent, attachment );
572 inline void AddObjectMessage( UpdateManager& manager, PropertyOwner* object )
574 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
576 // Reserve some memory inside the message queue
577 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
579 // Construct message in the message queue memory; note that delete should not be called on the return value
580 new (slot) LocalType( &manager, &UpdateManager::AddObject, object );
583 inline void RemoveObjectMessage( UpdateManager& manager, PropertyOwner* object )
585 typedef MessageValue1< UpdateManager, PropertyOwner* > LocalType;
587 // Reserve some memory inside the message queue
588 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
590 // Construct message in the message queue memory; note that delete should not be called on the return value
591 new (slot) LocalType( &manager, &UpdateManager::RemoveObject, object );
594 inline void AddAnimationMessage( UpdateManager& manager, Animation* animation )
596 typedef MessageValue1< UpdateManager, Animation* > LocalType;
598 // Reserve some memory inside the message queue
599 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
601 // Construct message in the message queue memory; note that delete should not be called on the return value
602 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
605 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
607 // The scene-graph thread owns this object so it can safely edit it.
608 Animation& animation = const_cast< Animation& >( constAnimation );
610 typedef MessageValue1< UpdateManager, Animation* > LocalType;
612 // Reserve some memory inside the message queue
613 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
615 // Construct message in the message queue memory; note that delete should not be called on the return value
616 new (slot) LocalType( &manager, &UpdateManager::StopAnimation, &animation );
619 inline void RemoveAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
621 // The scene-graph thread owns this object so it can safely edit it.
622 Animation& animation = const_cast< Animation& >( constAnimation );
624 typedef MessageValue1< UpdateManager, Animation* > LocalType;
626 // Reserve some memory inside the message queue
627 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
629 // Construct message in the message queue memory; note that delete should not be called on the return value
630 new (slot) LocalType( &manager, &UpdateManager::RemoveAnimation, &animation );
633 inline void AddPropertyNotificationMessage( UpdateManager& manager, PropertyNotification* propertyNotification )
635 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
637 // Reserve some memory inside the message queue
638 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
640 // Construct message in the message queue memory; note that delete should not be called on the return value
641 new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
644 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
646 // The scene-graph thread owns this object so it can safely edit it.
647 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
649 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
651 // Reserve some memory inside the message queue
652 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
654 // Construct message in the message queue memory; note that delete should not be called on the return value
655 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyNotification, &propertyNotification );
658 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
659 const PropertyNotification* constPropertyNotification,
660 PropertyNotification::NotifyMode notifyMode )
662 // The scene-graph thread owns this object so it can safely edit it.
663 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
665 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
667 // Reserve some memory inside the message queue
668 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
670 // Construct message in the message queue memory; note that delete should not be called on the return value
671 new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
674 // The render thread can safely change the Shader
675 inline void AddShaderMessage( UpdateManager& manager, Shader& shader )
677 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > 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::AddShader, &shader );
686 // The render thread can safely change the Shader
687 inline void RemoveShaderMessage( UpdateManager& manager, Shader& shader )
689 typedef MessageValue1< UpdateManager, Shader* > LocalType;
691 // Reserve some memory inside the message queue
692 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
694 // Construct message in the message queue memory; note that delete should not be called on the return value
695 new (slot) LocalType( &manager, &UpdateManager::RemoveShader, &shader );
698 inline void SetShaderProgramMessage( UpdateManager& manager,
700 GeometryType geometryType,
701 ShaderSubTypes subType,
702 Integration::ResourceId resourceId,
704 bool modifiesGeometry )
706 typedef MessageValue6< UpdateManager, Shader*, GeometryType, ShaderSubTypes, Integration::ResourceId, size_t, bool > LocalType;
708 // Reserve some memory inside the message queue
709 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
711 // Construct message in the message queue memory; note that delete should not be called on the return value
712 new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, &shader, geometryType, subType, resourceId, shaderHash, modifiesGeometry );
715 // The render thread can safely change the AnimatableMesh
716 inline void AddAnimatableMeshMessage( UpdateManager& manager, AnimatableMesh& animatableMesh )
718 typedef MessageValue1< UpdateManager, AnimatableMesh* > LocalType;
720 // Reserve some memory inside the message queue
721 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
723 // Construct message in the message queue memory; note that delete should not be called on the return value
724 new (slot) LocalType( &manager, &UpdateManager::AddAnimatableMesh, &animatableMesh );
727 // The render thread can safely change the AnimatableMesh
728 inline void RemoveAnimatableMeshMessage( UpdateManager& manager, AnimatableMesh& animatableMesh )
730 typedef MessageValue1< UpdateManager, AnimatableMesh* > LocalType;
732 // Reserve some memory inside the message queue
733 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
735 // Construct message in the message queue memory; note that delete should not be called on the return value
736 new (slot) LocalType( &manager, &UpdateManager::RemoveAnimatableMesh, &animatableMesh );
740 inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
742 typedef MessageValue1< UpdateManager, Vector4 > LocalType;
744 // Reserve some memory inside the message queue
745 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
747 // Construct message in the message queue memory; note that delete should not be called on the return value
748 new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
751 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int>& rect )
753 typedef MessageValue1< UpdateManager, Rect<int> > LocalType;
755 // Reserve some memory inside the message queue
756 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
758 // Construct message in the message queue memory; note that delete should not be called on the return value
759 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
762 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
764 typedef MessageValue1< UpdateManager, float > LocalType;
766 // Reserve some memory inside the message queue
767 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
769 // Construct message in the message queue memory; note that delete should not be called on the return value
770 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
774 * Create a message for setting the depth of a layer
775 * @param[in] manager The update manager
776 * @param[in] layers list of layers
777 * @param[in] systemLevel True if the layers are added via the SystemOverlay API
779 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, bool systemLevel )
781 typedef MessageValue2< UpdateManager, std::vector< Layer* >, bool > LocalType;
783 // Reserve some memory inside the message queue
784 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
786 // Construct message in the message queue memory; note that delete should not be called on the return value
787 new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, systemLevel );
790 inline void AddMaterialMessage( UpdateManager& manager, Material* material )
792 typedef MessageValue1< UpdateManager, Material* > LocalType;
794 // Reserve some memory inside the message queue
795 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
797 // Construct message in the message queue memory; note that delete should not be called on the return value
798 new (slot) LocalType( &manager, &UpdateManager::AddMaterial, material );
801 inline void RemoveMaterialMessage( UpdateManager& manager, Material* material )
803 typedef MessageValue1< UpdateManager, Material* > LocalType;
805 // Reserve some memory inside the message queue
806 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
808 // Construct message in the message queue memory; note that delete should not be called on the return value
809 new (slot) LocalType( &manager, &UpdateManager::RemoveMaterial, material );
812 inline void AddGestureMessage( UpdateManager& manager, PanGesture* gesture )
814 typedef MessageValue1< UpdateManager, PanGesture* > LocalType;
816 // Reserve some memory inside the message queue
817 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
819 // Construct message in the message queue memory; note that delete should not be called on the return value
820 new (slot) LocalType( &manager, &UpdateManager::AddGesture, gesture );
823 inline void RemoveGestureMessage( UpdateManager& manager, PanGesture* gesture )
825 typedef MessageValue1< UpdateManager, PanGesture* > LocalType;
827 // Reserve some memory inside the message queue
828 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
830 // Construct message in the message queue memory; note that delete should not be called on the return value
831 new (slot) LocalType( &manager, &UpdateManager::RemoveGesture, gesture );
834 #ifdef DYNAMICS_SUPPORT
837 inline void InitializeDynamicsWorldMessage( UpdateManager& manager, DynamicsWorld* dynamicsworld, Integration::DynamicsWorldSettings* worldSettings )
839 typedef MessageValue2< UpdateManager, DynamicsWorld*, Integration::DynamicsWorldSettings* > LocalType;
841 // Reserve some memory inside the message queue
842 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
844 // Construct message in the message queue memory; note that delete should not be called on the return value
845 new (slot) LocalType( &manager, &UpdateManager::InitializeDynamicsWorld, dynamicsworld, worldSettings );
848 inline void TerminateDynamicsWorldMessage(UpdateManager& manager)
850 typedef Message< UpdateManager > LocalType;
852 // Reserve some memory inside the message queue
853 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
855 // Construct message in the message queue memory; note that delete should not be called on the return value
856 new (slot) LocalType( &manager, &UpdateManager::TerminateDynamicsWorld );
859 #endif // DYNAMICS_SUPPORT
861 } // namespace SceneGraph
863 } // namespace Internal
867 #endif // __DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H__