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 default surface rect.
598 * @param[in] rect The rect value representing the surface.
600 void SetDefaultSurfaceRect( const Rect<int>& rect );
603 * @copydoc Dali::Stage::KeepRendering()
605 void KeepRendering( float durationSeconds );
608 * @copydoc Dali::DevelStage::SetRenderingBehavior()
610 void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
613 * Sets the depths of all layers.
614 * @param layers The layers in depth order.
615 * @param[in] rootLayer The root layer of the sorted layers.
617 void SetLayerDepths( const std::vector< Layer* >& layers, const Layer* rootLayer );
620 * Set the depth indices of all nodes (in LayerUI's)
621 * @param[in] nodeDepths A vector of nodes and associated depth indices
623 void SetDepthIndices( OwnerPointer< NodeDepths >& nodeDepths );
626 * Query wheter the default surface rect is changed or not.
627 * @return true if the default surface rect is changed.
629 bool IsDefaultSurfaceRectChanged();
632 * Adds an implementation of the FrameCallbackInterface.
633 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
634 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
636 void AddFrameCallback( OwnerPointer< FrameCallback >& frameCallback, const Node* rootNode );
639 * Removes the specified implementation of FrameCallbackInterface.
640 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
642 void RemoveFrameCallback( FrameCallbackInterface* frameCallback );
647 UpdateManager(const UpdateManager&);
650 UpdateManager& operator=(const UpdateManager& rhs);
653 * Helper to check whether the update-thread should keep going.
654 * @param[in] elapsedSeconds The time in seconds since the previous update.
655 * @return True if the update-thread should keep going.
657 uint32_t KeepUpdatingCheck( float elapsedSeconds ) const;
660 * Helper to reset all Node properties
661 * @param[in] bufferIndex to use
663 void ResetProperties( BufferIndex bufferIndex );
666 * Perform gesture updates.
667 * @param[in] bufferIndex to use
668 * @param[in] lastVSyncTime The last VSync time in milliseconds.
669 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
670 * @return true, if any properties were updated.
672 bool ProcessGestures( BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds );
675 * Perform animation updates
676 * @param[in] bufferIndex to use
677 * @param[in] elapsedSeconds time since last frame
679 void Animate( BufferIndex bufferIndex, float elapsedSeconds );
682 * Applies constraints to CustomObjects
683 * @param[in] bufferIndex to use
685 void ConstrainCustomObjects( BufferIndex bufferIndex );
688 * Applies constraints to RenderTasks
689 * @param[in] bufferIndex to use
691 void ConstrainRenderTasks( BufferIndex bufferIndex );
694 * Applies constraints to Shaders
695 * @param[in] bufferIndex to use
697 void ConstrainShaders( BufferIndex bufferIndex );
700 * Perform property notification updates
701 * @param[in] bufferIndex to use
703 void ProcessPropertyNotifications( BufferIndex bufferIndex );
706 * Pass shader binaries queued here on to event thread.
708 void ForwardCompiledShadersToEventThread();
711 * Update node shaders, opacity, geometry etc.
712 * @param[in] bufferIndex to use
714 void UpdateNodes( BufferIndex bufferIndex );
718 * @param[in] bufferIndex to use
720 void UpdateRenderers( BufferIndex bufferIndex );
724 // needs to be direct member so that getter for event buffer can be inlined
725 SceneGraphBuffers mSceneGraphBuffers;
732 // Messages for UpdateManager
734 inline void InstallRootMessage( UpdateManager& manager, OwnerPointer<Layer>& root )
736 // Message has ownership of Layer while in transit from event -> update
737 typedef MessageValue1< UpdateManager, OwnerPointer<Layer> > LocalType;
739 // Reserve some memory inside the message queue
740 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
742 // Construct message in the message queue memory; note that delete should not be called on the return value
743 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, root );
746 inline void UninstallRootMessage( UpdateManager& manager, const Layer* constRoot )
748 // Scene graph thread can destroy this object.
749 Layer* root = const_cast< Layer* >( constRoot );
751 typedef MessageValue1< UpdateManager, 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::UninstallRoot, root );
760 inline void AddNodeMessage( UpdateManager& manager, OwnerPointer<Node>& node )
762 // Message has ownership of Node while in transit from event -> update
763 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > 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::AddNode, node );
772 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild )
774 // Update thread can edit the object
775 Node& parent = const_cast< Node& >( constParent );
776 Node& child = const_cast< Node& >( constChild );
778 typedef MessageValue2< UpdateManager, Node*, Node* > LocalType;
780 // Reserve some memory inside the message queue
781 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
783 // Construct message in the message queue memory; note that delete should not be called on the return value
784 new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child );
787 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
789 // Scene graph thread can modify this object.
790 Node& node = const_cast< Node& >( constNode );
792 typedef MessageValue1< UpdateManager, 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::DisconnectNode, &node );
801 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
803 // Scene graph thread can destroy 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::DestroyNode, &node );
815 inline void AddCameraMessage( UpdateManager& manager, OwnerPointer< Camera >& camera )
817 // Message has ownership of Camera while in transit from event -> update
818 typedef MessageValue1< UpdateManager, OwnerPointer< Camera > > 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::AddCamera, camera );
827 inline void RemoveCameraMessage( UpdateManager& manager, const Camera* camera )
829 typedef MessageValue1< UpdateManager, Camera* > LocalType;
831 // Reserve some memory inside the message queue
832 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
834 // Construct message in the message queue memory; note that delete should not be called on the return value
835 new (slot) LocalType( &manager, &UpdateManager::RemoveCamera, const_cast<Camera*>( camera ) );
838 inline void AddObjectMessage( UpdateManager& manager, OwnerPointer<PropertyOwner>& object )
840 // Message has ownership of object while in transit from event -> update
841 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > 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::AddObject, object );
850 inline void RemoveObjectMessage( UpdateManager& manager, const PropertyOwner* object )
852 typedef MessageValue1< UpdateManager, PropertyOwner* > LocalType;
854 // Reserve some memory inside the message queue
855 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
857 // Construct message in the message queue memory; note that delete should not be called on the return value
858 new (slot) LocalType( &manager, &UpdateManager::RemoveObject, const_cast<PropertyOwner*>( object ) );
861 inline void AddAnimationMessage( UpdateManager& manager, OwnerPointer< SceneGraph::Animation >& animation )
863 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Animation > > LocalType;
865 // Reserve some memory inside the message queue
866 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
868 // Construct message in the message queue memory; note that delete should not be called on the return value
869 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
872 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
874 // The scene-graph thread owns this object so it can safely edit it.
875 Animation& animation = const_cast< Animation& >( constAnimation );
877 typedef MessageValue1< UpdateManager, 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::StopAnimation, &animation );
886 inline void RemoveAnimationMessage( 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::RemoveAnimation, &animation );
900 inline void AddRenderTaskListMessage( UpdateManager& manager, OwnerPointer< SceneGraph::RenderTaskList >& taskList )
902 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::RenderTaskList > > LocalType;
904 // Reserve some memory inside the message queue
905 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
907 // Construct message in the message queue memory; note that delete should not be called on the return value
908 new (slot) LocalType( &manager, &UpdateManager::AddRenderTaskList, taskList );
911 inline void RemoveRenderTaskListMessage( UpdateManager& manager, const RenderTaskList& constTaskList )
913 // The scene-graph thread owns this object so it can safely edit it.
914 RenderTaskList& taskList = const_cast< RenderTaskList& >( constTaskList );
916 typedef MessageValue1< UpdateManager, 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::RemoveRenderTaskList, &taskList );
925 inline void AddPropertyNotificationMessage( UpdateManager& manager, OwnerPointer< PropertyNotification >& propertyNotification )
927 // Message has ownership of PropertyNotification while in transit from event -> update
928 typedef MessageValue1< UpdateManager, OwnerPointer< PropertyNotification > > 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::AddPropertyNotification, propertyNotification );
937 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
939 // The scene-graph thread owns this object so it can safely edit it.
940 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
942 typedef MessageValue1< UpdateManager, 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::RemovePropertyNotification, &propertyNotification );
951 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
952 const PropertyNotification* constPropertyNotification,
953 PropertyNotification::NotifyMode notifyMode )
955 // The scene-graph thread owns this object so it can safely edit it.
956 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
958 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
960 // Reserve some memory inside the message queue
961 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
963 // Construct message in the message queue memory; note that delete should not be called on the return value
964 new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
967 // The render thread can safely change the Shader
968 inline void AddShaderMessage( UpdateManager& manager, OwnerPointer< Shader >& shader )
970 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > 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::AddShader, shader );
979 // The render thread can safely change the Shader
980 inline void RemoveShaderMessage( UpdateManager& manager, const Shader* shader )
982 typedef MessageValue1< UpdateManager, 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::RemoveShader, const_cast<Shader*>( shader ) );
991 inline void SetShaderProgramMessage( UpdateManager& manager,
992 const Shader& shader,
993 Internal::ShaderDataPtr shaderData,
994 bool modifiesGeometry )
996 typedef MessageValue3< UpdateManager, Shader*, Internal::ShaderDataPtr, bool > 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::SetShaderProgram, const_cast<Shader*>( &shader ), shaderData, modifiesGeometry );
1005 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int32_t>& rect )
1007 typedef MessageValue1< UpdateManager, Rect<int32_t> > LocalType;
1009 // Reserve some memory inside the message queue
1010 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1012 // Construct message in the message queue memory; note that delete should not be called on the return value
1013 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
1016 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
1018 typedef MessageValue1< UpdateManager, float > LocalType;
1020 // Reserve some memory inside the message queue
1021 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1023 // Construct message in the message queue memory; note that delete should not be called on the return value
1024 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
1027 inline void SetRenderingBehaviorMessage( UpdateManager& manager, DevelStage::Rendering renderingBehavior )
1029 typedef MessageValue1< UpdateManager, DevelStage::Rendering > LocalType;
1031 // Reserve some memory inside the message queue
1032 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1034 // Construct message in the message queue memory; note that delete should not be called on the return value
1035 new (slot) LocalType( &manager, &UpdateManager::SetRenderingBehavior, renderingBehavior );
1039 * Create a message for setting the depth of a layer
1040 * @param[in] manager The update manager
1041 * @param[in] layers list of layers
1042 * @param[in] rootLayer The rool layer
1044 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, const Layer* rootLayer )
1046 typedef MessageValue2< UpdateManager, std::vector< Layer* >, const Layer* > LocalType;
1048 // Reserve some memory inside the message queue
1049 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1051 // Construct message in the message queue memory; note that delete should not be called on the return value
1052 new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, rootLayer );
1055 inline void AddRendererMessage( UpdateManager& manager, OwnerPointer< Renderer >& object )
1057 typedef MessageValue1< UpdateManager, OwnerPointer< Renderer > > LocalType;
1059 // Reserve some memory inside the message queue
1060 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1061 // Construct message in the message queue memory; note that delete should not be called on the return value
1062 new (slot) LocalType( &manager, &UpdateManager::AddRenderer, object );
1065 inline void RemoveRendererMessage( UpdateManager& manager, const Renderer& object )
1067 typedef MessageValue1< UpdateManager, Renderer* > LocalType;
1069 // Reserve some memory inside the message queue
1070 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1071 // Construct message in the message queue memory; note that delete should not be called on the return value
1072 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderer, const_cast<Renderer*>( &object ) );
1075 // The render thread can safely change the Shader
1076 inline void AddTextureSetMessage( UpdateManager& manager, OwnerPointer< TextureSet >& textureSet )
1078 typedef MessageValue1< UpdateManager, OwnerPointer< TextureSet > > LocalType;
1080 // Reserve some memory inside the message queue
1081 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1083 // Construct message in the message queue memory; note that delete should not be called on the return value
1084 new (slot) LocalType( &manager, &UpdateManager::AddTextureSet, textureSet );
1087 // The render thread can safely change the Shader
1088 inline void RemoveTextureSetMessage( UpdateManager& manager, TextureSet& textureSet )
1090 typedef MessageValue1< UpdateManager, TextureSet* > LocalType;
1092 // Reserve some memory inside the message queue
1093 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::RemoveTextureSet, &textureSet );
1099 inline void AddSamplerMessage( UpdateManager& manager, OwnerPointer< Render::Sampler >& sampler )
1101 // Message has ownership of Sampler while in transit from event -> update
1102 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Sampler > > LocalType;
1104 // Reserve some memory inside the message queue
1105 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::AddSampler, sampler );
1111 inline void RemoveSamplerMessage( UpdateManager& manager, Render::Sampler& sampler )
1113 typedef MessageValue1< UpdateManager, Render::Sampler* > LocalType;
1115 // Reserve some memory inside the message queue
1116 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1118 // Construct message in the message queue memory; note that delete should not be called on the return value
1119 new (slot) LocalType( &manager, &UpdateManager::RemoveSampler, &sampler );
1122 inline void SetFilterModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode )
1124 typedef MessageValue3< UpdateManager, Render::Sampler*, uint32_t, uint32_t > 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::SetFilterMode, &sampler, minFilterMode, magFilterMode );
1133 inline void SetWrapModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode )
1135 typedef MessageValue4< UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t > LocalType;
1137 // Reserve some memory inside the message queue
1138 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1140 // Construct message in the message queue memory; note that delete should not be called on the return value
1141 new (slot) LocalType( &manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode );
1144 inline void AddPropertyBuffer( UpdateManager& manager, OwnerPointer< Render::PropertyBuffer >& propertyBuffer )
1146 // Message has ownership of propertyBuffer while in transit from event -> update
1147 typedef MessageValue1< UpdateManager, OwnerPointer< Render::PropertyBuffer > > 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::AddPropertyBuffer, propertyBuffer );
1156 inline void RemovePropertyBuffer( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer )
1158 typedef MessageValue1< UpdateManager, Render::PropertyBuffer* > 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::RemovePropertyBuffer, &propertyBuffer );
1167 inline void SetPropertyBufferFormat( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format )
1169 // Message has ownership of PropertyBuffer::Format while in transit from event -> update
1170 typedef MessageValue2< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Render::PropertyBuffer::Format> > LocalType;
1172 // Reserve some memory inside the message queue
1173 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1175 // Construct message in the message queue memory; note that delete should not be called on the return value
1176 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferFormat, &propertyBuffer, format );
1179 inline void SetPropertyBufferData( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
1181 // Message has ownership of PropertyBuffer data while in transit from event -> update
1182 typedef MessageValue3< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Vector<uint8_t> >, uint32_t > LocalType;
1184 // Reserve some memory inside the message queue
1185 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1187 // Construct message in the message queue memory; note that delete should not be called on the return value
1188 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferData, &propertyBuffer, data, size );
1191 inline void AddGeometry( UpdateManager& manager, OwnerPointer< Render::Geometry >& geometry )
1193 // Message has ownership of Geometry while in transit from event -> update
1194 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Geometry > > 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::AddGeometry, geometry );
1203 inline void RemoveGeometry( UpdateManager& manager, Render::Geometry& geometry )
1205 typedef MessageValue1< UpdateManager, Render::Geometry* > LocalType;
1207 // Reserve some memory inside the message queue
1208 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1210 // Construct message in the message queue memory; note that delete should not be called on the return value
1211 new (slot) LocalType( &manager, &UpdateManager::RemoveGeometry, &geometry );
1214 inline void AttachVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1216 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > 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::AttachVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1225 inline void RemoveVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1227 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1229 // Reserve some memory inside the message queue
1230 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1232 // Construct message in the message queue memory; note that delete should not be called on the return value
1233 new (slot) LocalType( &manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1236 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1237 template< typename T >
1238 class IndexBufferMessage : public MessageBase
1243 * Constructor which does a Vector::Swap()
1245 IndexBufferMessage( T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices )
1247 mManager( manager ),
1248 mRenderGeometry( geometry )
1250 mIndices.Swap( indices );
1254 * Virtual destructor
1256 virtual ~IndexBufferMessage()
1261 * @copydoc MessageBase::Process
1263 virtual void Process( BufferIndex /*bufferIndex*/ )
1265 DALI_ASSERT_DEBUG( mManager && "Message does not have an object" );
1266 mManager->SetIndexBuffer( mRenderGeometry, mIndices );
1272 Render::Geometry* mRenderGeometry;
1273 Dali::Vector<uint16_t> mIndices;
1276 inline void SetIndexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices )
1278 typedef IndexBufferMessage< UpdateManager > LocalType;
1280 // Reserve some memory inside the message queue
1281 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1283 // Construct message in the message queue memory; note that delete should not be called on the return value
1284 new (slot) LocalType( &manager, &geometry, indices );
1287 inline void SetGeometryTypeMessage( UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType )
1289 typedef MessageValue2< UpdateManager, Render::Geometry*, uint32_t > LocalType;
1291 // Reserve some memory inside the message queue
1292 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1294 // Construct message in the message queue memory; note that delete should not be called on the return value
1295 new (slot) LocalType( &manager, &UpdateManager::SetGeometryType, &geometry, geometryType );
1298 inline void AddTexture( UpdateManager& manager, OwnerPointer< Render::Texture >& texture )
1300 // Message has ownership of Texture while in transit from event -> update
1301 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Texture > > LocalType;
1303 // Reserve some memory inside the message queue
1304 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1306 // Construct message in the message queue memory; note that delete should not be called on the return value
1307 new (slot) LocalType( &manager, &UpdateManager::AddTexture, texture );
1310 inline void RemoveTexture( UpdateManager& manager, Render::Texture& texture )
1312 typedef MessageValue1< UpdateManager, Render::Texture* > 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, &UpdateManager::RemoveTexture, &texture );
1321 inline void UploadTextureMessage( UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params )
1323 typedef MessageValue3< UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams > 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::UploadTexture, &texture, pixelData, params );
1332 inline void GenerateMipmapsMessage( UpdateManager& manager, Render::Texture& texture )
1334 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1336 // Reserve some memory inside the message queue
1337 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1339 // Construct message in the message queue memory; note that delete should not be called on the return value
1340 new (slot) LocalType( &manager, &UpdateManager::GenerateMipmaps, &texture );
1344 inline void AddFrameBuffer( UpdateManager& manager, OwnerPointer< Render::FrameBuffer >& frameBuffer )
1346 typedef MessageValue1< UpdateManager, OwnerPointer< Render::FrameBuffer > > 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::AddFrameBuffer, frameBuffer );
1355 inline void RemoveFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )
1357 typedef MessageValue1< UpdateManager, Render::FrameBuffer* > 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::RemoveFrameBuffer, &frameBuffer );
1366 inline void AttachColorTextureToFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer )
1368 typedef MessageValue4< UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t > 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::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer );
1377 inline void SetDepthIndicesMessage( UpdateManager& manager, OwnerPointer< NodeDepths >& nodeDepths )
1379 typedef MessageValue1< UpdateManager, OwnerPointer< NodeDepths > > LocalType;
1381 // Reserve some memory inside the message queue
1382 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1384 // Construct message in the message queue memory; note that delete should not be called on the return value
1385 new (slot) LocalType( &manager, &UpdateManager::SetDepthIndices, nodeDepths );
1388 inline void AddResetterMessage( UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter )
1390 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyResetterBase> > LocalType;
1392 // Reserve some memory inside the message queue
1393 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1395 // Construct message in the message queue memory; note that delete should not be called on the return value
1396 new (slot) LocalType( &manager, &UpdateManager::AddPropertyResetter, resetter );
1399 inline void AddFrameCallbackMessage( UpdateManager& manager, OwnerPointer< FrameCallback >& frameCallback, const Node& rootNode )
1401 typedef MessageValue2< UpdateManager, OwnerPointer< FrameCallback >, const Node* > LocalType;
1403 // Reserve some memory inside the message queue
1404 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1406 // Construct message in the message queue memory; note that delete should not be called on the return value
1407 new (slot) LocalType( &manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode );
1410 inline void RemoveFrameCallbackMessage( UpdateManager& manager, FrameCallbackInterface& frameCallback )
1412 typedef MessageValue1< UpdateManager, FrameCallbackInterface* > LocalType;
1414 // Reserve some memory inside the message queue
1415 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1417 // Construct message in the message queue memory; note that delete should not be called on the return value
1418 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameCallback, &frameCallback );
1421 } // namespace SceneGraph
1423 } // namespace Internal
1427 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H