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>
25 #include <dali/integration-api/resource-declarations.h>
27 #include <dali/internal/common/message.h>
28 #include <dali/internal/common/event-to-update.h>
29 #include <dali/internal/common/type-abstraction-enums.h>
31 #include <dali/internal/update/animation/scene-graph-animation.h>
32 #include <dali/internal/update/common/scene-graph-buffers.h>
33 #include <dali/internal/update/common/scene-graph-property-notification.h>
34 #include <dali/internal/update/geometry/scene-graph-geometry.h>
35 #include <dali/internal/update/effects/scene-graph-material.h>
36 #include <dali/internal/update/node-attachments/node-attachment.h>
37 #include <dali/internal/update/nodes/node.h>
38 #include <dali/internal/update/nodes/scene-graph-layer.h>
40 #include <dali/internal/render/shaders/scene-graph-shader.h>
47 class GlSyncAbstraction;
48 class RenderController;
49 struct DynamicsWorldSettings;
51 } // namespace Integration
56 class PropertyNotifier;
58 struct DynamicsWorldSettings;
59 class NotificationManager;
60 class CompleteNotificationInterface;
61 class ResourceManager;
64 // value types used by messages
65 template <> struct ParameterType< PropertyNotification::NotifyMode >
66 : public BasicType< PropertyNotification::NotifyMode > {};
81 * UpdateManager holds a scene graph i.e. a tree of nodes.
82 * It controls the Update traversal, in which nodes are repositioned/animated,
83 * and organizes the the culling and rendering of the scene.
90 * Construct a new UpdateManager.
91 * @param[in] notificationManager This should be notified when animations have finished.
92 * @param[in] glSyncAbstraction Used to determine when framebuffers are ready
93 * @param[in] animationFinishedNotifier The CompleteNotificationInterface that handles animation completions
94 * @param[in] propertyNotifier The PropertyNotifier
95 * @param[in] resourceManager The resource manager used to load textures etc.
96 * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
97 * @param[in] controller After messages are flushed, we request a render from the RenderController.
98 * @param[in] renderManager This is responsible for rendering the results of each "update".
99 * @param[in] renderQueue Used to queue messages for the next render.
100 * @param[in] textureCache Used for caching textures.
101 * @param[in] touchResampler Used for re-sampling touch events.
103 UpdateManager( NotificationManager& notificationManager,
104 Integration::GlSyncAbstraction& glSyncAbstraction,
105 CompleteNotificationInterface& animationFinishedNotifier,
106 PropertyNotifier& propertyNotifier,
107 ResourceManager& resourceManager,
108 DiscardQueue& discardQueue,
109 Integration::RenderController& controller,
110 RenderManager& renderManager,
111 RenderQueue& renderQueue,
112 TextureCache& textureCache,
113 TouchResampler& touchResampler );
116 * Destructor. Not virtual as this is not a base class
121 * The event-thread uses this interface to queue messages for the next update.
122 * @return The event-to-update interface.
124 EventToUpdate& GetEventToUpdate();
127 * @return the event buffer index
129 BufferIndex GetEventBufferIndex() const
131 // inlined as its called often
132 return mSceneGraphBuffers.GetEventBufferIndex();
135 // Node connection methods
138 * Get the scene graph side list of RenderTasks.
139 * @param[in] systemLevel True if using the system-level overlay.
140 * @return The list of render tasks
142 RenderTaskList* GetRenderTaskList( bool systemLevel );
145 * Installs a new layer as the root node.
146 * @pre The UpdateManager does not already have an installed root node.
147 * @pre The layer is of derived Node type Layer.
148 * @pre The layer does not have a parent.
149 * @param[in] layer The new root node.
150 * @param[in] systemLevel True if using the system-level overlay.
151 * @post The node is owned by UpdateManager.
153 void InstallRoot( Layer* layer, bool systemLevel );
156 * Add a Node; UpdateManager takes ownership.
157 * @pre The node does not have a parent.
158 * @param[in] node The node to add.
160 void AddNode( Node* node );
163 * Connect a Node to the scene-graph.
164 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
165 * @pre The node does not already have a parent.
166 * @param[in] node The new parent node.
167 * @param[in] node The node to connect.
169 void ConnectNode( Node* parent, Node* node, int index );
172 * Disconnect a Node from the scene-graph.
173 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
174 * @pre The node has a parent.
175 * @param[in] node The node to disconnect.
177 void DisconnectNode( Node* node );
180 * Called when a property is set on a disconnected Node (via public API)
181 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
182 * @pre The node does not have a parent.
183 * @param[in] node The node to set as "active".
185 void SetNodeActive( Node* node );
188 * Destroy a Node owned by UpdateManager.
189 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
190 * In the following update, the previously queued Nodes may be deleted.
191 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
192 * @param[in] node The node to destroy.
194 void DestroyNode( Node* node );
197 * Attach an object to a Node.
198 * The UpdateManager is responsible for calling NodeAttachment::Initialize().
199 * @param[in] node The node which will own the attachment.
200 * @param[in] attachment The object to attach.
202 void AttachToNode( Node* node, NodeAttachment* attachment );
205 * Add a newly created object.
206 * @param[in] object The object to add.
207 * @post The object is owned by UpdateManager.
209 void AddObject( PropertyOwner* object );
213 * @param[in] object The object to remove.
215 void RemoveObject( PropertyOwner* object );
220 * Add a newly created animation.
221 * @param[in] animation The animation to add.
222 * @post The animation is owned by UpdateManager.
224 void AddAnimation( Animation* animation );
228 * @param[in] animation The animation to stop.
230 void StopAnimation( Animation* animation );
233 * Remove an animation.
234 * @param[in] animation The animation to remove.
236 void RemoveAnimation( Animation* animation );
239 * Query whether any animations are currently running.
240 * @return True if any animations are running.
242 bool IsAnimationRunning() const;
244 // Property Notification
247 * Add a newly created property notification
248 * @param[in] propertyNotification The notification to add
249 * @post The propertyNotification is owned by UpdateManager.
251 void AddPropertyNotification( PropertyNotification* propertyNotification );
254 * Remove a property notification
255 * @param[in] propertyNotification The notification to remove
257 void RemovePropertyNotification( PropertyNotification* propertyNotification );
260 * Set Notify state for PropertyNotification
261 * @param[in] propertyNotification The notification to remove
262 * @param[in] notifyMode The notification mode.
264 void PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode );
268 * Add a geometry to the scene graph
269 * @param[in] geometry The geometry to add
271 void AddGeometry( Geometry* geometry );
274 * Remove a geometry from the scene graph
275 * @param[in] geometry The geometry to remove
277 void RemoveGeometry( Geometry* geometry );
280 * Add a material to the scene graph
281 * @param[in] material The material to add
283 void AddMaterial( Material* material );
286 * Remove a material from the scene graph
287 * @param[in] material The material to remove
289 void RemoveMaterial( Material* material );
294 * Add a newly created shader.
295 * @param[in] shader The shader to add.
296 * @post The shader is owned by the UpdateManager.
298 void AddShader(Shader* shader);
302 * @pre The shader has been added to the UpdateManager.
303 * @param[in] shader The shader to remove.
304 * @post The shader is destroyed.
306 void RemoveShader(Shader* shader);
309 * Set the shader program for a specified GeometryType to a Shader object
310 * @param[in] shader The shader to modify
311 * @param[in] geometryType The GeometryType to map to the program
312 * @param[in] subType The program subtype
313 * @param[in] resourceId A ResourceManager ticket ID for the program data (source and compiled binary)
314 * @param[in] shaderHash hash key created with vertex and fragment shader code
315 * @param[in] modifiesGeometry True if the vertex shader modifies geometry
317 void SetShaderProgram( Shader* shader, GeometryType geometryType, ShaderSubTypes subType, Integration::ResourceId resourceId, size_t shaderHash, bool modifiesGeometry );
320 * Add a newly created gesture.
321 * @param[in] gesture The gesture to add.
322 * @post The gesture is owned by the UpdateManager.
324 void AddGesture( PanGesture* gesture );
328 * @pre The gesture has been added to the UpdateManager.
329 * @param[in] gesture The gesture to remove.
330 * @post The gesture is destroyed.
332 void RemoveGesture( PanGesture* gesture );
337 * Performs an Update traversal on the scene-graph.
338 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
339 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
340 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
341 * @return True if further updates are required e.g. during animations.
343 unsigned int Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
346 * Set the background color i.e. the glClear color used at the beginning of each frame.
347 * @param[in] color The new background color.
349 void SetBackgroundColor(const Vector4& color);
352 * Set the default surface rect.
353 * @param[in] rect The rect value representing the surface.
355 void SetDefaultSurfaceRect( const Rect<int>& rect );
358 * @copydoc Dali::Stage::KeepRendering()
360 void KeepRendering( float durationSeconds );
363 * Sets the depths of all layers.
364 * @param layers The layers in depth order.
365 * @param[in] systemLevel True if using the system-level overlay.
367 void SetLayerDepths( const std::vector< Layer* >& layers, bool systemLevel );
369 #ifdef DYNAMICS_SUPPORT
372 * Initialize the dynamics world
373 * @param[in] world The dynamics world
374 * @param[in] worldSettings The dynamics world settings
375 * @param[in] debugShader The shader used for rendering dynamics debug information
377 void InitializeDynamicsWorld( DynamicsWorld* world, Integration::DynamicsWorldSettings* worldSettings );
380 * Terminate the dynamics world
382 void TerminateDynamicsWorld();
384 #endif // DYNAMICS_SUPPORT
389 UpdateManager(const UpdateManager&);
392 UpdateManager& operator=(const UpdateManager& rhs);
395 * Helper to check whether the update-thread should keep going.
396 * @param[in] elapsedSeconds The time in seconds since the previous update.
397 * @return True if the update-thread should keep going.
399 unsigned int KeepUpdatingCheck( float elapsedSeconds ) const;
402 * Helper to calculate new camera setup when root node resizes.
403 * @param[in] updateBuffer The buffer to read the root node size from.
405 void UpdateProjectionAndViewMatrices(int updateBuffer);
408 * Post process resources that have been updated by renderer
410 void PostProcessResources();
413 * Helper to reset a Node properties.
414 * @param[in] node The node.
416 void ResetNodeProperty( Node& node );
419 * Helper to reset all Node properties
421 void ResetProperties();
424 * Perform gesture updates.
425 * @param[in] lastVSyncTime The last VSync time in milliseconds.
426 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
427 * @return true, if any properties were updated.
429 bool ProcessGestures( unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
432 * Perform animation updates
433 * @param[in] elapsedSeconds time since last frame
435 void Animate( float elapsedSeconds );
438 * Perform constraint updates.
439 * @note Applies constraints to nodes first (depth first search order).
440 * Then shader constraints second (construction order)
442 void ApplyConstraints();
445 * Perform property notification updates
447 void ProcessPropertyNotifications();
450 * Update the default camera.
451 * This must be altered to match the root Node for 2D layouting.
452 * @param[in] updateBuffer The buffer to read the root node size from.
454 void UpdateDefaultCamera( int updateBuffer );
457 * Update node shaders, opacity, geometry etc.
463 // needs to be direct member so that getter for event buffer can be inlined
464 SceneGraphBuffers mSceneGraphBuffers;
471 // Messages for UpdateManager
473 inline void InstallRootMessage( UpdateManager& manager, Layer& root, bool systemLevel )
475 typedef MessageValue2< UpdateManager, Layer*, bool > LocalType;
477 // Reserve some memory inside the message queue
478 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
480 // Construct message in the message queue memory; note that delete should not be called on the return value
481 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, &root, systemLevel );
484 inline void AddNodeMessage( UpdateManager& manager, Node& node )
486 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
488 // Reserve some memory inside the message queue
489 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
491 // Construct message in the message queue memory; note that delete should not be called on the return value
492 new (slot) LocalType( &manager, &UpdateManager::AddNode, &node );
495 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild, int index )
497 // Update thread can edit the object
498 Node& parent = const_cast< Node& >( constParent );
499 Node& child = const_cast< Node& >( constChild );
501 typedef MessageValue3< UpdateManager, Node*, Node*, int > LocalType;
503 // Reserve some memory inside the message queue
504 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
506 // Construct message in the message queue memory; note that delete should not be called on the return value
507 new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child, index );
510 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
512 // Scene graph thread can modify this object.
513 Node& node = const_cast< Node& >( constNode );
515 typedef MessageValue1< UpdateManager, Node* > LocalType;
517 // Reserve some memory inside the message queue
518 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
520 // Construct message in the message queue memory; note that delete should not be called on the return value
521 new (slot) LocalType( &manager, &UpdateManager::DisconnectNode, &node );
524 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
526 // Scene graph thread can destroy this object.
527 Node& node = const_cast< Node& >( constNode );
529 typedef MessageValue1< UpdateManager, Node* > LocalType;
531 // Reserve some memory inside the message queue
532 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
534 // Construct message in the message queue memory; note that delete should not be called on the return value
535 new (slot) LocalType( &manager, &UpdateManager::DestroyNode, &node );
538 inline void AttachToNodeMessage( UpdateManager& manager, const Node& constParent, NodeAttachment* attachment )
540 // Scene graph thread can modify this object.
541 Node& parent = const_cast< Node& >( constParent );
543 typedef MessageValue2< UpdateManager, Node*, NodeAttachmentOwner > LocalType;
545 // Reserve some memory inside the message queue
546 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
548 // Construct message in the message queue memory; note that delete should not be called on the return value
549 new (slot) LocalType( &manager, &UpdateManager::AttachToNode, &parent, attachment );
552 inline void AddObjectMessage( UpdateManager& manager, PropertyOwner* object )
554 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
556 // Reserve some memory inside the message queue
557 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
559 // Construct message in the message queue memory; note that delete should not be called on the return value
560 new (slot) LocalType( &manager, &UpdateManager::AddObject, object );
563 inline void RemoveObjectMessage( UpdateManager& manager, PropertyOwner* object )
565 typedef MessageValue1< UpdateManager, PropertyOwner* > 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::RemoveObject, object );
574 inline void AddAnimationMessage( UpdateManager& manager, Animation* animation )
576 typedef MessageValue1< UpdateManager, Animation* > LocalType;
578 // Reserve some memory inside the message queue
579 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
581 // Construct message in the message queue memory; note that delete should not be called on the return value
582 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
585 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
587 // The scene-graph thread owns this object so it can safely edit it.
588 Animation& animation = const_cast< Animation& >( constAnimation );
590 typedef MessageValue1< UpdateManager, Animation* > 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::StopAnimation, &animation );
599 inline void RemoveAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
601 // The scene-graph thread owns this object so it can safely edit it.
602 Animation& animation = const_cast< Animation& >( constAnimation );
604 typedef MessageValue1< UpdateManager, Animation* > LocalType;
606 // Reserve some memory inside the message queue
607 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
609 // Construct message in the message queue memory; note that delete should not be called on the return value
610 new (slot) LocalType( &manager, &UpdateManager::RemoveAnimation, &animation );
613 inline void AddPropertyNotificationMessage( UpdateManager& manager, PropertyNotification* propertyNotification )
615 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
617 // Reserve some memory inside the message queue
618 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
620 // Construct message in the message queue memory; note that delete should not be called on the return value
621 new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
624 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
626 // The scene-graph thread owns this object so it can safely edit it.
627 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
629 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
631 // Reserve some memory inside the message queue
632 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
634 // Construct message in the message queue memory; note that delete should not be called on the return value
635 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyNotification, &propertyNotification );
638 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
639 const PropertyNotification* constPropertyNotification,
640 PropertyNotification::NotifyMode notifyMode )
642 // The scene-graph thread owns this object so it can safely edit it.
643 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
645 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
647 // Reserve some memory inside the message queue
648 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
650 // Construct message in the message queue memory; note that delete should not be called on the return value
651 new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
654 inline void AddGeometryMessage( UpdateManager& manager, Geometry& geometry )
656 typedef MessageValue1< UpdateManager, OwnerPointer< Geometry > > LocalType;
658 // Reserve some memory inside the message queue
659 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
661 // Construct message in the message queue memory; note that delete should not be called on the return value
662 new (slot) LocalType( &manager, &UpdateManager::AddGeometry, &geometry );
665 // The render thread can safely change the Geometry
666 inline void RemoveGeometryMessage( UpdateManager& manager, Geometry& geometry )
668 typedef MessageValue1< UpdateManager, Geometry* > LocalType;
670 // Reserve some memory inside the message queue
671 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
673 // Construct message in the message queue memory; note that delete should not be called on the return value
674 new (slot) LocalType( &manager, &UpdateManager::RemoveGeometry, &geometry );
677 inline void AddMaterialMessage( UpdateManager& manager, Material& material )
679 typedef MessageValue1< UpdateManager, OwnerPointer< Material > > LocalType;
681 // Reserve some memory inside the message queue
682 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
684 // Construct message in the message queue memory; note that delete should not be called on the return value
685 new (slot) LocalType( &manager, &UpdateManager::AddMaterial, &material );
688 // The render thread can safely change the Material
689 inline void RemoveMaterialMessage( UpdateManager& manager, Material& material )
691 typedef MessageValue1< UpdateManager, Material* > LocalType;
693 // Reserve some memory inside the message queue
694 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
696 // Construct message in the message queue memory; note that delete should not be called on the return value
697 new (slot) LocalType( &manager, &UpdateManager::RemoveMaterial, &material );
701 // The render thread can safely change the Shader
702 inline void AddShaderMessage( UpdateManager& manager, Shader& shader )
704 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > 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::AddShader, &shader );
713 // The render thread can safely change the Shader
714 inline void RemoveShaderMessage( UpdateManager& manager, Shader& shader )
716 typedef MessageValue1< UpdateManager, Shader* > 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::RemoveShader, &shader );
725 inline void SetShaderProgramMessage( UpdateManager& manager,
727 GeometryType geometryType,
728 ShaderSubTypes subType,
729 Integration::ResourceId resourceId,
731 bool modifiesGeometry )
733 typedef MessageValue6< UpdateManager, Shader*, GeometryType, ShaderSubTypes, Integration::ResourceId, size_t, bool > LocalType;
735 // Reserve some memory inside the message queue
736 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
738 // Construct message in the message queue memory; note that delete should not be called on the return value
739 new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, &shader, geometryType, subType, resourceId, shaderHash, modifiesGeometry );
742 inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
744 typedef MessageValue1< UpdateManager, Vector4 > LocalType;
746 // Reserve some memory inside the message queue
747 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
749 // Construct message in the message queue memory; note that delete should not be called on the return value
750 new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
753 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int>& rect )
755 typedef MessageValue1< UpdateManager, Rect<int> > LocalType;
757 // Reserve some memory inside the message queue
758 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
760 // Construct message in the message queue memory; note that delete should not be called on the return value
761 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
764 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
766 typedef MessageValue1< UpdateManager, float > LocalType;
768 // Reserve some memory inside the message queue
769 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
771 // Construct message in the message queue memory; note that delete should not be called on the return value
772 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
776 * Create a message for setting the depth of a layer
777 * @param[in] manager The update manager
778 * @param[in] layers list of layers
779 * @param[in] systemLevel True if the layers are added via the SystemOverlay API
781 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, bool systemLevel )
783 typedef MessageValue2< UpdateManager, std::vector< Layer* >, bool > LocalType;
785 // Reserve some memory inside the message queue
786 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
788 // Construct message in the message queue memory; note that delete should not be called on the return value
789 new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, systemLevel );
792 inline void AddGestureMessage( UpdateManager& manager, PanGesture* gesture )
794 typedef MessageValue1< UpdateManager, PanGesture* > LocalType;
796 // Reserve some memory inside the message queue
797 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
799 // Construct message in the message queue memory; note that delete should not be called on the return value
800 new (slot) LocalType( &manager, &UpdateManager::AddGesture, gesture );
803 inline void RemoveGestureMessage( UpdateManager& manager, PanGesture* gesture )
805 typedef MessageValue1< UpdateManager, PanGesture* > LocalType;
807 // Reserve some memory inside the message queue
808 unsigned int* slot = manager.GetEventToUpdate().ReserveMessageSlot( sizeof( LocalType ) );
810 // Construct message in the message queue memory; note that delete should not be called on the return value
811 new (slot) LocalType( &manager, &UpdateManager::RemoveGesture, gesture );
814 #ifdef DYNAMICS_SUPPORT
817 inline void InitializeDynamicsWorldMessage( UpdateManager& manager, DynamicsWorld* dynamicsworld, Integration::DynamicsWorldSettings* worldSettings )
819 typedef MessageValue2< UpdateManager, DynamicsWorld*, Integration::DynamicsWorldSettings* > 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::InitializeDynamicsWorld, dynamicsworld, worldSettings );
828 inline void TerminateDynamicsWorldMessage(UpdateManager& manager)
830 typedef Message< UpdateManager > 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::TerminateDynamicsWorld );
839 #endif // DYNAMICS_SUPPORT
841 } // namespace SceneGraph
843 } // namespace Internal
847 #endif // __DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H__