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 AnimationFinishedNotifier;
54 class PropertyNotifier;
56 struct DynamicsWorldSettings;
57 class NotificationManager;
58 class ResourceManager;
62 // value types used by messages
63 template <> struct ParameterType< PropertyNotification::NotifyMode >
64 : public BasicType< PropertyNotification::NotifyMode > {};
79 typedef OwnerContainer< AnimatableMesh* > AnimatableMeshContainer;
80 typedef OwnerContainer< Material* > MaterialContainer;
83 * UpdateManager holds a scene graph i.e. a tree of nodes.
84 * It controls the Update traversal, in which nodes are repositioned/animated,
85 * and organizes the the culling and rendering of the scene.
92 * Construct a new UpdateManager.
93 * @param[in] notificationManager This should be notified when animations have finished.
94 * @param[in] glSyncAbstraction Used to determine when framebuffers are ready
95 * @param[in] animationFinishedNotifier The AnimationFinishedNotifier
96 * @param[in] propertyNotifier The PropertyNotifier
97 * @param[in] resourceManager The resource manager used to load textures etc.
98 * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
99 * @param[in] controller After messages are flushed, we request a render from the RenderController.
100 * @param[in] renderManager This is responsible for rendering the results of each "update".
101 * @param[in] renderQueue Used to queue messages for the next render.
102 * @param[in] textureCache Used for caching textures.
103 * @param[in] touchResampler Used for re-sampling touch events.
105 UpdateManager( NotificationManager& notificationManager,
106 Integration::GlSyncAbstraction& glSyncAbstraction,
107 AnimationFinishedNotifier& animationFinishedNotifier,
108 PropertyNotifier& propertyNotifier,
109 ResourceManager& resourceManager,
110 DiscardQueue& discardQueue,
111 Integration::RenderController& controller,
112 RenderManager& renderManager,
113 RenderQueue& renderQueue,
114 TextureCache& textureCache,
115 TouchResampler& touchResampler );
118 * Destructor. Not virtual as this is not a base class
123 * Sets a pointer to the internal render task list.
125 * The render task list is used to notify which render tasks with refresh rate REFRESH_ONCE have finished.
127 * @param[in] renderTaskList A pointer to the internal render task list.
129 void SetRenderTaskList( Internal::RenderTaskList* renderTaskList );
132 * The event-thread uses this interface to queue messages for the next update.
133 * @return The event-to-update interface.
135 EventToUpdate& GetEventToUpdate();
138 * @return the event buffer index
140 BufferIndex GetEventBufferIndex() const
142 // inlined as its called often
143 return mSceneGraphBuffers.GetEventBufferIndex();
146 // Node connection methods
149 * Get the scene graph side list of RenderTasks.
150 * @param[in] systemLevel True if using the system-level overlay.
151 * @return The list of render tasks
153 RenderTaskList* GetRenderTaskList( bool systemLevel );
156 * Installs a new layer as the root node.
157 * @pre The UpdateManager does not already have an installed root node.
158 * @pre The layer is of derived Node type Layer.
159 * @pre The layer does not have a parent.
160 * @param[in] layer The new root node.
161 * @param[in] systemLevel True if using the system-level overlay.
162 * @post The node is owned by UpdateManager.
164 void InstallRoot( Layer* layer, bool systemLevel );
167 * Add a Node; UpdateManager takes ownership.
168 * @pre The node does not have a parent.
169 * @param[in] node The node to add.
171 void AddNode( Node* node );
174 * Connect a Node to the scene-graph.
175 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
176 * @pre The node does not already have a parent.
177 * @param[in] node The new parent node.
178 * @param[in] node The node to connect.
180 void ConnectNode( Node* parent, Node* node );
183 * Disconnect a Node from the scene-graph.
184 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
185 * @pre The node has a parent.
186 * @param[in] node The node to disconnect.
188 void DisconnectNode( Node* node );
191 * Called when a property is set on a disconnected Node (via public API)
192 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
193 * @pre The node does not have a parent.
194 * @param[in] node The node to set as "active".
196 void SetNodeActive( Node* node );
199 * Destroy a Node owned by UpdateManager.
200 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
201 * In the following update, the previously queued Nodes may be deleted.
202 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
203 * @param[in] node The node to destroy.
205 void DestroyNode( Node* node );
208 * Attach an object to a Node.
209 * The UpdateManager is responsible for calling NodeAttachment::Initialize().
210 * @param[in] node The node which will own the attachment.
211 * @param[in] attachment The object to attach.
213 void AttachToNode( Node* node, NodeAttachment* attachment );
216 * Add a newly created object.
217 * @param[in] object The object to add.
218 * @post The object is owned by UpdateManager.
220 void AddObject( PropertyOwner* object );
224 * @param[in] object The object to remove.
226 void RemoveObject( PropertyOwner* object );
231 * Add a newly created animation.
232 * @param[in] animation The animation to add.
233 * @post The animation is owned by UpdateManager.
235 void AddAnimation( Animation* animation );
239 * @param[in] animation The animation to stop.
241 void StopAnimation( Animation* animation );
244 * Remove an animation.
245 * @param[in] animation The animation to remove.
247 void RemoveAnimation( Animation* animation );
250 * Query whether any animations are currently running.
251 * @return True if any animations are running.
253 bool IsAnimationRunning() const;
255 // Property Notification
258 * Add a newly created property notification
259 * @param[in] propertyNotification The notification to add
260 * @post The propertyNotification is owned by UpdateManager.
262 void AddPropertyNotification( PropertyNotification* propertyNotification );
265 * Remove a property notification
266 * @param[in] propertyNotification The notification to remove
268 void RemovePropertyNotification( PropertyNotification* propertyNotification );
271 * Set Notify state for PropertyNotification
272 * @param[in] propertyNotification The notification to remove
273 * @param[in] notifyMode The notification mode.
275 void PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode );
280 * Retrieve the default shader.
281 * @return The default shader.
283 Shader* GetDefaultShader();
286 * Add a newly created shader.
287 * @param[in] shader The shader to add.
288 * @post The shader is owned by the UpdateManager.
290 void AddShader(Shader* shader);
294 * @pre The shader has been added to the UpdateManager.
295 * @param[in] shader The shader to remove.
296 * @post The shader is destroyed.
298 void RemoveShader(Shader* shader);
301 * Set the shader program for a specified GeometryType to a Shader object
302 * @param[in] shader The shader to modify
303 * @param[in] geometryType The GeometryType to map to the program
304 * @param[in] subType The program subtype
305 * @param[in] resourceId A ResourceManager ticket ID for the program data (source and compiled binary)
306 * @param[in] shaderHash hash key created with vertex and fragment shader code
307 * @param[in] fixed True if the vertex shader doesn't alter vertices
309 void SetShaderProgram( Shader* shader, GeometryType geometryType, ShaderSubTypes subType, Integration::ResourceId resourceId, size_t shaderHash, bool fixed );
312 * Add an animatable mesh
313 * @param[in] animatableMesh The animatable mesh to add.
314 * @post the animatableMesh is owned by the UpdateManager.
316 void AddAnimatableMesh( AnimatableMesh* animatableMesh );
319 * Remove an animatable mesh
320 * @pre The animatable mesh has been added to the update manager
321 * @param[in] animatableMesh The animatable mesh to add.
323 void RemoveAnimatableMesh( AnimatableMesh* animatableMesh );
327 * @param[in] material The material to add
328 * @post the material remains owned by its event object
330 void AddMaterial(Material* material);
334 * @pre The material has been added to the UpdateManager
335 * @param[in] material The material to remove
337 void RemoveMaterial(Material* material);
340 * Add a newly created gesture.
341 * @param[in] gesture The gesture to add.
342 * @post The gesture is owned by the UpdateManager.
344 void AddGesture( PanGesture* gesture );
348 * @pre The gesture has been added to the UpdateManager.
349 * @param[in] gesture The gesture to remove.
350 * @post The gesture is destroyed.
352 void RemoveGesture( PanGesture* gesture );
357 * Performs an Update traversal on the scene-graph.
358 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
359 * @param[in] lastVSyncTime The last time, in milliseconds, that we had a VSync.
360 * @param[in] nextVSyncTime The estimated time, in milliseconds, of the next VSync.
361 * @return True if further updates are required e.g. during animations.
363 unsigned int Update( float elapsedSeconds, unsigned int lastVSyncTime, unsigned int nextVSyncTime );
366 * Set the background color i.e. the glClear color used at the beginning of each frame.
367 * @param[in] color The new background color.
369 void SetBackgroundColor(const Vector4& color);
372 * Set the default surface rect.
373 * @param[in] rect The rect value representing the surface.
375 void SetDefaultSurfaceRect( const Rect<int>& rect );
378 * @copydoc Dali::Stage::KeepRendering()
380 void KeepRendering( float durationSeconds );
383 * Sets the depths of all layers.
384 * @param layers The layers in depth order.
385 * @param[in] systemLevel True if using the system-level overlay.
387 void SetLayerDepths( const std::vector< Layer* >& layers, bool systemLevel );
389 #ifdef DYNAMICS_SUPPORT
392 * Initialize the dynamics world
393 * @param[in] world The dynamics world
394 * @param[in] worldSettings The dynamics world settings
395 * @param[in] debugShader The shader used for rendering dynamics debug information
397 void InitializeDynamicsWorld( DynamicsWorld* world, Integration::DynamicsWorldSettings* worldSettings );
400 * Terminate the dynamics world
402 void TerminateDynamicsWorld();
404 #endif // DYNAMICS_SUPPORT
409 UpdateManager(const UpdateManager&);
412 UpdateManager& operator=(const UpdateManager& rhs);
415 * Helper to check whether the update-thread should keep going.
416 * @param[in] elapsedSeconds The time in seconds since the previous update.
417 * @return True if the update-thread should keep going.
419 unsigned int KeepUpdatingCheck( float elapsedSeconds ) const;
422 * Helper to calculate new camera setup when root node resizes.
423 * @param[in] updateBuffer The buffer to read the root node size from.
425 void UpdateProjectionAndViewMatrices(int updateBuffer);
428 * Post process resources that have been updated by renderer
430 void PostProcessResources();
433 * Helper to reset a Node properties.
434 * @param[in] node The node.
436 void ResetNodeProperty( Node& node );
439 * Helper to reset all Node properties
441 void ResetProperties();
444 * Perform gesture updates.
445 * @param[in] lastVSyncTime The last VSync time.
446 * @param[in] nextVSyncTime The estimated time of the next VSync.
447 * @return true, if any properties were updated.
449 bool ProcessGestures( unsigned int lastVSyncTime, unsigned int nextVSyncTime );
452 * Perform animation updates
453 * @param[in] elapsedSeconds time since last frame
455 void Animate( float elapsedSeconds );
458 * Perform constraint updates.
459 * @note Applies constraints to nodes first (depth first search order).
460 * Then shader constraints second (construction order)
462 void ApplyConstraints();
465 * Perform property notification updates
467 void ProcessPropertyNotifications();
470 * Update the default camera.
471 * This must be altered to match the root Node for 2D layouting.
472 * @param[in] updateBuffer The buffer to read the root node size from.
474 void UpdateDefaultCamera( int updateBuffer );
477 * Update node shaders, opacity, geometry etc.
482 * Update animatable meshes
484 void UpdateMeshes( BufferIndex updateBufferIndex, AnimatableMeshContainer& meshes );
487 * Update materials - Ensure all render materials are updated with texture pointers
490 void UpdateMaterials( BufferIndex updateBufferIndex, MaterialContainer& materials );
493 * PrepareMaterials - Ensure updated material properties are sent to render materials
495 void PrepareMaterials( BufferIndex updateBufferIndex, MaterialContainer& materials );
499 // needs to be direct member so that getter for event buffer can be inlined
500 SceneGraphBuffers mSceneGraphBuffers;
507 // Messages for UpdateManager
509 inline void InstallRootMessage( UpdateManager& manager, Layer& root, bool systemLevel )
511 typedef MessageValue2< UpdateManager, Layer*, bool > LocalType;
513 // Reserve some memory inside the message queue
514 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
516 // Construct message in the message queue memory; note that delete should not be called on the return value
517 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, &root, systemLevel );
520 inline void AddNodeMessage( UpdateManager& manager, Node& node )
522 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
524 // Reserve some memory inside the message queue
525 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
527 // Construct message in the message queue memory; note that delete should not be called on the return value
528 new (slot) LocalType( &manager, &UpdateManager::AddNode, &node );
531 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild )
533 // Update thread can edit the object
534 Node& parent = const_cast< Node& >( constParent );
535 Node& child = const_cast< Node& >( constChild );
537 typedef MessageValue2< UpdateManager, Node*, Node* > LocalType;
539 // Reserve some memory inside the message queue
540 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
542 // Construct message in the message queue memory; note that delete should not be called on the return value
543 new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child );
546 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
548 // Scene graph thread can modify this object.
549 Node& node = const_cast< Node& >( constNode );
551 typedef MessageValue1< UpdateManager, Node* > LocalType;
553 // Reserve some memory inside the message queue
554 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
556 // Construct message in the message queue memory; note that delete should not be called on the return value
557 new (slot) LocalType( &manager, &UpdateManager::DisconnectNode, &node );
560 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
562 // Scene graph thread can destroy this object.
563 Node& node = const_cast< Node& >( constNode );
565 typedef MessageValue1< UpdateManager, Node* > LocalType;
567 // Reserve some memory inside the message queue
568 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
570 // Construct message in the message queue memory; note that delete should not be called on the return value
571 new (slot) LocalType( &manager, &UpdateManager::DestroyNode, &node );
574 inline void AttachToNodeMessage( UpdateManager& manager, const Node& constParent, NodeAttachment* attachment )
576 // Scene graph thread can modify this object.
577 Node& parent = const_cast< Node& >( constParent );
579 typedef MessageValue2< UpdateManager, Node*, NodeAttachmentOwner > LocalType;
581 // Reserve some memory inside the message queue
582 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
584 // Construct message in the message queue memory; note that delete should not be called on the return value
585 new (slot) LocalType( &manager, &UpdateManager::AttachToNode, &parent, attachment );
588 inline void AddObjectMessage( UpdateManager& manager, PropertyOwner* object )
590 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
592 // Reserve some memory inside the message queue
593 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
595 // Construct message in the message queue memory; note that delete should not be called on the return value
596 new (slot) LocalType( &manager, &UpdateManager::AddObject, object );
599 inline void RemoveObjectMessage( UpdateManager& manager, PropertyOwner* object )
601 typedef MessageValue1< UpdateManager, PropertyOwner* > LocalType;
603 // Reserve some memory inside the message queue
604 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
606 // Construct message in the message queue memory; note that delete should not be called on the return value
607 new (slot) LocalType( &manager, &UpdateManager::RemoveObject, object );
610 inline void AddAnimationMessage( UpdateManager& manager, Animation* animation )
612 typedef MessageValue1< UpdateManager, Animation* > LocalType;
614 // Reserve some memory inside the message queue
615 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
617 // Construct message in the message queue memory; note that delete should not be called on the return value
618 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
621 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
623 // The scene-graph thread owns this object so it can safely edit it.
624 Animation& animation = const_cast< Animation& >( constAnimation );
626 typedef MessageValue1< UpdateManager, Animation* > 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::StopAnimation, &animation );
635 inline void RemoveAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
637 // The scene-graph thread owns this object so it can safely edit it.
638 Animation& animation = const_cast< Animation& >( constAnimation );
640 typedef MessageValue1< UpdateManager, Animation* > LocalType;
642 // Reserve some memory inside the message queue
643 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
645 // Construct message in the message queue memory; note that delete should not be called on the return value
646 new (slot) LocalType( &manager, &UpdateManager::RemoveAnimation, &animation );
649 inline void AddPropertyNotificationMessage( UpdateManager& manager, PropertyNotification* propertyNotification )
651 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
653 // Reserve some memory inside the message queue
654 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
656 // Construct message in the message queue memory; note that delete should not be called on the return value
657 new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
660 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
662 // The scene-graph thread owns this object so it can safely edit it.
663 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
665 typedef MessageValue1< UpdateManager, PropertyNotification* > 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::RemovePropertyNotification, &propertyNotification );
674 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
675 const PropertyNotification* constPropertyNotification,
676 PropertyNotification::NotifyMode notifyMode )
678 // The scene-graph thread owns this object so it can safely edit it.
679 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
681 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
683 // Reserve some memory inside the message queue
684 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
686 // Construct message in the message queue memory; note that delete should not be called on the return value
687 new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
690 // The render thread can safely change the Shader
691 inline void AddShaderMessage( UpdateManager& manager, Shader& shader )
693 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > LocalType;
695 // Reserve some memory inside the message queue
696 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
698 // Construct message in the message queue memory; note that delete should not be called on the return value
699 new (slot) LocalType( &manager, &UpdateManager::AddShader, &shader );
702 // The render thread can safely change the Shader
703 inline void RemoveShaderMessage( UpdateManager& manager, Shader& shader )
705 typedef MessageValue1< UpdateManager, Shader* > 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::RemoveShader, &shader );
714 inline void SetShaderProgramMessage( UpdateManager& manager,
716 GeometryType geometryType,
717 ShaderSubTypes subType,
718 Integration::ResourceId resourceId,
722 typedef MessageValue6< UpdateManager, Shader*, GeometryType, ShaderSubTypes, Integration::ResourceId, size_t, bool > LocalType;
724 // Reserve some memory inside the message queue
725 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
727 // Construct message in the message queue memory; note that delete should not be called on the return value
728 new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, &shader, geometryType, subType, resourceId, shaderHash, fixed );
731 // The render thread can safely change the AnimatableMesh
732 inline void AddAnimatableMeshMessage( UpdateManager& manager, AnimatableMesh& animatableMesh )
734 typedef MessageValue1< UpdateManager, AnimatableMesh* > LocalType;
736 // Reserve some memory inside the message queue
737 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
739 // Construct message in the message queue memory; note that delete should not be called on the return value
740 new (slot) LocalType( &manager, &UpdateManager::AddAnimatableMesh, &animatableMesh );
743 // The render thread can safely change the AnimatableMesh
744 inline void RemoveAnimatableMeshMessage( UpdateManager& manager, AnimatableMesh& animatableMesh )
746 typedef MessageValue1< UpdateManager, AnimatableMesh* > LocalType;
748 // Reserve some memory inside the message queue
749 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
751 // Construct message in the message queue memory; note that delete should not be called on the return value
752 new (slot) LocalType( &manager, &UpdateManager::RemoveAnimatableMesh, &animatableMesh );
756 inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
758 typedef MessageValue1< UpdateManager, Vector4 > LocalType;
760 // Reserve some memory inside the message queue
761 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
763 // Construct message in the message queue memory; note that delete should not be called on the return value
764 new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
767 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int>& rect )
769 typedef MessageValue1< UpdateManager, Rect<int> > LocalType;
771 // Reserve some memory inside the message queue
772 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
774 // Construct message in the message queue memory; note that delete should not be called on the return value
775 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
778 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
780 typedef MessageValue1< UpdateManager, float > LocalType;
782 // Reserve some memory inside the message queue
783 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
785 // Construct message in the message queue memory; note that delete should not be called on the return value
786 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
790 * Create a message for setting the depth of a layer
791 * @param[in] manager The update manager
792 * @param[in] layers list of layers
793 * @param[in] systemLevel True if the layers are added via the SystemOverlay API
795 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, bool systemLevel )
797 typedef MessageValue2< UpdateManager, std::vector< Layer* >, bool > LocalType;
799 // Reserve some memory inside the message queue
800 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
802 // Construct message in the message queue memory; note that delete should not be called on the return value
803 new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, systemLevel );
806 inline void AddMaterialMessage( UpdateManager& manager, Material* material )
808 typedef MessageValue1< UpdateManager, Material* > LocalType;
810 // Reserve some memory inside the message queue
811 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
813 // Construct message in the message queue memory; note that delete should not be called on the return value
814 new (slot) LocalType( &manager, &UpdateManager::AddMaterial, material );
817 inline void RemoveMaterialMessage( UpdateManager& manager, Material* material )
819 typedef MessageValue1< UpdateManager, Material* > LocalType;
821 // Reserve some memory inside the message queue
822 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
824 // Construct message in the message queue memory; note that delete should not be called on the return value
825 new (slot) LocalType( &manager, &UpdateManager::RemoveMaterial, material );
828 inline void AddGestureMessage( UpdateManager& manager, PanGesture* gesture )
830 typedef MessageValue1< UpdateManager, PanGesture* > LocalType;
832 // Reserve some memory inside the message queue
833 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
835 // Construct message in the message queue memory; note that delete should not be called on the return value
836 new (slot) LocalType( &manager, &UpdateManager::AddGesture, gesture );
839 inline void RemoveGestureMessage( UpdateManager& manager, PanGesture* gesture )
841 typedef MessageValue1< UpdateManager, PanGesture* > LocalType;
843 // Reserve some memory inside the message queue
844 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
846 // Construct message in the message queue memory; note that delete should not be called on the return value
847 new (slot) LocalType( &manager, &UpdateManager::RemoveGesture, gesture );
850 #ifdef DYNAMICS_SUPPORT
853 inline void InitializeDynamicsWorldMessage( UpdateManager& manager, DynamicsWorld* dynamicsworld, Integration::DynamicsWorldSettings* worldSettings )
855 typedef MessageValue2< UpdateManager, DynamicsWorld*, Integration::DynamicsWorldSettings* > LocalType;
857 // Reserve some memory inside the message queue
858 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
860 // Construct message in the message queue memory; note that delete should not be called on the return value
861 new (slot) LocalType( &manager, &UpdateManager::InitializeDynamicsWorld, dynamicsworld, worldSettings );
864 inline void TerminateDynamicsWorldMessage(UpdateManager& manager)
866 typedef Message< UpdateManager > LocalType;
868 // Reserve some memory inside the message queue
869 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
871 // Construct message in the message queue memory; note that delete should not be called on the return value
872 new (slot) LocalType( &manager, &UpdateManager::TerminateDynamicsWorld );
875 #endif // DYNAMICS_SUPPORT
877 } // namespace SceneGraph
879 } // namespace Internal
883 #endif // __DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H__