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 UpdateManager does not already have an installed root node.
155 * @pre The layer is of derived Node type Layer.
156 * @pre The layer does not have a parent.
157 * @param[in] layer The new root node.
158 * @post The node is owned by UpdateManager.
160 void InstallRoot( OwnerPointer<Layer>& layer );
163 * Add a Node; UpdateManager takes ownership.
164 * @pre The node does not have a parent.
165 * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
166 * @param[in] node The node to add.
168 void AddNode( OwnerPointer<Node>& node );
171 * Connect a Node to the scene-graph.
172 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
173 * @pre The node does not already have a parent.
174 * @param[in] parent The new parent node.
176 void ConnectNode( Node* parent, Node* node );
179 * Disconnect a Node from the scene-graph.
180 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
181 * @pre The node has a parent.
182 * @param[in] node The node to disconnect.
184 void DisconnectNode( Node* node );
187 * Destroy a Node owned by UpdateManager.
188 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
189 * In the following update, the previously queued Nodes may be deleted.
190 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
191 * @param[in] node The node to destroy.
193 void DestroyNode( Node* node );
196 * Add a camera on scene
197 * @param[in] camera The camera to add
199 void AddCamera( OwnerPointer< Camera >& camera );
202 * Remove a camera from scene
203 * @param[in] camera to remove
205 void RemoveCamera( Camera* camera );
208 * Add a newly created object.
209 * @param[in] object The object to add.
210 * @post The object is owned by UpdateManager.
212 void AddObject( OwnerPointer<PropertyOwner>& object );
216 * @param[in] object The object to remove.
218 void RemoveObject( PropertyOwner* object );
221 * Add a newly created render task list.
222 * @param[in] taskList The render task list to add.
223 * @post The render task list is owned by UpdateManager.
225 void AddRenderTaskList( OwnerPointer<RenderTaskList>& taskList );
228 * Remove a render task list.
229 * @param[in] taskList The render task list to remove.
231 void RemoveRenderTaskList( RenderTaskList* taskList );
236 * Add a newly created animation.
237 * @param[in] animation The animation to add.
238 * @post The animation is owned by UpdateManager.
240 void AddAnimation( OwnerPointer< SceneGraph::Animation >& animation );
244 * @param[in] animation The animation to stop.
246 void StopAnimation( Animation* animation );
249 * Remove an animation.
250 * @param[in] animation The animation to remove.
252 void RemoveAnimation( Animation* animation );
255 * Query whether any animations are currently running.
256 * @return True if any animations are running.
258 bool IsAnimationRunning() const;
261 * Add a property resetter. UpdateManager takes ownership of the object.
262 * It will be killed by UpdateManager when the associated animator or
263 * constraint has finished; or the property owner of the property is destroyed.
265 void AddPropertyResetter( OwnerPointer<PropertyResetterBase>& propertyResetter );
267 // Property Notification
270 * Add a newly created property notification
271 * @param[in] propertyNotification The notification to add
272 * @post The propertyNotification is owned by UpdateManager.
274 void AddPropertyNotification( OwnerPointer< PropertyNotification >& propertyNotification );
277 * Remove a property notification
278 * @param[in] propertyNotification The notification to remove
280 void RemovePropertyNotification( PropertyNotification* propertyNotification );
283 * Set Notify state for PropertyNotification
284 * @param[in] propertyNotification The notification to remove
285 * @param[in] notifyMode The notification mode.
287 void PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode );
292 * Add a newly created shader.
293 * @param[in] shader The shader to add.
294 * @post The shader is owned by the UpdateManager.
296 void AddShader( OwnerPointer< Shader >& shader );
300 * @pre The shader has been added to the UpdateManager.
301 * @param[in] shader The shader to remove.
302 * @post The shader is destroyed.
304 void RemoveShader( Shader* shader );
307 * Set the shader program for a Shader object
308 * @param[in] shader The shader to modify
309 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
310 * @param[in] modifiesGeometry True if the vertex shader modifies geometry
312 void SetShaderProgram( Shader* shader, Internal::ShaderDataPtr shaderData, bool modifiesGeometry );
315 * @brief Accept compiled shaders passed back on render thread for saving.
316 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
318 virtual void SaveBinary( Internal::ShaderDataPtr shaderData );
321 * @brief Set the destination for compiled shader binaries to be passed on to.
322 * The dispatcher passed in will be called from the update thread.
323 * @param[in] upstream A sink for ShaderDatas to be passed into.
325 void SetShaderSaver( ShaderSaver& upstream );
330 * Add a new renderer to scene
331 * @param renderer to add
333 void AddRenderer( OwnerPointer< Renderer >& renderer );
336 * Add a renderer from scene
337 * @param renderer to remove
339 void RemoveRenderer( Renderer* renderer );
344 * Set the pan gesture processor.
345 * Pan Gesture processor lives for the lifetime of UpdateManager
346 * @param[in] gesture The gesture processor.
347 * @post The gestureProcessor is owned by the UpdateManager.
349 void SetPanGestureProcessor( PanGesture* gestureProcessor );
354 * Add a newly created TextureSet.
355 * @param[in] textureSet The texture set to add.
356 * @post The TextureSet is owned by the UpdateManager.
358 void AddTextureSet( OwnerPointer< TextureSet >& textureSet );
361 * Remove a TextureSet.
362 * @pre The TextureSet has been added to the UpdateManager.
363 * @param[in] textureSet The TextureSet to remove.
364 * @post The TextureSet is destroyed.
366 void RemoveTextureSet( TextureSet* textureSet );
371 * Get the scene graph side list of RenderTasks.
372 * @param[in] systemLevel True if using the system-level overlay.
373 * @return The list of render tasks
375 RenderTaskList* GetRenderTaskList( bool systemLevel );
377 // Message queue handling
380 * Reserve space for another message in the queue; this must then be initialized by the caller.
381 * The message will be read from the update-thread after the next FlushMessages is called.
382 * @post Calling this method may invalidate any previously returned slots.
383 * @param[in] size The message size with respect to the size of type "char".
384 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
385 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
386 * @return A pointer to the first char allocated for the message.
388 uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene = true );
391 * @return the current event-buffer index.
393 BufferIndex GetEventBufferIndex() const
395 // inlined as its called often from event thread
396 return mSceneGraphBuffers.GetEventBufferIndex();
400 * Called by the event-thread to signal that FlushQueue will be called
401 * e.g. when it has finished event processing.
403 void EventProcessingStarted();
406 * Flush the set of messages, which were previously stored with QueueMessage().
407 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
409 * @return True if there are messages to process.
414 * Add a new sampler to RenderManager
415 * @param[in] sampler The sampler to add
416 * @post Sends a message to RenderManager to add the sampler.
417 * The sampler will be owned by RenderManager
419 void AddSampler( OwnerPointer< Render::Sampler >& sampler );
422 * Removes an existing sampler from RenderManager
423 * @param[in] sampler The sampler to remove
424 * @post The sampler will be destroyed in the render thread
426 void RemoveSampler( Render::Sampler* sampler );
429 * Sets the filter modes for an existing sampler
430 * @param[in] sampler The sampler
431 * @param[in] minFilterMode The filter to use under minification
432 * @param[in] magFilterMode The filter to use under magnification
434 void SetFilterMode( Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode );
437 * Sets the wrap mode for an existing sampler
438 * @param[in] sampler The sampler
439 * @param[in] rWrapMode Wrapping mode in z direction
440 * @param[in] sWrapMode Wrapping mode in x direction
441 * @param[in] tWrapMode Wrapping mode in y direction
443 void SetWrapMode( Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode );
446 * Add a new property buffer to RenderManager
447 * @param[in] propertryBuffer The property buffer to add
448 * @post Sends a message to RenderManager to add the property buffer.
449 * The property buffer will be owned by RenderManager
451 void AddPropertyBuffer( OwnerPointer< Render::PropertyBuffer >& propertryBuffer );
454 * Removes an existing PropertyBuffer from RenderManager
455 * @param[in] propertryBuffer The property buffer to remove
456 * @post The property buffer will be destroyed in the render thread
458 void RemovePropertyBuffer( Render::PropertyBuffer* propertryBuffer );
461 * Sets the format of an existing property buffer
462 * @param[in] propertyBuffer The property buffer.
463 * @param[in] format The new format of the buffer
464 * @post Sends a message to RenderManager to set the new format to the property buffer.
466 void SetPropertyBufferFormat( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format );
469 * Sets the data of an existing property buffer
470 * @param[in] propertyBuffer The property buffer.
471 * @param[in] data The new data of the buffer
472 * @param[in] size The new size of the buffer
473 * @post Sends a message to RenderManager to set the new data to the property buffer.
475 void SetPropertyBufferData( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size );
478 * Adds a geometry to the RenderManager
479 * @param[in] geometry The geometry to add
480 * @post Sends a message to RenderManager to add the Geometry
481 * The geometry will be owned by RenderManager
483 void AddGeometry( OwnerPointer< Render::Geometry >& geometry );
486 * Removes an existing Geometry from RenderManager
487 * @param[in] geometry The geometry to remove
488 * @post The geometry will be destroyed in the render thread
490 void RemoveGeometry( Render::Geometry* geometry );
493 * Sets the geometry type of an existing Geometry
494 * @param[in] geometry The geometry
495 * @param[in] geometryType The type of the geometry
497 void SetGeometryType( Render::Geometry* geometry, uint32_t geometryType );
500 * Sets the index buffer to be used by a geometry
501 * @param[in] geometry The geometry
502 * @param[in] indices A vector containing the indices for the geometry
504 void SetIndexBuffer( Render::Geometry* geometry, Dali::Vector<uint16_t>& indices );
507 * Adds a vertex buffer to a geometry
508 * @param[in] geometry The geometry
509 * @param[in] propertyBuffer The property buffer
511 void AttachVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
514 * Removes a vertex buffer from a geometry
515 * @param[in] geometry The geometry
516 * @param[in] propertyBuffer The property buffer
518 void RemoveVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
521 * Adds a texture to the render manager
522 * @param[in] texture The texture to add
523 * The texture will be owned by RenderManager
525 void AddTexture( OwnerPointer< Render::Texture >& texture );
528 * Removes a texture from the render manager
529 * @param[in] texture The texture to remove
530 * @post The texture will be destroyed in the render thread
532 void RemoveTexture( Render::Texture* texture );
535 * Uploads data to a texture owned by the RenderManager
536 * @param[in] texture The texture
537 * @param[in] pixelData The pixel data object
538 * @param[in] params The parameters for the upload
540 void UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params );
543 * Generates mipmaps for a texture owned by the RenderManager
544 * @param[in] texture The texture
546 void GenerateMipmaps( Render::Texture* texture );
549 * Adds a framebuffer to the render manager
550 * @param[in] frameBuffer The framebuffer to add
551 * The framebuffer will be owned by RenderManager
553 void AddFrameBuffer( Render::FrameBuffer* frameBuffer );
556 * Removes a FrameBuffer from the render manager
557 * @param[in] frameBuffer The FrameBuffer to remove
558 * @post The FrameBuffer will be destroyed in the render thread
560 void RemoveFrameBuffer( Render::FrameBuffer* frameBuffer );
563 * Attach a texture as color output to an existing FrameBuffer
564 * @param[in] frameBuffer The FrameBuffer
565 * @param[in] texture The texture that will be used as output when rendering
566 * @param[in] mipmapLevel The mipmap of the texture to be attached
567 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
569 void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face );
574 * Performs an Update traversal on the scene-graph.
575 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
576 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
577 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
578 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
579 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
580 * @return True if further updates are required e.g. during animations.
582 uint32_t Update( float elapsedSeconds,
583 uint32_t lastVSyncTimeMilliseconds,
584 uint32_t nextVSyncTimeMilliseconds,
585 bool renderToFboEnabled,
586 bool isRenderingToFbo );
589 * Set the background color i.e. the glClear color used at the beginning of each frame.
590 * @param[in] color The new background color.
592 void SetBackgroundColor(const Vector4& color);
595 * Set the default surface rect.
596 * @param[in] rect The rect value representing the surface.
598 void SetDefaultSurfaceRect( const Rect<int>& rect );
601 * @copydoc Dali::Stage::KeepRendering()
603 void KeepRendering( float durationSeconds );
606 * @copydoc Dali::DevelStage::SetRenderingBehavior()
608 void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
611 * Sets the depths of all layers.
612 * @param layers The layers in depth order.
613 * @param[in] rootLayer The root layer of the sorted layers.
615 void SetLayerDepths( const std::vector< Layer* >& layers, const Layer* rootLayer );
618 * Set the depth indices of all nodes (in LayerUI's)
619 * @param[in] nodeDepths A vector of nodes and associated depth indices
621 void SetDepthIndices( OwnerPointer< NodeDepths >& nodeDepths );
624 * Query wheter the default surface rect is changed or not.
625 * @return true if the default surface rect is changed.
627 bool IsDefaultSurfaceRectChanged();
630 * Adds an implementation of the FrameCallbackInterface.
631 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
632 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
634 void AddFrameCallback( OwnerPointer< FrameCallback >& frameCallback, const Node* rootNode );
637 * Removes the specified implementation of FrameCallbackInterface.
638 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
640 void RemoveFrameCallback( FrameCallbackInterface* frameCallback );
645 UpdateManager(const UpdateManager&);
648 UpdateManager& operator=(const UpdateManager& rhs);
651 * Helper to check whether the update-thread should keep going.
652 * @param[in] elapsedSeconds The time in seconds since the previous update.
653 * @return True if the update-thread should keep going.
655 uint32_t KeepUpdatingCheck( float elapsedSeconds ) const;
658 * Helper to reset all Node properties
659 * @param[in] bufferIndex to use
661 void ResetProperties( BufferIndex bufferIndex );
664 * Perform gesture updates.
665 * @param[in] bufferIndex to use
666 * @param[in] lastVSyncTime The last VSync time in milliseconds.
667 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
668 * @return true, if any properties were updated.
670 bool ProcessGestures( BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds );
673 * Perform animation updates
674 * @param[in] bufferIndex to use
675 * @param[in] elapsedSeconds time since last frame
677 void Animate( BufferIndex bufferIndex, float elapsedSeconds );
680 * Applies constraints to CustomObjects
681 * @param[in] bufferIndex to use
683 void ConstrainCustomObjects( BufferIndex bufferIndex );
686 * Applies constraints to RenderTasks
687 * @param[in] bufferIndex to use
689 void ConstrainRenderTasks( BufferIndex bufferIndex );
692 * Applies constraints to Shaders
693 * @param[in] bufferIndex to use
695 void ConstrainShaders( BufferIndex bufferIndex );
698 * Perform property notification updates
699 * @param[in] bufferIndex to use
701 void ProcessPropertyNotifications( BufferIndex bufferIndex );
704 * Pass shader binaries queued here on to event thread.
706 void ForwardCompiledShadersToEventThread();
709 * Update node shaders, opacity, geometry etc.
710 * @param[in] bufferIndex to use
712 void UpdateNodes( BufferIndex bufferIndex );
716 * @param[in] bufferIndex to use
718 void UpdateRenderers( BufferIndex bufferIndex );
722 // needs to be direct member so that getter for event buffer can be inlined
723 SceneGraphBuffers mSceneGraphBuffers;
730 // Messages for UpdateManager
732 inline void InstallRootMessage( UpdateManager& manager, OwnerPointer<Layer>& root )
734 // Message has ownership of Layer while in transit from event -> update
735 typedef MessageValue1< UpdateManager, OwnerPointer<Layer> > LocalType;
737 // Reserve some memory inside the message queue
738 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
740 // Construct message in the message queue memory; note that delete should not be called on the return value
741 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, root );
744 inline void AddNodeMessage( UpdateManager& manager, OwnerPointer<Node>& node )
746 // Message has ownership of Node while in transit from event -> update
747 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
749 // Reserve some memory inside the message queue
750 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
752 // Construct message in the message queue memory; note that delete should not be called on the return value
753 new (slot) LocalType( &manager, &UpdateManager::AddNode, node );
756 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild )
758 // Update thread can edit the object
759 Node& parent = const_cast< Node& >( constParent );
760 Node& child = const_cast< Node& >( constChild );
762 typedef MessageValue2< UpdateManager, Node*, Node* > LocalType;
764 // Reserve some memory inside the message queue
765 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
767 // Construct message in the message queue memory; note that delete should not be called on the return value
768 new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child );
771 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
773 // Scene graph thread can modify this object.
774 Node& node = const_cast< Node& >( constNode );
776 typedef MessageValue1< UpdateManager, Node* > LocalType;
778 // Reserve some memory inside the message queue
779 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
781 // Construct message in the message queue memory; note that delete should not be called on the return value
782 new (slot) LocalType( &manager, &UpdateManager::DisconnectNode, &node );
785 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
787 // Scene graph thread can destroy this object.
788 Node& node = const_cast< Node& >( constNode );
790 typedef MessageValue1< UpdateManager, 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::DestroyNode, &node );
799 inline void AddCameraMessage( UpdateManager& manager, OwnerPointer< Camera >& camera )
801 // Message has ownership of Camera while in transit from event -> update
802 typedef MessageValue1< UpdateManager, OwnerPointer< Camera > > LocalType;
804 // Reserve some memory inside the message queue
805 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
807 // Construct message in the message queue memory; note that delete should not be called on the return value
808 new (slot) LocalType( &manager, &UpdateManager::AddCamera, camera );
811 inline void RemoveCameraMessage( UpdateManager& manager, const Camera* camera )
813 typedef MessageValue1< UpdateManager, Camera* > LocalType;
815 // Reserve some memory inside the message queue
816 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
818 // Construct message in the message queue memory; note that delete should not be called on the return value
819 new (slot) LocalType( &manager, &UpdateManager::RemoveCamera, const_cast<Camera*>( camera ) );
822 inline void AddObjectMessage( UpdateManager& manager, OwnerPointer<PropertyOwner>& object )
824 // Message has ownership of object while in transit from event -> update
825 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
827 // Reserve some memory inside the message queue
828 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
830 // Construct message in the message queue memory; note that delete should not be called on the return value
831 new (slot) LocalType( &manager, &UpdateManager::AddObject, object );
834 inline void RemoveObjectMessage( UpdateManager& manager, const PropertyOwner* object )
836 typedef MessageValue1< UpdateManager, PropertyOwner* > LocalType;
838 // Reserve some memory inside the message queue
839 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
841 // Construct message in the message queue memory; note that delete should not be called on the return value
842 new (slot) LocalType( &manager, &UpdateManager::RemoveObject, const_cast<PropertyOwner*>( object ) );
845 inline void AddAnimationMessage( UpdateManager& manager, OwnerPointer< SceneGraph::Animation >& animation )
847 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Animation > > LocalType;
849 // Reserve some memory inside the message queue
850 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
852 // Construct message in the message queue memory; note that delete should not be called on the return value
853 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
856 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
858 // The scene-graph thread owns this object so it can safely edit it.
859 Animation& animation = const_cast< Animation& >( constAnimation );
861 typedef MessageValue1< UpdateManager, Animation* > LocalType;
863 // Reserve some memory inside the message queue
864 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
866 // Construct message in the message queue memory; note that delete should not be called on the return value
867 new (slot) LocalType( &manager, &UpdateManager::StopAnimation, &animation );
870 inline void RemoveAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
872 // The scene-graph thread owns this object so it can safely edit it.
873 Animation& animation = const_cast< Animation& >( constAnimation );
875 typedef MessageValue1< UpdateManager, 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::RemoveAnimation, &animation );
884 inline void AddRenderTaskListMessage( UpdateManager& manager, OwnerPointer< SceneGraph::RenderTaskList >& taskList )
886 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::RenderTaskList > > LocalType;
888 // Reserve some memory inside the message queue
889 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
891 // Construct message in the message queue memory; note that delete should not be called on the return value
892 new (slot) LocalType( &manager, &UpdateManager::AddRenderTaskList, taskList );
895 inline void RemoveRenderTaskListMessage( UpdateManager& manager, const RenderTaskList& constTaskList )
897 // The scene-graph thread owns this object so it can safely edit it.
898 RenderTaskList& taskList = const_cast< RenderTaskList& >( constTaskList );
900 typedef MessageValue1< UpdateManager, RenderTaskList* > LocalType;
902 // Reserve some memory inside the message queue
903 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
905 // Construct message in the message queue memory; note that delete should not be called on the return value
906 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderTaskList, &taskList );
909 inline void AddPropertyNotificationMessage( UpdateManager& manager, OwnerPointer< PropertyNotification >& propertyNotification )
911 // Message has ownership of PropertyNotification while in transit from event -> update
912 typedef MessageValue1< UpdateManager, OwnerPointer< PropertyNotification > > LocalType;
914 // Reserve some memory inside the message queue
915 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
917 // Construct message in the message queue memory; note that delete should not be called on the return value
918 new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
921 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
923 // The scene-graph thread owns this object so it can safely edit it.
924 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
926 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
928 // Reserve some memory inside the message queue
929 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
931 // Construct message in the message queue memory; note that delete should not be called on the return value
932 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyNotification, &propertyNotification );
935 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
936 const PropertyNotification* constPropertyNotification,
937 PropertyNotification::NotifyMode notifyMode )
939 // The scene-graph thread owns this object so it can safely edit it.
940 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
942 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > 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::PropertyNotificationSetNotify, propertyNotification, notifyMode );
951 // The render thread can safely change the Shader
952 inline void AddShaderMessage( UpdateManager& manager, OwnerPointer< Shader >& shader )
954 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > 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::AddShader, shader );
963 // The render thread can safely change the Shader
964 inline void RemoveShaderMessage( UpdateManager& manager, const Shader* shader )
966 typedef MessageValue1< UpdateManager, Shader* > LocalType;
968 // Reserve some memory inside the message queue
969 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
971 // Construct message in the message queue memory; note that delete should not be called on the return value
972 new (slot) LocalType( &manager, &UpdateManager::RemoveShader, const_cast<Shader*>( shader ) );
975 inline void SetShaderProgramMessage( UpdateManager& manager,
976 const Shader& shader,
977 Internal::ShaderDataPtr shaderData,
978 bool modifiesGeometry )
980 typedef MessageValue3< UpdateManager, Shader*, Internal::ShaderDataPtr, bool > LocalType;
982 // Reserve some memory inside the message queue
983 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
985 // Construct message in the message queue memory; note that delete should not be called on the return value
986 new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, const_cast<Shader*>( &shader ), shaderData, modifiesGeometry );
989 inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
991 typedef MessageValue1< UpdateManager, Vector4 > LocalType;
993 // Reserve some memory inside the message queue
994 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
996 // Construct message in the message queue memory; note that delete should not be called on the return value
997 new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
1000 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int32_t>& rect )
1002 typedef MessageValue1< UpdateManager, Rect<int32_t> > LocalType;
1004 // Reserve some memory inside the message queue
1005 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1007 // Construct message in the message queue memory; note that delete should not be called on the return value
1008 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
1011 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
1013 typedef MessageValue1< UpdateManager, float > LocalType;
1015 // Reserve some memory inside the message queue
1016 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1018 // Construct message in the message queue memory; note that delete should not be called on the return value
1019 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
1022 inline void SetRenderingBehaviorMessage( UpdateManager& manager, DevelStage::Rendering renderingBehavior )
1024 typedef MessageValue1< UpdateManager, DevelStage::Rendering > LocalType;
1026 // Reserve some memory inside the message queue
1027 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1029 // Construct message in the message queue memory; note that delete should not be called on the return value
1030 new (slot) LocalType( &manager, &UpdateManager::SetRenderingBehavior, renderingBehavior );
1034 * Create a message for setting the depth of a layer
1035 * @param[in] manager The update manager
1036 * @param[in] layers list of layers
1037 * @param[in] rootLayer True if the layers are added via the SystemOverlay API
1039 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, const Layer* rootLayer )
1041 typedef MessageValue2< UpdateManager, std::vector< Layer* >, const Layer* > LocalType;
1043 // Reserve some memory inside the message queue
1044 uint32_t* 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::SetLayerDepths, layers, rootLayer );
1050 inline void AddRendererMessage( UpdateManager& manager, OwnerPointer< Renderer >& object )
1052 typedef MessageValue1< UpdateManager, OwnerPointer< Renderer > > LocalType;
1054 // Reserve some memory inside the message queue
1055 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1056 // Construct message in the message queue memory; note that delete should not be called on the return value
1057 new (slot) LocalType( &manager, &UpdateManager::AddRenderer, object );
1060 inline void RemoveRendererMessage( UpdateManager& manager, const Renderer& object )
1062 typedef MessageValue1< UpdateManager, Renderer* > LocalType;
1064 // Reserve some memory inside the message queue
1065 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1066 // Construct message in the message queue memory; note that delete should not be called on the return value
1067 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderer, const_cast<Renderer*>( &object ) );
1070 // The render thread can safely change the Shader
1071 inline void AddTextureSetMessage( UpdateManager& manager, OwnerPointer< TextureSet >& textureSet )
1073 typedef MessageValue1< UpdateManager, OwnerPointer< TextureSet > > LocalType;
1075 // Reserve some memory inside the message queue
1076 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1078 // Construct message in the message queue memory; note that delete should not be called on the return value
1079 new (slot) LocalType( &manager, &UpdateManager::AddTextureSet, textureSet );
1082 // The render thread can safely change the Shader
1083 inline void RemoveTextureSetMessage( UpdateManager& manager, TextureSet& textureSet )
1085 typedef MessageValue1< UpdateManager, TextureSet* > LocalType;
1087 // Reserve some memory inside the message queue
1088 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1090 // Construct message in the message queue memory; note that delete should not be called on the return value
1091 new (slot) LocalType( &manager, &UpdateManager::RemoveTextureSet, &textureSet );
1094 inline void AddSamplerMessage( UpdateManager& manager, OwnerPointer< Render::Sampler >& sampler )
1096 // Message has ownership of Sampler while in transit from event -> update
1097 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Sampler > > LocalType;
1099 // Reserve some memory inside the message queue
1100 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1102 // Construct message in the message queue memory; note that delete should not be called on the return value
1103 new (slot) LocalType( &manager, &UpdateManager::AddSampler, sampler );
1106 inline void RemoveSamplerMessage( UpdateManager& manager, Render::Sampler& sampler )
1108 typedef MessageValue1< UpdateManager, Render::Sampler* > LocalType;
1110 // Reserve some memory inside the message queue
1111 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1113 // Construct message in the message queue memory; note that delete should not be called on the return value
1114 new (slot) LocalType( &manager, &UpdateManager::RemoveSampler, &sampler );
1117 inline void SetFilterModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode )
1119 typedef MessageValue3< UpdateManager, Render::Sampler*, uint32_t, uint32_t > LocalType;
1121 // Reserve some memory inside the message queue
1122 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1124 // Construct message in the message queue memory; note that delete should not be called on the return value
1125 new (slot) LocalType( &manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode );
1128 inline void SetWrapModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode )
1130 typedef MessageValue4< UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t > LocalType;
1132 // Reserve some memory inside the message queue
1133 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1135 // Construct message in the message queue memory; note that delete should not be called on the return value
1136 new (slot) LocalType( &manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode );
1139 inline void AddPropertyBuffer( UpdateManager& manager, OwnerPointer< Render::PropertyBuffer >& propertyBuffer )
1141 // Message has ownership of propertyBuffer while in transit from event -> update
1142 typedef MessageValue1< UpdateManager, OwnerPointer< Render::PropertyBuffer > > LocalType;
1144 // Reserve some memory inside the message queue
1145 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1147 // Construct message in the message queue memory; note that delete should not be called on the return value
1148 new (slot) LocalType( &manager, &UpdateManager::AddPropertyBuffer, propertyBuffer );
1151 inline void RemovePropertyBuffer( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer )
1153 typedef MessageValue1< UpdateManager, Render::PropertyBuffer* > LocalType;
1155 // Reserve some memory inside the message queue
1156 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1158 // Construct message in the message queue memory; note that delete should not be called on the return value
1159 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyBuffer, &propertyBuffer );
1162 inline void SetPropertyBufferFormat( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format )
1164 // Message has ownership of PropertyBuffer::Format while in transit from event -> update
1165 typedef MessageValue2< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Render::PropertyBuffer::Format> > LocalType;
1167 // Reserve some memory inside the message queue
1168 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1170 // Construct message in the message queue memory; note that delete should not be called on the return value
1171 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferFormat, &propertyBuffer, format );
1174 inline void SetPropertyBufferData( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
1176 // Message has ownership of PropertyBuffer data while in transit from event -> update
1177 typedef MessageValue3< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Vector<uint8_t> >, uint32_t > LocalType;
1179 // Reserve some memory inside the message queue
1180 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1182 // Construct message in the message queue memory; note that delete should not be called on the return value
1183 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferData, &propertyBuffer, data, size );
1186 inline void AddGeometry( UpdateManager& manager, OwnerPointer< Render::Geometry >& geometry )
1188 // Message has ownership of Geometry while in transit from event -> update
1189 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Geometry > > LocalType;
1191 // Reserve some memory inside the message queue
1192 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1194 // Construct message in the message queue memory; note that delete should not be called on the return value
1195 new (slot) LocalType( &manager, &UpdateManager::AddGeometry, geometry );
1198 inline void RemoveGeometry( UpdateManager& manager, Render::Geometry& geometry )
1200 typedef MessageValue1< UpdateManager, Render::Geometry* > LocalType;
1202 // Reserve some memory inside the message queue
1203 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1205 // Construct message in the message queue memory; note that delete should not be called on the return value
1206 new (slot) LocalType( &manager, &UpdateManager::RemoveGeometry, &geometry );
1209 inline void AttachVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1211 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1213 // Reserve some memory inside the message queue
1214 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1216 // Construct message in the message queue memory; note that delete should not be called on the return value
1217 new (slot) LocalType( &manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1220 inline void RemoveVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1222 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1224 // Reserve some memory inside the message queue
1225 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1227 // Construct message in the message queue memory; note that delete should not be called on the return value
1228 new (slot) LocalType( &manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1231 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1232 template< typename T >
1233 class IndexBufferMessage : public MessageBase
1238 * Constructor which does a Vector::Swap()
1240 IndexBufferMessage( T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices )
1242 mManager( manager ),
1243 mRenderGeometry( geometry )
1245 mIndices.Swap( indices );
1249 * Virtual destructor
1251 virtual ~IndexBufferMessage()
1256 * @copydoc MessageBase::Process
1258 virtual void Process( BufferIndex /*bufferIndex*/ )
1260 DALI_ASSERT_DEBUG( mManager && "Message does not have an object" );
1261 mManager->SetIndexBuffer( mRenderGeometry, mIndices );
1267 Render::Geometry* mRenderGeometry;
1268 Dali::Vector<uint16_t> mIndices;
1271 inline void SetIndexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices )
1273 typedef IndexBufferMessage< UpdateManager > LocalType;
1275 // Reserve some memory inside the message queue
1276 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1278 // Construct message in the message queue memory; note that delete should not be called on the return value
1279 new (slot) LocalType( &manager, &geometry, indices );
1282 inline void SetGeometryTypeMessage( UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType )
1284 typedef MessageValue2< UpdateManager, Render::Geometry*, uint32_t > LocalType;
1286 // Reserve some memory inside the message queue
1287 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1289 // Construct message in the message queue memory; note that delete should not be called on the return value
1290 new (slot) LocalType( &manager, &UpdateManager::SetGeometryType, &geometry, geometryType );
1293 inline void AddTexture( UpdateManager& manager, OwnerPointer< Render::Texture >& texture )
1295 // Message has ownership of Texture while in transit from event -> update
1296 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Texture > > LocalType;
1298 // Reserve some memory inside the message queue
1299 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1301 // Construct message in the message queue memory; note that delete should not be called on the return value
1302 new (slot) LocalType( &manager, &UpdateManager::AddTexture, texture );
1305 inline void RemoveTexture( UpdateManager& manager, Render::Texture& texture )
1307 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1309 // Reserve some memory inside the message queue
1310 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1312 // Construct message in the message queue memory; note that delete should not be called on the return value
1313 new (slot) LocalType( &manager, &UpdateManager::RemoveTexture, &texture );
1316 inline void UploadTextureMessage( UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params )
1318 typedef MessageValue3< UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams > LocalType;
1320 // Reserve some memory inside the message queue
1321 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1323 // Construct message in the message queue memory; note that delete should not be called on the return value
1324 new (slot) LocalType( &manager, &UpdateManager::UploadTexture, &texture, pixelData, params );
1327 inline void GenerateMipmapsMessage( UpdateManager& manager, Render::Texture& texture )
1329 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1331 // Reserve some memory inside the message queue
1332 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1334 // Construct message in the message queue memory; note that delete should not be called on the return value
1335 new (slot) LocalType( &manager, &UpdateManager::GenerateMipmaps, &texture );
1339 inline void AddFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )
1341 typedef MessageValue1< UpdateManager, Render::FrameBuffer* > LocalType;
1343 // Reserve some memory inside the message queue
1344 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1346 // Construct message in the message queue memory; note that delete should not be called on the return value
1347 new (slot) LocalType( &manager, &UpdateManager::AddFrameBuffer, &frameBuffer );
1350 inline void RemoveFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )
1352 typedef MessageValue1< UpdateManager, Render::FrameBuffer* > LocalType;
1354 // Reserve some memory inside the message queue
1355 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1357 // Construct message in the message queue memory; note that delete should not be called on the return value
1358 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer );
1361 inline void AttachColorTextureToFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer )
1363 typedef MessageValue4< UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t > LocalType;
1365 // Reserve some memory inside the message queue
1366 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1368 // Construct message in the message queue memory; note that delete should not be called on the return value
1369 new (slot) LocalType( &manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer );
1372 inline void SetDepthIndicesMessage( UpdateManager& manager, OwnerPointer< NodeDepths >& nodeDepths )
1374 typedef MessageValue1< UpdateManager, OwnerPointer< NodeDepths > > LocalType;
1376 // Reserve some memory inside the message queue
1377 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1379 // Construct message in the message queue memory; note that delete should not be called on the return value
1380 new (slot) LocalType( &manager, &UpdateManager::SetDepthIndices, nodeDepths );
1383 inline void AddResetterMessage( UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter )
1385 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyResetterBase> > LocalType;
1387 // Reserve some memory inside the message queue
1388 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1390 // Construct message in the message queue memory; note that delete should not be called on the return value
1391 new (slot) LocalType( &manager, &UpdateManager::AddPropertyResetter, resetter );
1394 inline void AddFrameCallbackMessage( UpdateManager& manager, OwnerPointer< FrameCallback >& frameCallback, const Node& rootNode )
1396 typedef MessageValue2< UpdateManager, OwnerPointer< FrameCallback >, const Node* > LocalType;
1398 // Reserve some memory inside the message queue
1399 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1401 // Construct message in the message queue memory; note that delete should not be called on the return value
1402 new (slot) LocalType( &manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode );
1405 inline void RemoveFrameCallbackMessage( UpdateManager& manager, FrameCallbackInterface& frameCallback )
1407 typedef MessageValue1< UpdateManager, FrameCallbackInterface* > LocalType;
1409 // Reserve some memory inside the message queue
1410 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1412 // Construct message in the message queue memory; note that delete should not be called on the return value
1413 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameCallback, &frameCallback );
1416 } // namespace SceneGraph
1418 } // namespace Internal
1422 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H