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.
136 UpdateManager( NotificationManager& notificationManager,
137 CompleteNotificationInterface& animationPlaylist,
138 PropertyNotifier& propertyNotifier,
139 DiscardQueue& discardQueue,
140 Integration::RenderController& controller,
141 RenderManager& renderManager,
142 RenderQueue& renderQueue,
143 RenderTaskProcessor& renderTaskProcessor );
148 virtual ~UpdateManager();
150 // Node connection methods
153 * Installs a new layer as the root node.
154 * @pre The layer is of derived Node type Layer.
155 * @pre The layer does not have a parent.
156 * @param[in] layer The new root node.
157 * @post The node is owned by UpdateManager.
159 void InstallRoot( OwnerPointer<Layer>& layer );
162 * Uninstalls the root node.
163 * @pre The layer is of derived Node type Layer.
164 * @pre The layer does not have a parent.
165 * @param[in] layer The root node.
166 * @post The node is owned by UpdateManager.
168 void UninstallRoot( Layer* layer );
171 * Add a Node; UpdateManager takes ownership.
172 * @pre The node does not have a parent.
173 * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
174 * @param[in] node The node to add.
176 void AddNode( OwnerPointer<Node>& node );
179 * Connect a Node to the scene-graph.
180 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
181 * @pre The node does not already have a parent.
182 * @param[in] parent The new parent node.
184 void ConnectNode( Node* parent, Node* node );
187 * Disconnect a Node from the scene-graph.
188 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
189 * @pre The node has a parent.
190 * @param[in] node The node to disconnect.
192 void DisconnectNode( Node* node );
195 * Destroy a Node owned by UpdateManager.
196 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
197 * In the following update, the previously queued Nodes may be deleted.
198 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
199 * @param[in] node The node to destroy.
201 void DestroyNode( Node* node );
204 * Add a camera on scene
205 * @param[in] camera The camera to add
207 void AddCamera( OwnerPointer< Camera >& camera );
210 * Remove a camera from scene
211 * @param[in] camera to remove
213 void RemoveCamera( Camera* camera );
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( OwnerPointer<PropertyOwner>& object );
224 * @param[in] object The object to remove.
226 void RemoveObject( PropertyOwner* object );
229 * Add a newly created render task list.
230 * @param[in] taskList The render task list to add.
231 * @post The render task list is owned by UpdateManager.
233 void AddRenderTaskList( OwnerPointer<RenderTaskList>& taskList );
236 * Remove a render task list.
237 * @param[in] taskList The render task list to remove.
239 void RemoveRenderTaskList( RenderTaskList* taskList );
244 * Add a newly created animation.
245 * @param[in] animation The animation to add.
246 * @post The animation is owned by UpdateManager.
248 void AddAnimation( OwnerPointer< SceneGraph::Animation >& animation );
252 * @param[in] animation The animation to stop.
254 void StopAnimation( Animation* animation );
257 * Remove an animation.
258 * @param[in] animation The animation to remove.
260 void RemoveAnimation( Animation* animation );
263 * Query whether any animations are currently running.
264 * @return True if any animations are running.
266 bool IsAnimationRunning() const;
269 * Add a property resetter. UpdateManager takes ownership of the object.
270 * It will be killed by UpdateManager when the associated animator or
271 * constraint has finished; or the property owner of the property is destroyed.
273 void AddPropertyResetter( OwnerPointer<PropertyResetterBase>& propertyResetter );
275 // Property Notification
278 * Add a newly created property notification
279 * @param[in] propertyNotification The notification to add
280 * @post The propertyNotification is owned by UpdateManager.
282 void AddPropertyNotification( OwnerPointer< PropertyNotification >& propertyNotification );
285 * Remove a property notification
286 * @param[in] propertyNotification The notification to remove
288 void RemovePropertyNotification( PropertyNotification* propertyNotification );
291 * Set Notify state for PropertyNotification
292 * @param[in] propertyNotification The notification to remove
293 * @param[in] notifyMode The notification mode.
295 void PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode );
300 * Add a newly created shader.
301 * @param[in] shader The shader to add.
302 * @post The shader is owned by the UpdateManager.
304 void AddShader( OwnerPointer< Shader >& shader );
308 * @pre The shader has been added to the UpdateManager.
309 * @param[in] shader The shader to remove.
310 * @post The shader is destroyed.
312 void RemoveShader( Shader* shader );
315 * Set the shader program for a Shader object
316 * @param[in] shader The shader to modify
317 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
318 * @param[in] modifiesGeometry True if the vertex shader modifies geometry
320 void SetShaderProgram( Shader* shader, Internal::ShaderDataPtr shaderData, bool modifiesGeometry );
323 * @brief Accept compiled shaders passed back on render thread for saving.
324 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
326 virtual void SaveBinary( Internal::ShaderDataPtr shaderData );
329 * @brief Set the destination for compiled shader binaries to be passed on to.
330 * The dispatcher passed in will be called from the update thread.
331 * @param[in] upstream A sink for ShaderDatas to be passed into.
333 void SetShaderSaver( ShaderSaver& upstream );
338 * Add a new renderer to scene
339 * @param renderer to add
341 void AddRenderer( OwnerPointer< Renderer >& renderer );
344 * Add a renderer from scene
345 * @param renderer to remove
347 void RemoveRenderer( Renderer* renderer );
352 * Set the pan gesture processor.
353 * Pan Gesture processor lives for the lifetime of UpdateManager
354 * @param[in] gesture The gesture processor.
355 * @post The gestureProcessor is owned by the UpdateManager.
357 void SetPanGestureProcessor( PanGesture* gestureProcessor );
362 * Add a newly created TextureSet.
363 * @param[in] textureSet The texture set to add.
364 * @post The TextureSet is owned by the UpdateManager.
366 void AddTextureSet( OwnerPointer< TextureSet >& textureSet );
369 * Remove a TextureSet.
370 * @pre The TextureSet has been added to the UpdateManager.
371 * @param[in] textureSet The TextureSet to remove.
372 * @post The TextureSet is destroyed.
374 void RemoveTextureSet( TextureSet* textureSet );
379 * Get the scene graph side list of RenderTasks.
380 * @param[in] systemLevel True if using the system-level overlay.
381 * @return The list of render tasks
383 RenderTaskList* GetRenderTaskList( bool systemLevel );
385 // Message queue handling
388 * Reserve space for another message in the queue; this must then be initialized by the caller.
389 * The message will be read from the update-thread after the next FlushMessages is called.
390 * @post Calling this method may invalidate any previously returned slots.
391 * @param[in] size The message size with respect to the size of type "char".
392 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
393 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
394 * @return A pointer to the first char allocated for the message.
396 uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene = true );
399 * @return the current event-buffer index.
401 BufferIndex GetEventBufferIndex() const
403 // inlined as its called often from event thread
404 return mSceneGraphBuffers.GetEventBufferIndex();
408 * Called by the event-thread to signal that FlushQueue will be called
409 * e.g. when it has finished event processing.
411 void EventProcessingStarted();
414 * Flush the set of messages, which were previously stored with QueueMessage().
415 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
417 * @return True if there are messages to process.
422 * Add a new sampler to RenderManager
423 * @param[in] sampler The sampler to add
424 * @post Sends a message to RenderManager to add the sampler.
425 * The sampler will be owned by RenderManager
427 void AddSampler( OwnerPointer< Render::Sampler >& sampler );
430 * Removes an existing sampler from RenderManager
431 * @param[in] sampler The sampler to remove
432 * @post The sampler will be destroyed in the render thread
434 void RemoveSampler( Render::Sampler* sampler );
437 * Sets the filter modes for an existing sampler
438 * @param[in] sampler The sampler
439 * @param[in] minFilterMode The filter to use under minification
440 * @param[in] magFilterMode The filter to use under magnification
442 void SetFilterMode( Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode );
445 * Sets the wrap mode for an existing sampler
446 * @param[in] sampler The sampler
447 * @param[in] rWrapMode Wrapping mode in z direction
448 * @param[in] sWrapMode Wrapping mode in x direction
449 * @param[in] tWrapMode Wrapping mode in y direction
451 void SetWrapMode( Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode );
454 * Add a new property buffer to RenderManager
455 * @param[in] propertryBuffer The property buffer to add
456 * @post Sends a message to RenderManager to add the property buffer.
457 * The property buffer will be owned by RenderManager
459 void AddPropertyBuffer( OwnerPointer< Render::PropertyBuffer >& propertryBuffer );
462 * Removes an existing PropertyBuffer from RenderManager
463 * @param[in] propertryBuffer The property buffer to remove
464 * @post The property buffer will be destroyed in the render thread
466 void RemovePropertyBuffer( Render::PropertyBuffer* propertryBuffer );
469 * Sets the format of an existing property buffer
470 * @param[in] propertyBuffer The property buffer.
471 * @param[in] format The new format of the buffer
472 * @post Sends a message to RenderManager to set the new format to the property buffer.
474 void SetPropertyBufferFormat( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format );
477 * Sets the data of an existing property buffer
478 * @param[in] propertyBuffer The property buffer.
479 * @param[in] data The new data of the buffer
480 * @param[in] size The new size of the buffer
481 * @post Sends a message to RenderManager to set the new data to the property buffer.
483 void SetPropertyBufferData( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size );
486 * Adds a geometry to the RenderManager
487 * @param[in] geometry The geometry to add
488 * @post Sends a message to RenderManager to add the Geometry
489 * The geometry will be owned by RenderManager
491 void AddGeometry( OwnerPointer< Render::Geometry >& geometry );
494 * Removes an existing Geometry from RenderManager
495 * @param[in] geometry The geometry to remove
496 * @post The geometry will be destroyed in the render thread
498 void RemoveGeometry( Render::Geometry* geometry );
501 * Sets the geometry type of an existing Geometry
502 * @param[in] geometry The geometry
503 * @param[in] geometryType The type of the geometry
505 void SetGeometryType( Render::Geometry* geometry, uint32_t geometryType );
508 * Sets the index buffer to be used by a geometry
509 * @param[in] geometry The geometry
510 * @param[in] indices A vector containing the indices for the geometry
512 void SetIndexBuffer( Render::Geometry* geometry, Dali::Vector<uint16_t>& indices );
515 * Adds a vertex buffer to a geometry
516 * @param[in] geometry The geometry
517 * @param[in] propertyBuffer The property buffer
519 void AttachVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
522 * Removes a vertex buffer from a geometry
523 * @param[in] geometry The geometry
524 * @param[in] propertyBuffer The property buffer
526 void RemoveVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
529 * Adds a texture to the render manager
530 * @param[in] texture The texture to add
531 * The texture will be owned by RenderManager
533 void AddTexture( OwnerPointer< Render::Texture >& texture );
536 * Removes a texture from the render manager
537 * @param[in] texture The texture to remove
538 * @post The texture will be destroyed in the render thread
540 void RemoveTexture( Render::Texture* texture );
543 * Uploads data to a texture owned by the RenderManager
544 * @param[in] texture The texture
545 * @param[in] pixelData The pixel data object
546 * @param[in] params The parameters for the upload
548 void UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params );
551 * Generates mipmaps for a texture owned by the RenderManager
552 * @param[in] texture The texture
554 void GenerateMipmaps( Render::Texture* texture );
557 * Adds a framebuffer to the render manager
558 * @param[in] frameBuffer The framebuffer to add
559 * The framebuffer will be owned by RenderManager
561 void AddFrameBuffer( OwnerPointer< Render::FrameBuffer >& frameBuffer );
564 * Removes a FrameBuffer from the render manager
565 * @param[in] frameBuffer The FrameBuffer to remove
566 * @post The FrameBuffer will be destroyed in the render thread
568 void RemoveFrameBuffer( Render::FrameBuffer* frameBuffer );
571 * Attach a texture as color output to an existing FrameBuffer
572 * @param[in] frameBuffer The FrameBuffer
573 * @param[in] texture The texture that will be used as output when rendering
574 * @param[in] mipmapLevel The mipmap of the texture to be attached
575 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
577 void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face );
582 * Performs an Update traversal on the scene-graph.
583 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
584 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
585 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
586 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
587 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
588 * @return True if further updates are required e.g. during animations.
590 uint32_t Update( float elapsedSeconds,
591 uint32_t lastVSyncTimeMilliseconds,
592 uint32_t nextVSyncTimeMilliseconds,
593 bool renderToFboEnabled,
594 bool isRenderingToFbo );
597 * Set the background color i.e. the glClear color used at the beginning of each frame.
598 * @param[in] color The new background color.
600 void SetBackgroundColor(const Vector4& color);
603 * Set the default surface rect.
604 * @param[in] rect The rect value representing the surface.
606 void SetDefaultSurfaceRect( const Rect<int>& rect );
609 * Set the default surface orientation.
610 * @param[in] orientation The orientation value representing the surface.
612 void SetDefaultSurfaceOrientation( int orientation );
615 * @copydoc Dali::Stage::KeepRendering()
617 void KeepRendering( float durationSeconds );
620 * @copydoc Dali::DevelStage::SetRenderingBehavior()
622 void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
625 * Sets the depths of all layers.
626 * @param layers The layers in depth order.
627 * @param[in] rootLayer The root layer of the sorted layers.
629 void SetLayerDepths( const std::vector< Layer* >& layers, const Layer* rootLayer );
632 * Set the depth indices of all nodes (in LayerUI's)
633 * @param[in] nodeDepths A vector of nodes and associated depth indices
635 void SetDepthIndices( OwnerPointer< NodeDepths >& nodeDepths );
638 * Query wheter the default surface rect is changed or not.
639 * @return true if the default surface rect is changed.
641 bool IsDefaultSurfaceRectChanged();
644 * Adds an implementation of the FrameCallbackInterface.
645 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
646 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
648 void AddFrameCallback( OwnerPointer< FrameCallback >& frameCallback, const Node* rootNode );
651 * Removes the specified implementation of FrameCallbackInterface.
652 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
654 void RemoveFrameCallback( FrameCallbackInterface* frameCallback );
659 UpdateManager(const UpdateManager&);
662 UpdateManager& operator=(const UpdateManager& rhs);
665 * Helper to check whether the update-thread should keep going.
666 * @param[in] elapsedSeconds The time in seconds since the previous update.
667 * @return True if the update-thread should keep going.
669 uint32_t KeepUpdatingCheck( float elapsedSeconds ) const;
672 * Helper to reset all Node properties
673 * @param[in] bufferIndex to use
675 void ResetProperties( BufferIndex bufferIndex );
678 * Perform gesture updates.
679 * @param[in] bufferIndex to use
680 * @param[in] lastVSyncTime The last VSync time in milliseconds.
681 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
682 * @return true, if any properties were updated.
684 bool ProcessGestures( BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds );
687 * Perform animation updates
688 * @param[in] bufferIndex to use
689 * @param[in] elapsedSeconds time since last frame
691 void Animate( BufferIndex bufferIndex, float elapsedSeconds );
694 * Applies constraints to CustomObjects
695 * @param[in] bufferIndex to use
697 void ConstrainCustomObjects( BufferIndex bufferIndex );
700 * Applies constraints to RenderTasks
701 * @param[in] bufferIndex to use
703 void ConstrainRenderTasks( BufferIndex bufferIndex );
706 * Applies constraints to Shaders
707 * @param[in] bufferIndex to use
709 void ConstrainShaders( BufferIndex bufferIndex );
712 * Perform property notification updates
713 * @param[in] bufferIndex to use
715 void ProcessPropertyNotifications( BufferIndex bufferIndex );
718 * Pass shader binaries queued here on to event thread.
720 void ForwardCompiledShadersToEventThread();
723 * Update node shaders, opacity, geometry etc.
724 * @param[in] bufferIndex to use
726 void UpdateNodes( BufferIndex bufferIndex );
730 * @param[in] bufferIndex to use
732 void UpdateRenderers( BufferIndex bufferIndex );
736 // needs to be direct member so that getter for event buffer can be inlined
737 SceneGraphBuffers mSceneGraphBuffers;
744 // Messages for UpdateManager
746 inline void InstallRootMessage( UpdateManager& manager, OwnerPointer<Layer>& root )
748 // Message has ownership of Layer while in transit from event -> update
749 typedef MessageValue1< UpdateManager, OwnerPointer<Layer> > LocalType;
751 // Reserve some memory inside the message queue
752 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
754 // Construct message in the message queue memory; note that delete should not be called on the return value
755 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, root );
758 inline void UninstallRootMessage( UpdateManager& manager, const Layer* constRoot )
760 // Scene graph thread can destroy this object.
761 Layer* root = const_cast< Layer* >( constRoot );
763 typedef MessageValue1< UpdateManager, Layer* > LocalType;
765 // Reserve some memory inside the message queue
766 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
768 // Construct message in the message queue memory; note that delete should not be called on the return value
769 new (slot) LocalType( &manager, &UpdateManager::UninstallRoot, root );
772 inline void AddNodeMessage( UpdateManager& manager, OwnerPointer<Node>& node )
774 // Message has ownership of Node while in transit from event -> update
775 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
777 // Reserve some memory inside the message queue
778 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
780 // Construct message in the message queue memory; note that delete should not be called on the return value
781 new (slot) LocalType( &manager, &UpdateManager::AddNode, node );
784 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild )
786 // Update thread can edit the object
787 Node& parent = const_cast< Node& >( constParent );
788 Node& child = const_cast< Node& >( constChild );
790 typedef MessageValue2< UpdateManager, Node*, Node* > LocalType;
792 // Reserve some memory inside the message queue
793 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
795 // Construct message in the message queue memory; note that delete should not be called on the return value
796 new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child );
799 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
801 // Scene graph thread can modify this object.
802 Node& node = const_cast< Node& >( constNode );
804 typedef MessageValue1< UpdateManager, Node* > LocalType;
806 // Reserve some memory inside the message queue
807 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
809 // Construct message in the message queue memory; note that delete should not be called on the return value
810 new (slot) LocalType( &manager, &UpdateManager::DisconnectNode, &node );
813 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
815 // Scene graph thread can destroy this object.
816 Node& node = const_cast< Node& >( constNode );
818 typedef MessageValue1< UpdateManager, Node* > LocalType;
820 // Reserve some memory inside the message queue
821 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
823 // Construct message in the message queue memory; note that delete should not be called on the return value
824 new (slot) LocalType( &manager, &UpdateManager::DestroyNode, &node );
827 inline void AddCameraMessage( UpdateManager& manager, OwnerPointer< Camera >& camera )
829 // Message has ownership of Camera while in transit from event -> update
830 typedef MessageValue1< UpdateManager, OwnerPointer< Camera > > LocalType;
832 // Reserve some memory inside the message queue
833 uint32_t* slot = manager.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::AddCamera, camera );
839 inline void RemoveCameraMessage( UpdateManager& manager, const Camera* camera )
841 typedef MessageValue1< UpdateManager, Camera* > LocalType;
843 // Reserve some memory inside the message queue
844 uint32_t* slot = manager.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::RemoveCamera, const_cast<Camera*>( camera ) );
850 inline void AddObjectMessage( UpdateManager& manager, OwnerPointer<PropertyOwner>& object )
852 // Message has ownership of object while in transit from event -> update
853 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
855 // Reserve some memory inside the message queue
856 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
858 // Construct message in the message queue memory; note that delete should not be called on the return value
859 new (slot) LocalType( &manager, &UpdateManager::AddObject, object );
862 inline void RemoveObjectMessage( UpdateManager& manager, const PropertyOwner* object )
864 typedef MessageValue1< UpdateManager, PropertyOwner* > LocalType;
866 // Reserve some memory inside the message queue
867 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
869 // Construct message in the message queue memory; note that delete should not be called on the return value
870 new (slot) LocalType( &manager, &UpdateManager::RemoveObject, const_cast<PropertyOwner*>( object ) );
873 inline void AddAnimationMessage( UpdateManager& manager, OwnerPointer< SceneGraph::Animation >& animation )
875 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Animation > > LocalType;
877 // Reserve some memory inside the message queue
878 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
880 // Construct message in the message queue memory; note that delete should not be called on the return value
881 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
884 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
886 // The scene-graph thread owns this object so it can safely edit it.
887 Animation& animation = const_cast< Animation& >( constAnimation );
889 typedef MessageValue1< UpdateManager, Animation* > LocalType;
891 // Reserve some memory inside the message queue
892 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
894 // Construct message in the message queue memory; note that delete should not be called on the return value
895 new (slot) LocalType( &manager, &UpdateManager::StopAnimation, &animation );
898 inline void RemoveAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
900 // The scene-graph thread owns this object so it can safely edit it.
901 Animation& animation = const_cast< Animation& >( constAnimation );
903 typedef MessageValue1< UpdateManager, Animation* > LocalType;
905 // Reserve some memory inside the message queue
906 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
908 // Construct message in the message queue memory; note that delete should not be called on the return value
909 new (slot) LocalType( &manager, &UpdateManager::RemoveAnimation, &animation );
912 inline void AddRenderTaskListMessage( UpdateManager& manager, OwnerPointer< SceneGraph::RenderTaskList >& taskList )
914 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::RenderTaskList > > LocalType;
916 // Reserve some memory inside the message queue
917 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
919 // Construct message in the message queue memory; note that delete should not be called on the return value
920 new (slot) LocalType( &manager, &UpdateManager::AddRenderTaskList, taskList );
923 inline void RemoveRenderTaskListMessage( UpdateManager& manager, const RenderTaskList& constTaskList )
925 // The scene-graph thread owns this object so it can safely edit it.
926 RenderTaskList& taskList = const_cast< RenderTaskList& >( constTaskList );
928 typedef MessageValue1< UpdateManager, RenderTaskList* > LocalType;
930 // Reserve some memory inside the message queue
931 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
933 // Construct message in the message queue memory; note that delete should not be called on the return value
934 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderTaskList, &taskList );
937 inline void AddPropertyNotificationMessage( UpdateManager& manager, OwnerPointer< PropertyNotification >& propertyNotification )
939 // Message has ownership of PropertyNotification while in transit from event -> update
940 typedef MessageValue1< UpdateManager, OwnerPointer< PropertyNotification > > LocalType;
942 // Reserve some memory inside the message queue
943 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
945 // Construct message in the message queue memory; note that delete should not be called on the return value
946 new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
949 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
951 // The scene-graph thread owns this object so it can safely edit it.
952 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
954 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
956 // Reserve some memory inside the message queue
957 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
959 // Construct message in the message queue memory; note that delete should not be called on the return value
960 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyNotification, &propertyNotification );
963 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
964 const PropertyNotification* constPropertyNotification,
965 PropertyNotification::NotifyMode notifyMode )
967 // The scene-graph thread owns this object so it can safely edit it.
968 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
970 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
972 // Reserve some memory inside the message queue
973 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
975 // Construct message in the message queue memory; note that delete should not be called on the return value
976 new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
979 // The render thread can safely change the Shader
980 inline void AddShaderMessage( UpdateManager& manager, OwnerPointer< Shader >& shader )
982 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > LocalType;
984 // Reserve some memory inside the message queue
985 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
987 // Construct message in the message queue memory; note that delete should not be called on the return value
988 new (slot) LocalType( &manager, &UpdateManager::AddShader, shader );
991 // The render thread can safely change the Shader
992 inline void RemoveShaderMessage( UpdateManager& manager, const Shader* shader )
994 typedef MessageValue1< UpdateManager, Shader* > LocalType;
996 // Reserve some memory inside the message queue
997 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
999 // Construct message in the message queue memory; note that delete should not be called on the return value
1000 new (slot) LocalType( &manager, &UpdateManager::RemoveShader, const_cast<Shader*>( shader ) );
1003 inline void SetShaderProgramMessage( UpdateManager& manager,
1004 const Shader& shader,
1005 Internal::ShaderDataPtr shaderData,
1006 bool modifiesGeometry )
1008 typedef MessageValue3< UpdateManager, Shader*, Internal::ShaderDataPtr, bool > LocalType;
1010 // Reserve some memory inside the message queue
1011 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1013 // Construct message in the message queue memory; note that delete should not be called on the return value
1014 new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, const_cast<Shader*>( &shader ), shaderData, modifiesGeometry );
1017 inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
1019 typedef MessageValue1< UpdateManager, Vector4 > LocalType;
1021 // Reserve some memory inside the message queue
1022 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1024 // Construct message in the message queue memory; note that delete should not be called on the return value
1025 new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
1028 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int32_t>& rect )
1030 typedef MessageValue1< UpdateManager, Rect<int32_t> > LocalType;
1032 // Reserve some memory inside the message queue
1033 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1035 // Construct message in the message queue memory; note that delete should not be called on the return value
1036 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
1039 inline void SetDefaultSurfaceOrientationMessage( UpdateManager& manager, int orientation )
1041 typedef MessageValue1< UpdateManager, int > LocalType;
1043 // Reserve some memory inside the message queue
1044 unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1046 // Construct message in the message queue memory; note that delete should not be called on the return value
1047 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceOrientation, orientation );
1050 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
1052 typedef MessageValue1< UpdateManager, float > LocalType;
1054 // Reserve some memory inside the message queue
1055 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1057 // Construct message in the message queue memory; note that delete should not be called on the return value
1058 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
1061 inline void SetRenderingBehaviorMessage( UpdateManager& manager, DevelStage::Rendering renderingBehavior )
1063 typedef MessageValue1< UpdateManager, DevelStage::Rendering > LocalType;
1065 // Reserve some memory inside the message queue
1066 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1068 // Construct message in the message queue memory; note that delete should not be called on the return value
1069 new (slot) LocalType( &manager, &UpdateManager::SetRenderingBehavior, renderingBehavior );
1073 * Create a message for setting the depth of a layer
1074 * @param[in] manager The update manager
1075 * @param[in] layers list of layers
1076 * @param[in] rootLayer The rool layer
1078 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, const Layer* rootLayer )
1080 typedef MessageValue2< UpdateManager, std::vector< Layer* >, const Layer* > LocalType;
1082 // Reserve some memory inside the message queue
1083 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1085 // Construct message in the message queue memory; note that delete should not be called on the return value
1086 new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, rootLayer );
1089 inline void AddRendererMessage( UpdateManager& manager, OwnerPointer< Renderer >& object )
1091 typedef MessageValue1< UpdateManager, OwnerPointer< Renderer > > LocalType;
1093 // Reserve some memory inside the message queue
1094 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1095 // Construct message in the message queue memory; note that delete should not be called on the return value
1096 new (slot) LocalType( &manager, &UpdateManager::AddRenderer, object );
1099 inline void RemoveRendererMessage( UpdateManager& manager, const Renderer& object )
1101 typedef MessageValue1< UpdateManager, Renderer* > LocalType;
1103 // Reserve some memory inside the message queue
1104 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1105 // Construct message in the message queue memory; note that delete should not be called on the return value
1106 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderer, const_cast<Renderer*>( &object ) );
1109 // The render thread can safely change the Shader
1110 inline void AddTextureSetMessage( UpdateManager& manager, OwnerPointer< TextureSet >& textureSet )
1112 typedef MessageValue1< UpdateManager, OwnerPointer< TextureSet > > LocalType;
1114 // Reserve some memory inside the message queue
1115 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1117 // Construct message in the message queue memory; note that delete should not be called on the return value
1118 new (slot) LocalType( &manager, &UpdateManager::AddTextureSet, textureSet );
1121 // The render thread can safely change the Shader
1122 inline void RemoveTextureSetMessage( UpdateManager& manager, TextureSet& textureSet )
1124 typedef MessageValue1< UpdateManager, TextureSet* > LocalType;
1126 // Reserve some memory inside the message queue
1127 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1129 // Construct message in the message queue memory; note that delete should not be called on the return value
1130 new (slot) LocalType( &manager, &UpdateManager::RemoveTextureSet, &textureSet );
1133 inline void AddSamplerMessage( UpdateManager& manager, OwnerPointer< Render::Sampler >& sampler )
1135 // Message has ownership of Sampler while in transit from event -> update
1136 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Sampler > > LocalType;
1138 // Reserve some memory inside the message queue
1139 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1141 // Construct message in the message queue memory; note that delete should not be called on the return value
1142 new (slot) LocalType( &manager, &UpdateManager::AddSampler, sampler );
1145 inline void RemoveSamplerMessage( UpdateManager& manager, Render::Sampler& sampler )
1147 typedef MessageValue1< UpdateManager, Render::Sampler* > LocalType;
1149 // Reserve some memory inside the message queue
1150 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1152 // Construct message in the message queue memory; note that delete should not be called on the return value
1153 new (slot) LocalType( &manager, &UpdateManager::RemoveSampler, &sampler );
1156 inline void SetFilterModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode )
1158 typedef MessageValue3< UpdateManager, Render::Sampler*, uint32_t, uint32_t > LocalType;
1160 // Reserve some memory inside the message queue
1161 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1163 // Construct message in the message queue memory; note that delete should not be called on the return value
1164 new (slot) LocalType( &manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode );
1167 inline void SetWrapModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode )
1169 typedef MessageValue4< UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t > LocalType;
1171 // Reserve some memory inside the message queue
1172 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1174 // Construct message in the message queue memory; note that delete should not be called on the return value
1175 new (slot) LocalType( &manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode );
1178 inline void AddPropertyBuffer( UpdateManager& manager, OwnerPointer< Render::PropertyBuffer >& propertyBuffer )
1180 // Message has ownership of propertyBuffer while in transit from event -> update
1181 typedef MessageValue1< UpdateManager, OwnerPointer< Render::PropertyBuffer > > LocalType;
1183 // Reserve some memory inside the message queue
1184 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1186 // Construct message in the message queue memory; note that delete should not be called on the return value
1187 new (slot) LocalType( &manager, &UpdateManager::AddPropertyBuffer, propertyBuffer );
1190 inline void RemovePropertyBuffer( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer )
1192 typedef MessageValue1< UpdateManager, Render::PropertyBuffer* > LocalType;
1194 // Reserve some memory inside the message queue
1195 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1197 // Construct message in the message queue memory; note that delete should not be called on the return value
1198 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyBuffer, &propertyBuffer );
1201 inline void SetPropertyBufferFormat( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format )
1203 // Message has ownership of PropertyBuffer::Format while in transit from event -> update
1204 typedef MessageValue2< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Render::PropertyBuffer::Format> > LocalType;
1206 // Reserve some memory inside the message queue
1207 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1209 // Construct message in the message queue memory; note that delete should not be called on the return value
1210 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferFormat, &propertyBuffer, format );
1213 inline void SetPropertyBufferData( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
1215 // Message has ownership of PropertyBuffer data while in transit from event -> update
1216 typedef MessageValue3< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Vector<uint8_t> >, uint32_t > LocalType;
1218 // Reserve some memory inside the message queue
1219 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1221 // Construct message in the message queue memory; note that delete should not be called on the return value
1222 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferData, &propertyBuffer, data, size );
1225 inline void AddGeometry( UpdateManager& manager, OwnerPointer< Render::Geometry >& geometry )
1227 // Message has ownership of Geometry while in transit from event -> update
1228 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Geometry > > LocalType;
1230 // Reserve some memory inside the message queue
1231 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1233 // Construct message in the message queue memory; note that delete should not be called on the return value
1234 new (slot) LocalType( &manager, &UpdateManager::AddGeometry, geometry );
1237 inline void RemoveGeometry( UpdateManager& manager, Render::Geometry& geometry )
1239 typedef MessageValue1< UpdateManager, Render::Geometry* > LocalType;
1241 // Reserve some memory inside the message queue
1242 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1244 // Construct message in the message queue memory; note that delete should not be called on the return value
1245 new (slot) LocalType( &manager, &UpdateManager::RemoveGeometry, &geometry );
1248 inline void AttachVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1250 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1252 // Reserve some memory inside the message queue
1253 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1255 // Construct message in the message queue memory; note that delete should not be called on the return value
1256 new (slot) LocalType( &manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1259 inline void RemoveVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1261 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1263 // Reserve some memory inside the message queue
1264 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1266 // Construct message in the message queue memory; note that delete should not be called on the return value
1267 new (slot) LocalType( &manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1270 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1271 template< typename T >
1272 class IndexBufferMessage : public MessageBase
1277 * Constructor which does a Vector::Swap()
1279 IndexBufferMessage( T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices )
1281 mManager( manager ),
1282 mRenderGeometry( geometry )
1284 mIndices.Swap( indices );
1288 * Virtual destructor
1290 virtual ~IndexBufferMessage()
1295 * @copydoc MessageBase::Process
1297 virtual void Process( BufferIndex /*bufferIndex*/ )
1299 DALI_ASSERT_DEBUG( mManager && "Message does not have an object" );
1300 mManager->SetIndexBuffer( mRenderGeometry, mIndices );
1306 Render::Geometry* mRenderGeometry;
1307 Dali::Vector<uint16_t> mIndices;
1310 inline void SetIndexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices )
1312 typedef IndexBufferMessage< UpdateManager > LocalType;
1314 // Reserve some memory inside the message queue
1315 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1317 // Construct message in the message queue memory; note that delete should not be called on the return value
1318 new (slot) LocalType( &manager, &geometry, indices );
1321 inline void SetGeometryTypeMessage( UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType )
1323 typedef MessageValue2< UpdateManager, Render::Geometry*, uint32_t > LocalType;
1325 // Reserve some memory inside the message queue
1326 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1328 // Construct message in the message queue memory; note that delete should not be called on the return value
1329 new (slot) LocalType( &manager, &UpdateManager::SetGeometryType, &geometry, geometryType );
1332 inline void AddTexture( UpdateManager& manager, OwnerPointer< Render::Texture >& texture )
1334 // Message has ownership of Texture while in transit from event -> update
1335 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Texture > > LocalType;
1337 // Reserve some memory inside the message queue
1338 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1340 // Construct message in the message queue memory; note that delete should not be called on the return value
1341 new (slot) LocalType( &manager, &UpdateManager::AddTexture, texture );
1344 inline void RemoveTexture( UpdateManager& manager, Render::Texture& texture )
1346 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1348 // Reserve some memory inside the message queue
1349 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1351 // Construct message in the message queue memory; note that delete should not be called on the return value
1352 new (slot) LocalType( &manager, &UpdateManager::RemoveTexture, &texture );
1355 inline void UploadTextureMessage( UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params )
1357 typedef MessageValue3< UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams > LocalType;
1359 // Reserve some memory inside the message queue
1360 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1362 // Construct message in the message queue memory; note that delete should not be called on the return value
1363 new (slot) LocalType( &manager, &UpdateManager::UploadTexture, &texture, pixelData, params );
1366 inline void GenerateMipmapsMessage( UpdateManager& manager, Render::Texture& texture )
1368 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1370 // Reserve some memory inside the message queue
1371 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1373 // Construct message in the message queue memory; note that delete should not be called on the return value
1374 new (slot) LocalType( &manager, &UpdateManager::GenerateMipmaps, &texture );
1378 inline void AddFrameBuffer( UpdateManager& manager, OwnerPointer< Render::FrameBuffer >& frameBuffer )
1380 typedef MessageValue1< UpdateManager, OwnerPointer< Render::FrameBuffer > > LocalType;
1382 // Reserve some memory inside the message queue
1383 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1385 // Construct message in the message queue memory; note that delete should not be called on the return value
1386 new (slot) LocalType( &manager, &UpdateManager::AddFrameBuffer, frameBuffer );
1389 inline void RemoveFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )
1391 typedef MessageValue1< UpdateManager, Render::FrameBuffer* > LocalType;
1393 // Reserve some memory inside the message queue
1394 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1396 // Construct message in the message queue memory; note that delete should not be called on the return value
1397 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer );
1400 inline void AttachColorTextureToFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer )
1402 typedef MessageValue4< UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t > LocalType;
1404 // Reserve some memory inside the message queue
1405 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1407 // Construct message in the message queue memory; note that delete should not be called on the return value
1408 new (slot) LocalType( &manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer );
1411 inline void SetDepthIndicesMessage( UpdateManager& manager, OwnerPointer< NodeDepths >& nodeDepths )
1413 typedef MessageValue1< UpdateManager, OwnerPointer< NodeDepths > > LocalType;
1415 // Reserve some memory inside the message queue
1416 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1418 // Construct message in the message queue memory; note that delete should not be called on the return value
1419 new (slot) LocalType( &manager, &UpdateManager::SetDepthIndices, nodeDepths );
1422 inline void AddResetterMessage( UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter )
1424 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyResetterBase> > LocalType;
1426 // Reserve some memory inside the message queue
1427 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1429 // Construct message in the message queue memory; note that delete should not be called on the return value
1430 new (slot) LocalType( &manager, &UpdateManager::AddPropertyResetter, resetter );
1433 inline void AddFrameCallbackMessage( UpdateManager& manager, OwnerPointer< FrameCallback >& frameCallback, const Node& rootNode )
1435 typedef MessageValue2< UpdateManager, OwnerPointer< FrameCallback >, const Node* > LocalType;
1437 // Reserve some memory inside the message queue
1438 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1440 // Construct message in the message queue memory; note that delete should not be called on the return value
1441 new (slot) LocalType( &manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode );
1444 inline void RemoveFrameCallbackMessage( UpdateManager& manager, FrameCallbackInterface& frameCallback )
1446 typedef MessageValue1< UpdateManager, FrameCallbackInterface* > LocalType;
1448 // Reserve some memory inside the message queue
1449 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1451 // Construct message in the message queue memory; note that delete should not be called on the return value
1452 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameCallback, &frameCallback );
1455 } // namespace SceneGraph
1457 } // namespace Internal
1461 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H