1 #ifndef DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
5 * Copyright (c) 2018 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/devel-api/common/stage-devel.h>
27 #include <dali/internal/common/message.h>
28 #include <dali/internal/common/type-abstraction-enums.h>
29 #include <dali/internal/common/shader-saver.h>
30 #include <dali/internal/event/common/event-thread-services.h>
31 #include <dali/internal/update/animation/scene-graph-animation.h>
32 #include <dali/internal/update/common/property-resetter.h>
33 #include <dali/internal/update/common/scene-graph-buffers.h>
34 #include <dali/internal/update/common/scene-graph-property-notification.h>
35 #include <dali/internal/update/nodes/node.h>
36 #include <dali/internal/update/nodes/scene-graph-layer.h>
37 #include <dali/internal/update/manager/scene-graph-frame-callback.h> // for OwnerPointer< FrameCallback >
38 #include <dali/internal/update/rendering/scene-graph-renderer.h> // for OwnerPointer< Renderer >
39 #include <dali/internal/update/rendering/scene-graph-texture-set.h> // for OwnerPointer< TextureSet >
40 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
41 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
42 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
43 #include <dali/internal/render/shaders/scene-graph-shader.h> // for OwnerPointer< Shader >
44 #include <dali/internal/render/renderers/render-property-buffer.h>
45 #include <dali/internal/event/rendering/texture-impl.h>
50 class FrameCallbackInterface;
54 class GlSyncAbstraction;
55 class RenderController;
57 } // namespace Integration
62 class PropertyNotifier;
63 class NotificationManager;
64 class CompleteNotificationInterface;
72 // value types used by messages
73 template <> struct ParameterType< PropertyNotification::NotifyMode >
74 : public BasicType< PropertyNotification::NotifyMode > {};
83 class RenderTaskProcessor;
89 SceneGraph::Node* node;
91 NodeDepthPair( SceneGraph::Node* node, uint32_t sortedDepth )
93 sortedDepth(sortedDepth)
104 void Add( SceneGraph::Node* node, uint32_t sortedDepth )
106 nodeDepths.push_back( NodeDepthPair( node, sortedDepth ) );
109 std::vector<NodeDepthPair> nodeDepths;
114 * UpdateManager maintains a scene graph i.e. a tree of nodes as well as
115 * other scene graph property owning objects.
116 * It controls the Update traversal, in which nodes are repositioned/animated,
117 * and organizes the the culling and rendering of the scene.
118 * It also maintains the lifecycle of nodes and other property owners that are
119 * disconnected from the scene graph.
121 class UpdateManager : public ShaderSaver
126 * Construct a new UpdateManager.
127 * @param[in] notificationManager This should be notified when animations have finished.
128 * @param[in] animationPlaylist The CompleteNotificationInterface that handles the animations
129 * @param[in] propertyNotifier The PropertyNotifier
130 * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
131 * @param[in] controller After messages are flushed, we request a render from the RenderController.
132 * @param[in] renderManager This is responsible for rendering the results of each "update".
133 * @param[in] renderQueue Used to queue messages for the next render.
134 * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
135 * @param[in] partialUpdateAvailble whether the partial update is available
137 UpdateManager( NotificationManager& notificationManager,
138 CompleteNotificationInterface& animationPlaylist,
139 PropertyNotifier& propertyNotifier,
140 DiscardQueue& discardQueue,
141 Integration::RenderController& controller,
142 RenderManager& renderManager,
143 RenderQueue& renderQueue,
144 RenderTaskProcessor& renderTaskProcessor,
145 bool partialUpdateAvailable );
150 virtual ~UpdateManager();
152 // Node connection methods
155 * Installs a new layer as the root node.
156 * @pre The layer is of derived Node type Layer.
157 * @pre The layer does not have a parent.
158 * @param[in] layer The new root node.
159 * @post The node is owned by UpdateManager.
161 void InstallRoot( OwnerPointer<Layer>& layer );
164 * Uninstalls the root node.
165 * @pre The layer is of derived Node type Layer.
166 * @pre The layer does not have a parent.
167 * @param[in] layer The root node.
168 * @post The node is owned by UpdateManager.
170 void UninstallRoot( Layer* layer );
173 * Add a Node; UpdateManager takes ownership.
174 * @pre The node does not have a parent.
175 * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
176 * @param[in] node The node to add.
178 void AddNode( OwnerPointer<Node>& node );
181 * Connect a Node to the scene-graph.
182 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
183 * @pre The node does not already have a parent.
184 * @param[in] parent The new parent node.
186 void ConnectNode( Node* parent, Node* node );
189 * Disconnect a Node from the scene-graph.
190 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
191 * @pre The node has a parent.
192 * @param[in] node The node to disconnect.
194 void DisconnectNode( Node* node );
197 * Destroy a Node owned by UpdateManager.
198 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
199 * In the following update, the previously queued Nodes may be deleted.
200 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
201 * @param[in] node The node to destroy.
203 void DestroyNode( Node* node );
206 * Add a camera on scene
207 * @param[in] camera The camera to add
209 void AddCamera( OwnerPointer< Camera >& camera );
212 * Remove a camera from scene
213 * @param[in] camera to remove
215 void RemoveCamera( Camera* camera );
218 * Add a newly created object.
219 * @param[in] object The object to add.
220 * @post The object is owned by UpdateManager.
222 void AddObject( OwnerPointer<PropertyOwner>& object );
226 * @param[in] object The object to remove.
228 void RemoveObject( PropertyOwner* object );
231 * Add a newly created render task list.
232 * @param[in] taskList The render task list to add.
233 * @post The render task list is owned by UpdateManager.
235 void AddRenderTaskList( OwnerPointer<RenderTaskList>& taskList );
238 * Remove a render task list.
239 * @param[in] taskList The render task list to remove.
241 void RemoveRenderTaskList( RenderTaskList* taskList );
246 * Add a newly created animation.
247 * @param[in] animation The animation to add.
248 * @post The animation is owned by UpdateManager.
250 void AddAnimation( OwnerPointer< SceneGraph::Animation >& animation );
254 * @param[in] animation The animation to stop.
256 void StopAnimation( Animation* animation );
259 * Remove an animation.
260 * @param[in] animation The animation to remove.
262 void RemoveAnimation( Animation* animation );
265 * Query whether any animations are currently running.
266 * @return True if any animations are running.
268 bool IsAnimationRunning() const;
271 * Add a property resetter. UpdateManager takes ownership of the object.
272 * It will be killed by UpdateManager when the associated animator or
273 * constraint has finished; or the property owner of the property is destroyed.
275 void AddPropertyResetter( OwnerPointer<PropertyResetterBase>& propertyResetter );
277 // Property Notification
280 * Add a newly created property notification
281 * @param[in] propertyNotification The notification to add
282 * @post The propertyNotification is owned by UpdateManager.
284 void AddPropertyNotification( OwnerPointer< PropertyNotification >& propertyNotification );
287 * Remove a property notification
288 * @param[in] propertyNotification The notification to remove
290 void RemovePropertyNotification( PropertyNotification* propertyNotification );
293 * Set Notify state for PropertyNotification
294 * @param[in] propertyNotification The notification to remove
295 * @param[in] notifyMode The notification mode.
297 void PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode );
302 * Add a newly created shader.
303 * @param[in] shader The shader to add.
304 * @post The shader is owned by the UpdateManager.
306 void AddShader( OwnerPointer< Shader >& shader );
310 * @pre The shader has been added to the UpdateManager.
311 * @param[in] shader The shader to remove.
312 * @post The shader is destroyed.
314 void RemoveShader( Shader* shader );
317 * Set the shader program for a Shader object
318 * @param[in] shader The shader to modify
319 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
320 * @param[in] modifiesGeometry True if the vertex shader modifies geometry
322 void SetShaderProgram( Shader* shader, Internal::ShaderDataPtr shaderData, bool modifiesGeometry );
325 * @brief Accept compiled shaders passed back on render thread for saving.
326 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
328 virtual void SaveBinary( Internal::ShaderDataPtr shaderData );
331 * @brief Set the destination for compiled shader binaries to be passed on to.
332 * The dispatcher passed in will be called from the update thread.
333 * @param[in] upstream A sink for ShaderDatas to be passed into.
335 void SetShaderSaver( ShaderSaver& upstream );
340 * Add a new renderer to scene
341 * @param renderer to add
343 void AddRenderer( OwnerPointer< Renderer >& renderer );
346 * Add a renderer from scene
347 * @param renderer to remove
349 void RemoveRenderer( Renderer* renderer );
354 * Set the pan gesture processor.
355 * Pan Gesture processor lives for the lifetime of UpdateManager
356 * @param[in] gesture The gesture processor.
357 * @post The gestureProcessor is owned by the UpdateManager.
359 void SetPanGestureProcessor( PanGesture* gestureProcessor );
364 * Add a newly created TextureSet.
365 * @param[in] textureSet The texture set to add.
366 * @post The TextureSet is owned by the UpdateManager.
368 void AddTextureSet( OwnerPointer< TextureSet >& textureSet );
371 * Remove a TextureSet.
372 * @pre The TextureSet has been added to the UpdateManager.
373 * @param[in] textureSet The TextureSet to remove.
374 * @post The TextureSet is destroyed.
376 void RemoveTextureSet( TextureSet* textureSet );
381 * Get the scene graph side list of RenderTasks.
382 * @param[in] systemLevel True if using the system-level overlay.
383 * @return The list of render tasks
385 RenderTaskList* GetRenderTaskList( bool systemLevel );
387 // Message queue handling
390 * Reserve space for another message in the queue; this must then be initialized by the caller.
391 * The message will be read from the update-thread after the next FlushMessages is called.
392 * @post Calling this method may invalidate any previously returned slots.
393 * @param[in] size The message size with respect to the size of type "char".
394 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
395 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
396 * @return A pointer to the first char allocated for the message.
398 uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene = true );
401 * @return the current event-buffer index.
403 BufferIndex GetEventBufferIndex() const
405 // inlined as its called often from event thread
406 return mSceneGraphBuffers.GetEventBufferIndex();
410 * Called by the event-thread to signal that FlushQueue will be called
411 * e.g. when it has finished event processing.
413 void EventProcessingStarted();
416 * Flush the set of messages, which were previously stored with QueueMessage().
417 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
419 * @return True if there are messages to process.
424 * Add a new sampler to RenderManager
425 * @param[in] sampler The sampler to add
426 * @post Sends a message to RenderManager to add the sampler.
427 * The sampler will be owned by RenderManager
429 void AddSampler( OwnerPointer< Render::Sampler >& sampler );
432 * Removes an existing sampler from RenderManager
433 * @param[in] sampler The sampler to remove
434 * @post The sampler will be destroyed in the render thread
436 void RemoveSampler( Render::Sampler* sampler );
439 * Sets the filter modes for an existing sampler
440 * @param[in] sampler The sampler
441 * @param[in] minFilterMode The filter to use under minification
442 * @param[in] magFilterMode The filter to use under magnification
444 void SetFilterMode( Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode );
447 * Sets the wrap mode for an existing sampler
448 * @param[in] sampler The sampler
449 * @param[in] rWrapMode Wrapping mode in z direction
450 * @param[in] sWrapMode Wrapping mode in x direction
451 * @param[in] tWrapMode Wrapping mode in y direction
453 void SetWrapMode( Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode );
456 * Add a new property buffer to RenderManager
457 * @param[in] propertryBuffer The property buffer to add
458 * @post Sends a message to RenderManager to add the property buffer.
459 * The property buffer will be owned by RenderManager
461 void AddPropertyBuffer( OwnerPointer< Render::PropertyBuffer >& propertryBuffer );
464 * Removes an existing PropertyBuffer from RenderManager
465 * @param[in] propertryBuffer The property buffer to remove
466 * @post The property buffer will be destroyed in the render thread
468 void RemovePropertyBuffer( Render::PropertyBuffer* propertryBuffer );
471 * Sets the format of an existing property buffer
472 * @param[in] propertyBuffer The property buffer.
473 * @param[in] format The new format of the buffer
474 * @post Sends a message to RenderManager to set the new format to the property buffer.
476 void SetPropertyBufferFormat( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format );
479 * Sets the data of an existing property buffer
480 * @param[in] propertyBuffer The property buffer.
481 * @param[in] data The new data of the buffer
482 * @param[in] size The new size of the buffer
483 * @post Sends a message to RenderManager to set the new data to the property buffer.
485 void SetPropertyBufferData( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size );
488 * Adds a geometry to the RenderManager
489 * @param[in] geometry The geometry to add
490 * @post Sends a message to RenderManager to add the Geometry
491 * The geometry will be owned by RenderManager
493 void AddGeometry( OwnerPointer< Render::Geometry >& geometry );
496 * Removes an existing Geometry from RenderManager
497 * @param[in] geometry The geometry to remove
498 * @post The geometry will be destroyed in the render thread
500 void RemoveGeometry( Render::Geometry* geometry );
503 * Sets the geometry type of an existing Geometry
504 * @param[in] geometry The geometry
505 * @param[in] geometryType The type of the geometry
507 void SetGeometryType( Render::Geometry* geometry, uint32_t geometryType );
510 * Sets the index buffer to be used by a geometry
511 * @param[in] geometry The geometry
512 * @param[in] indices A vector containing the indices for the geometry
514 void SetIndexBuffer( Render::Geometry* geometry, Dali::Vector<uint16_t>& indices );
517 * Adds a vertex buffer to a geometry
518 * @param[in] geometry The geometry
519 * @param[in] propertyBuffer The property buffer
521 void AttachVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
524 * Removes a vertex buffer from a geometry
525 * @param[in] geometry The geometry
526 * @param[in] propertyBuffer The property buffer
528 void RemoveVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
531 * Adds a texture to the render manager
532 * @param[in] texture The texture to add
533 * The texture will be owned by RenderManager
535 void AddTexture( OwnerPointer< Render::Texture >& texture );
538 * Removes a texture from the render manager
539 * @param[in] texture The texture to remove
540 * @post The texture will be destroyed in the render thread
542 void RemoveTexture( Render::Texture* texture );
545 * Uploads data to a texture owned by the RenderManager
546 * @param[in] texture The texture
547 * @param[in] pixelData The pixel data object
548 * @param[in] params The parameters for the upload
550 void UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params );
553 * Generates mipmaps for a texture owned by the RenderManager
554 * @param[in] texture The texture
556 void GenerateMipmaps( Render::Texture* texture );
559 * Adds a framebuffer to the render manager
560 * @param[in] frameBuffer The framebuffer to add
561 * The framebuffer will be owned by RenderManager
563 void AddFrameBuffer( OwnerPointer< Render::FrameBuffer >& frameBuffer );
566 * Removes a FrameBuffer from the render manager
567 * @param[in] frameBuffer The FrameBuffer to remove
568 * @post The FrameBuffer will be destroyed in the render thread
570 void RemoveFrameBuffer( Render::FrameBuffer* frameBuffer );
573 * Attach a texture as color output to an existing FrameBuffer
574 * @param[in] frameBuffer The FrameBuffer
575 * @param[in] texture The texture that will be used as output when rendering
576 * @param[in] mipmapLevel The mipmap of the texture to be attached
577 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
579 void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face );
584 * Performs an Update traversal on the scene-graph.
585 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
586 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
587 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
588 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
589 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
590 * @return True if further updates are required e.g. during animations.
592 uint32_t Update( float elapsedSeconds,
593 uint32_t lastVSyncTimeMilliseconds,
594 uint32_t nextVSyncTimeMilliseconds,
595 bool renderToFboEnabled,
596 bool isRenderingToFbo );
599 * Set the background color i.e. the glClear color used at the beginning of each frame.
600 * @param[in] color The new background color.
602 void SetBackgroundColor(const Vector4& color);
605 * Set the default surface rect.
606 * @param[in] rect The rect value representing the surface.
608 void SetDefaultSurfaceRect( const Rect<int>& rect );
611 * Set the default surface orientation.
612 * @param[in] orientation The orientation value representing the surface.
614 void SetDefaultSurfaceOrientation( int orientation );
617 * @copydoc Dali::Stage::KeepRendering()
619 void KeepRendering( float durationSeconds );
622 * @copydoc Dali::DevelStage::SetRenderingBehavior()
624 void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
627 * Sets the depths of all layers.
628 * @param layers The layers in depth order.
629 * @param[in] rootLayer The root layer of the sorted layers.
631 void SetLayerDepths( const std::vector< Layer* >& layers, const Layer* rootLayer );
634 * Set the depth indices of all nodes (in LayerUI's)
635 * @param[in] nodeDepths A vector of nodes and associated depth indices
637 void SetDepthIndices( OwnerPointer< NodeDepths >& nodeDepths );
640 * Query wheter the default surface rect is changed or not.
641 * @return true if the default surface rect is changed.
643 bool IsDefaultSurfaceRectChanged();
646 * Adds an implementation of the FrameCallbackInterface.
647 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
648 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
650 void AddFrameCallback( OwnerPointer< FrameCallback >& frameCallback, const Node* rootNode );
653 * Removes the specified implementation of FrameCallbackInterface.
654 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
656 void RemoveFrameCallback( FrameCallbackInterface* frameCallback );
661 UpdateManager(const UpdateManager&);
664 UpdateManager& operator=(const UpdateManager& rhs);
667 * Helper to check whether the update-thread should keep going.
668 * @param[in] elapsedSeconds The time in seconds since the previous update.
669 * @return True if the update-thread should keep going.
671 uint32_t KeepUpdatingCheck( float elapsedSeconds ) const;
674 * Helper to reset all Node properties
675 * @param[in] bufferIndex to use
677 void ResetProperties( BufferIndex bufferIndex );
680 * Perform gesture updates.
681 * @param[in] bufferIndex to use
682 * @param[in] lastVSyncTime The last VSync time in milliseconds.
683 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
684 * @return true, if any properties were updated.
686 bool ProcessGestures( BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds );
689 * Perform animation updates
690 * @param[in] bufferIndex to use
691 * @param[in] elapsedSeconds time since last frame
693 void Animate( BufferIndex bufferIndex, float elapsedSeconds );
696 * Applies constraints to CustomObjects
697 * @param[in] bufferIndex to use
699 void ConstrainCustomObjects( BufferIndex bufferIndex );
702 * Applies constraints to RenderTasks
703 * @param[in] bufferIndex to use
705 void ConstrainRenderTasks( BufferIndex bufferIndex );
708 * Applies constraints to Shaders
709 * @param[in] bufferIndex to use
711 void ConstrainShaders( BufferIndex bufferIndex );
714 * Perform property notification updates
715 * @param[in] bufferIndex to use
717 void ProcessPropertyNotifications( BufferIndex bufferIndex );
720 * Pass shader binaries queued here on to event thread.
722 void ForwardCompiledShadersToEventThread();
725 * Update node shaders, opacity, geometry etc.
726 * @param[in] bufferIndex to use
728 void UpdateNodes( BufferIndex bufferIndex );
732 * @param[in] bufferIndex to use
734 void UpdateRenderers( BufferIndex bufferIndex );
738 // needs to be direct member so that getter for event buffer can be inlined
739 SceneGraphBuffers mSceneGraphBuffers;
746 // Messages for UpdateManager
748 inline void InstallRootMessage( UpdateManager& manager, OwnerPointer<Layer>& root )
750 // Message has ownership of Layer while in transit from event -> update
751 typedef MessageValue1< UpdateManager, OwnerPointer<Layer> > LocalType;
753 // Reserve some memory inside the message queue
754 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
756 // Construct message in the message queue memory; note that delete should not be called on the return value
757 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, root );
760 inline void UninstallRootMessage( UpdateManager& manager, const Layer* constRoot )
762 // Scene graph thread can destroy this object.
763 Layer* root = const_cast< Layer* >( constRoot );
765 typedef MessageValue1< UpdateManager, Layer* > LocalType;
767 // Reserve some memory inside the message queue
768 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
770 // Construct message in the message queue memory; note that delete should not be called on the return value
771 new (slot) LocalType( &manager, &UpdateManager::UninstallRoot, root );
774 inline void AddNodeMessage( UpdateManager& manager, OwnerPointer<Node>& node )
776 // Message has ownership of Node while in transit from event -> update
777 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
779 // Reserve some memory inside the message queue
780 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
782 // Construct message in the message queue memory; note that delete should not be called on the return value
783 new (slot) LocalType( &manager, &UpdateManager::AddNode, node );
786 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild )
788 // Update thread can edit the object
789 Node& parent = const_cast< Node& >( constParent );
790 Node& child = const_cast< Node& >( constChild );
792 typedef MessageValue2< UpdateManager, Node*, Node* > LocalType;
794 // Reserve some memory inside the message queue
795 uint32_t* slot = manager.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::ConnectNode, &parent, &child );
801 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
803 // Scene graph thread can modify this object.
804 Node& node = const_cast< Node& >( constNode );
806 typedef MessageValue1< UpdateManager, Node* > LocalType;
808 // Reserve some memory inside the message queue
809 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
811 // Construct message in the message queue memory; note that delete should not be called on the return value
812 new (slot) LocalType( &manager, &UpdateManager::DisconnectNode, &node );
815 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
817 // Scene graph thread can destroy this object.
818 Node& node = const_cast< Node& >( constNode );
820 typedef MessageValue1< UpdateManager, Node* > LocalType;
822 // Reserve some memory inside the message queue
823 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
825 // Construct message in the message queue memory; note that delete should not be called on the return value
826 new (slot) LocalType( &manager, &UpdateManager::DestroyNode, &node );
829 inline void AddCameraMessage( UpdateManager& manager, OwnerPointer< Camera >& camera )
831 // Message has ownership of Camera while in transit from event -> update
832 typedef MessageValue1< UpdateManager, OwnerPointer< Camera > > LocalType;
834 // Reserve some memory inside the message queue
835 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
837 // Construct message in the message queue memory; note that delete should not be called on the return value
838 new (slot) LocalType( &manager, &UpdateManager::AddCamera, camera );
841 inline void RemoveCameraMessage( UpdateManager& manager, const Camera* camera )
843 typedef MessageValue1< UpdateManager, Camera* > LocalType;
845 // Reserve some memory inside the message queue
846 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
848 // Construct message in the message queue memory; note that delete should not be called on the return value
849 new (slot) LocalType( &manager, &UpdateManager::RemoveCamera, const_cast<Camera*>( camera ) );
852 inline void AddObjectMessage( UpdateManager& manager, OwnerPointer<PropertyOwner>& object )
854 // Message has ownership of object while in transit from event -> update
855 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
857 // Reserve some memory inside the message queue
858 uint32_t* slot = manager.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::AddObject, object );
864 inline void RemoveObjectMessage( UpdateManager& manager, const PropertyOwner* object )
866 typedef MessageValue1< UpdateManager, PropertyOwner* > LocalType;
868 // Reserve some memory inside the message queue
869 uint32_t* slot = manager.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::RemoveObject, const_cast<PropertyOwner*>( object ) );
875 inline void AddAnimationMessage( UpdateManager& manager, OwnerPointer< SceneGraph::Animation >& animation )
877 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Animation > > LocalType;
879 // Reserve some memory inside the message queue
880 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
882 // Construct message in the message queue memory; note that delete should not be called on the return value
883 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
886 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
888 // The scene-graph thread owns this object so it can safely edit it.
889 Animation& animation = const_cast< Animation& >( constAnimation );
891 typedef MessageValue1< UpdateManager, Animation* > LocalType;
893 // Reserve some memory inside the message queue
894 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
896 // Construct message in the message queue memory; note that delete should not be called on the return value
897 new (slot) LocalType( &manager, &UpdateManager::StopAnimation, &animation );
900 inline void RemoveAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
902 // The scene-graph thread owns this object so it can safely edit it.
903 Animation& animation = const_cast< Animation& >( constAnimation );
905 typedef MessageValue1< UpdateManager, Animation* > LocalType;
907 // Reserve some memory inside the message queue
908 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
910 // Construct message in the message queue memory; note that delete should not be called on the return value
911 new (slot) LocalType( &manager, &UpdateManager::RemoveAnimation, &animation );
914 inline void AddRenderTaskListMessage( UpdateManager& manager, OwnerPointer< SceneGraph::RenderTaskList >& taskList )
916 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::RenderTaskList > > LocalType;
918 // Reserve some memory inside the message queue
919 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
921 // Construct message in the message queue memory; note that delete should not be called on the return value
922 new (slot) LocalType( &manager, &UpdateManager::AddRenderTaskList, taskList );
925 inline void RemoveRenderTaskListMessage( UpdateManager& manager, const RenderTaskList& constTaskList )
927 // The scene-graph thread owns this object so it can safely edit it.
928 RenderTaskList& taskList = const_cast< RenderTaskList& >( constTaskList );
930 typedef MessageValue1< UpdateManager, RenderTaskList* > LocalType;
932 // Reserve some memory inside the message queue
933 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
935 // Construct message in the message queue memory; note that delete should not be called on the return value
936 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderTaskList, &taskList );
939 inline void AddPropertyNotificationMessage( UpdateManager& manager, OwnerPointer< PropertyNotification >& propertyNotification )
941 // Message has ownership of PropertyNotification while in transit from event -> update
942 typedef MessageValue1< UpdateManager, OwnerPointer< PropertyNotification > > LocalType;
944 // Reserve some memory inside the message queue
945 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
947 // Construct message in the message queue memory; note that delete should not be called on the return value
948 new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
951 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
953 // The scene-graph thread owns this object so it can safely edit it.
954 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
956 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
958 // Reserve some memory inside the message queue
959 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
961 // Construct message in the message queue memory; note that delete should not be called on the return value
962 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyNotification, &propertyNotification );
965 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
966 const PropertyNotification* constPropertyNotification,
967 PropertyNotification::NotifyMode notifyMode )
969 // The scene-graph thread owns this object so it can safely edit it.
970 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
972 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
974 // Reserve some memory inside the message queue
975 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
977 // Construct message in the message queue memory; note that delete should not be called on the return value
978 new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
981 // The render thread can safely change the Shader
982 inline void AddShaderMessage( UpdateManager& manager, OwnerPointer< Shader >& shader )
984 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > LocalType;
986 // Reserve some memory inside the message queue
987 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
989 // Construct message in the message queue memory; note that delete should not be called on the return value
990 new (slot) LocalType( &manager, &UpdateManager::AddShader, shader );
993 // The render thread can safely change the Shader
994 inline void RemoveShaderMessage( UpdateManager& manager, const Shader* shader )
996 typedef MessageValue1< UpdateManager, Shader* > LocalType;
998 // Reserve some memory inside the message queue
999 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1001 // Construct message in the message queue memory; note that delete should not be called on the return value
1002 new (slot) LocalType( &manager, &UpdateManager::RemoveShader, const_cast<Shader*>( shader ) );
1005 inline void SetShaderProgramMessage( UpdateManager& manager,
1006 const Shader& shader,
1007 Internal::ShaderDataPtr shaderData,
1008 bool modifiesGeometry )
1010 typedef MessageValue3< UpdateManager, Shader*, Internal::ShaderDataPtr, bool > LocalType;
1012 // Reserve some memory inside the message queue
1013 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1015 // Construct message in the message queue memory; note that delete should not be called on the return value
1016 new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, const_cast<Shader*>( &shader ), shaderData, modifiesGeometry );
1019 inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
1021 typedef MessageValue1< UpdateManager, Vector4 > LocalType;
1023 // Reserve some memory inside the message queue
1024 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1026 // Construct message in the message queue memory; note that delete should not be called on the return value
1027 new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
1030 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int32_t>& rect )
1032 typedef MessageValue1< UpdateManager, Rect<int32_t> > LocalType;
1034 // Reserve some memory inside the message queue
1035 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1037 // Construct message in the message queue memory; note that delete should not be called on the return value
1038 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
1041 inline void SetDefaultSurfaceOrientationMessage( UpdateManager& manager, int orientation )
1043 typedef MessageValue1< UpdateManager, int > LocalType;
1045 // Reserve some memory inside the message queue
1046 unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1048 // Construct message in the message queue memory; note that delete should not be called on the return value
1049 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceOrientation, orientation );
1052 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
1054 typedef MessageValue1< UpdateManager, float > LocalType;
1056 // Reserve some memory inside the message queue
1057 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1059 // Construct message in the message queue memory; note that delete should not be called on the return value
1060 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
1063 inline void SetRenderingBehaviorMessage( UpdateManager& manager, DevelStage::Rendering renderingBehavior )
1065 typedef MessageValue1< UpdateManager, DevelStage::Rendering > LocalType;
1067 // Reserve some memory inside the message queue
1068 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1070 // Construct message in the message queue memory; note that delete should not be called on the return value
1071 new (slot) LocalType( &manager, &UpdateManager::SetRenderingBehavior, renderingBehavior );
1075 * Create a message for setting the depth of a layer
1076 * @param[in] manager The update manager
1077 * @param[in] layers list of layers
1078 * @param[in] rootLayer The rool layer
1080 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, const Layer* rootLayer )
1082 typedef MessageValue2< UpdateManager, std::vector< Layer* >, const Layer* > LocalType;
1084 // Reserve some memory inside the message queue
1085 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1087 // Construct message in the message queue memory; note that delete should not be called on the return value
1088 new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, rootLayer );
1091 inline void AddRendererMessage( UpdateManager& manager, OwnerPointer< Renderer >& object )
1093 typedef MessageValue1< UpdateManager, OwnerPointer< Renderer > > LocalType;
1095 // Reserve some memory inside the message queue
1096 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1097 // Construct message in the message queue memory; note that delete should not be called on the return value
1098 new (slot) LocalType( &manager, &UpdateManager::AddRenderer, object );
1101 inline void RemoveRendererMessage( UpdateManager& manager, const Renderer& object )
1103 typedef MessageValue1< UpdateManager, Renderer* > LocalType;
1105 // Reserve some memory inside the message queue
1106 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1107 // Construct message in the message queue memory; note that delete should not be called on the return value
1108 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderer, const_cast<Renderer*>( &object ) );
1111 // The render thread can safely change the Shader
1112 inline void AddTextureSetMessage( UpdateManager& manager, OwnerPointer< TextureSet >& textureSet )
1114 typedef MessageValue1< UpdateManager, OwnerPointer< TextureSet > > LocalType;
1116 // Reserve some memory inside the message queue
1117 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1119 // Construct message in the message queue memory; note that delete should not be called on the return value
1120 new (slot) LocalType( &manager, &UpdateManager::AddTextureSet, textureSet );
1123 // The render thread can safely change the Shader
1124 inline void RemoveTextureSetMessage( UpdateManager& manager, TextureSet& textureSet )
1126 typedef MessageValue1< UpdateManager, TextureSet* > LocalType;
1128 // Reserve some memory inside the message queue
1129 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1131 // Construct message in the message queue memory; note that delete should not be called on the return value
1132 new (slot) LocalType( &manager, &UpdateManager::RemoveTextureSet, &textureSet );
1135 inline void AddSamplerMessage( UpdateManager& manager, OwnerPointer< Render::Sampler >& sampler )
1137 // Message has ownership of Sampler while in transit from event -> update
1138 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Sampler > > LocalType;
1140 // Reserve some memory inside the message queue
1141 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1143 // Construct message in the message queue memory; note that delete should not be called on the return value
1144 new (slot) LocalType( &manager, &UpdateManager::AddSampler, sampler );
1147 inline void RemoveSamplerMessage( UpdateManager& manager, Render::Sampler& sampler )
1149 typedef MessageValue1< UpdateManager, Render::Sampler* > LocalType;
1151 // Reserve some memory inside the message queue
1152 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1154 // Construct message in the message queue memory; note that delete should not be called on the return value
1155 new (slot) LocalType( &manager, &UpdateManager::RemoveSampler, &sampler );
1158 inline void SetFilterModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode )
1160 typedef MessageValue3< UpdateManager, Render::Sampler*, uint32_t, uint32_t > LocalType;
1162 // Reserve some memory inside the message queue
1163 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1165 // Construct message in the message queue memory; note that delete should not be called on the return value
1166 new (slot) LocalType( &manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode );
1169 inline void SetWrapModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode )
1171 typedef MessageValue4< UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t > LocalType;
1173 // Reserve some memory inside the message queue
1174 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1176 // Construct message in the message queue memory; note that delete should not be called on the return value
1177 new (slot) LocalType( &manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode );
1180 inline void AddPropertyBuffer( UpdateManager& manager, OwnerPointer< Render::PropertyBuffer >& propertyBuffer )
1182 // Message has ownership of propertyBuffer while in transit from event -> update
1183 typedef MessageValue1< UpdateManager, OwnerPointer< Render::PropertyBuffer > > LocalType;
1185 // Reserve some memory inside the message queue
1186 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1188 // Construct message in the message queue memory; note that delete should not be called on the return value
1189 new (slot) LocalType( &manager, &UpdateManager::AddPropertyBuffer, propertyBuffer );
1192 inline void RemovePropertyBuffer( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer )
1194 typedef MessageValue1< UpdateManager, Render::PropertyBuffer* > LocalType;
1196 // Reserve some memory inside the message queue
1197 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1199 // Construct message in the message queue memory; note that delete should not be called on the return value
1200 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyBuffer, &propertyBuffer );
1203 inline void SetPropertyBufferFormat( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format )
1205 // Message has ownership of PropertyBuffer::Format while in transit from event -> update
1206 typedef MessageValue2< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Render::PropertyBuffer::Format> > LocalType;
1208 // Reserve some memory inside the message queue
1209 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1211 // Construct message in the message queue memory; note that delete should not be called on the return value
1212 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferFormat, &propertyBuffer, format );
1215 inline void SetPropertyBufferData( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
1217 // Message has ownership of PropertyBuffer data while in transit from event -> update
1218 typedef MessageValue3< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Vector<uint8_t> >, uint32_t > LocalType;
1220 // Reserve some memory inside the message queue
1221 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1223 // Construct message in the message queue memory; note that delete should not be called on the return value
1224 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferData, &propertyBuffer, data, size );
1227 inline void AddGeometry( UpdateManager& manager, OwnerPointer< Render::Geometry >& geometry )
1229 // Message has ownership of Geometry while in transit from event -> update
1230 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Geometry > > LocalType;
1232 // Reserve some memory inside the message queue
1233 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1235 // Construct message in the message queue memory; note that delete should not be called on the return value
1236 new (slot) LocalType( &manager, &UpdateManager::AddGeometry, geometry );
1239 inline void RemoveGeometry( UpdateManager& manager, Render::Geometry& geometry )
1241 typedef MessageValue1< UpdateManager, Render::Geometry* > LocalType;
1243 // Reserve some memory inside the message queue
1244 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1246 // Construct message in the message queue memory; note that delete should not be called on the return value
1247 new (slot) LocalType( &manager, &UpdateManager::RemoveGeometry, &geometry );
1250 inline void AttachVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1252 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1254 // Reserve some memory inside the message queue
1255 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1257 // Construct message in the message queue memory; note that delete should not be called on the return value
1258 new (slot) LocalType( &manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1261 inline void RemoveVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1263 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1265 // Reserve some memory inside the message queue
1266 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1268 // Construct message in the message queue memory; note that delete should not be called on the return value
1269 new (slot) LocalType( &manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1272 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1273 template< typename T >
1274 class IndexBufferMessage : public MessageBase
1279 * Constructor which does a Vector::Swap()
1281 IndexBufferMessage( T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices )
1283 mManager( manager ),
1284 mRenderGeometry( geometry )
1286 mIndices.Swap( indices );
1290 * Virtual destructor
1292 virtual ~IndexBufferMessage()
1297 * @copydoc MessageBase::Process
1299 virtual void Process( BufferIndex /*bufferIndex*/ )
1301 DALI_ASSERT_DEBUG( mManager && "Message does not have an object" );
1302 mManager->SetIndexBuffer( mRenderGeometry, mIndices );
1308 Render::Geometry* mRenderGeometry;
1309 Dali::Vector<uint16_t> mIndices;
1312 inline void SetIndexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices )
1314 typedef IndexBufferMessage< UpdateManager > LocalType;
1316 // Reserve some memory inside the message queue
1317 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1319 // Construct message in the message queue memory; note that delete should not be called on the return value
1320 new (slot) LocalType( &manager, &geometry, indices );
1323 inline void SetGeometryTypeMessage( UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType )
1325 typedef MessageValue2< UpdateManager, Render::Geometry*, uint32_t > LocalType;
1327 // Reserve some memory inside the message queue
1328 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1330 // Construct message in the message queue memory; note that delete should not be called on the return value
1331 new (slot) LocalType( &manager, &UpdateManager::SetGeometryType, &geometry, geometryType );
1334 inline void AddTexture( UpdateManager& manager, OwnerPointer< Render::Texture >& texture )
1336 // Message has ownership of Texture while in transit from event -> update
1337 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Texture > > LocalType;
1339 // Reserve some memory inside the message queue
1340 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1342 // Construct message in the message queue memory; note that delete should not be called on the return value
1343 new (slot) LocalType( &manager, &UpdateManager::AddTexture, texture );
1346 inline void RemoveTexture( UpdateManager& manager, Render::Texture& texture )
1348 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1350 // Reserve some memory inside the message queue
1351 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1353 // Construct message in the message queue memory; note that delete should not be called on the return value
1354 new (slot) LocalType( &manager, &UpdateManager::RemoveTexture, &texture );
1357 inline void UploadTextureMessage( UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params )
1359 typedef MessageValue3< UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams > LocalType;
1361 // Reserve some memory inside the message queue
1362 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1364 // Construct message in the message queue memory; note that delete should not be called on the return value
1365 new (slot) LocalType( &manager, &UpdateManager::UploadTexture, &texture, pixelData, params );
1368 inline void GenerateMipmapsMessage( UpdateManager& manager, Render::Texture& texture )
1370 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1372 // Reserve some memory inside the message queue
1373 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1375 // Construct message in the message queue memory; note that delete should not be called on the return value
1376 new (slot) LocalType( &manager, &UpdateManager::GenerateMipmaps, &texture );
1380 inline void AddFrameBuffer( UpdateManager& manager, OwnerPointer< Render::FrameBuffer >& frameBuffer )
1382 typedef MessageValue1< UpdateManager, OwnerPointer< Render::FrameBuffer > > LocalType;
1384 // Reserve some memory inside the message queue
1385 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1387 // Construct message in the message queue memory; note that delete should not be called on the return value
1388 new (slot) LocalType( &manager, &UpdateManager::AddFrameBuffer, frameBuffer );
1391 inline void RemoveFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )
1393 typedef MessageValue1< UpdateManager, Render::FrameBuffer* > LocalType;
1395 // Reserve some memory inside the message queue
1396 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1398 // Construct message in the message queue memory; note that delete should not be called on the return value
1399 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer );
1402 inline void AttachColorTextureToFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer )
1404 typedef MessageValue4< UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t > LocalType;
1406 // Reserve some memory inside the message queue
1407 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1409 // Construct message in the message queue memory; note that delete should not be called on the return value
1410 new (slot) LocalType( &manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer );
1413 inline void SetDepthIndicesMessage( UpdateManager& manager, OwnerPointer< NodeDepths >& nodeDepths )
1415 typedef MessageValue1< UpdateManager, OwnerPointer< NodeDepths > > LocalType;
1417 // Reserve some memory inside the message queue
1418 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1420 // Construct message in the message queue memory; note that delete should not be called on the return value
1421 new (slot) LocalType( &manager, &UpdateManager::SetDepthIndices, nodeDepths );
1424 inline void AddResetterMessage( UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter )
1426 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyResetterBase> > LocalType;
1428 // Reserve some memory inside the message queue
1429 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1431 // Construct message in the message queue memory; note that delete should not be called on the return value
1432 new (slot) LocalType( &manager, &UpdateManager::AddPropertyResetter, resetter );
1435 inline void AddFrameCallbackMessage( UpdateManager& manager, OwnerPointer< FrameCallback >& frameCallback, const Node& rootNode )
1437 typedef MessageValue2< UpdateManager, OwnerPointer< FrameCallback >, const Node* > LocalType;
1439 // Reserve some memory inside the message queue
1440 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1442 // Construct message in the message queue memory; note that delete should not be called on the return value
1443 new (slot) LocalType( &manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode );
1446 inline void RemoveFrameCallbackMessage( UpdateManager& manager, FrameCallbackInterface& frameCallback )
1448 typedef MessageValue1< UpdateManager, FrameCallbackInterface* > LocalType;
1450 // Reserve some memory inside the message queue
1451 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1453 // Construct message in the message queue memory; note that delete should not be called on the return value
1454 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameCallback, &frameCallback );
1457 } // namespace SceneGraph
1459 } // namespace Internal
1463 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H