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/rendering/scene-graph-renderer.h> // for OwnerPointer< Renderer >
38 #include <dali/internal/update/rendering/scene-graph-texture-set.h> // for OwnerPointer< TextureSet >
39 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
40 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
41 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
42 #include <dali/internal/render/shaders/scene-graph-shader.h> // for OwnerPointer< Shader >
43 #include <dali/internal/render/renderers/render-property-buffer.h>
44 #include <dali/internal/event/rendering/texture-impl.h>
49 class FrameCallbackInterface;
53 class GlSyncAbstraction;
54 class RenderController;
56 } // namespace Integration
61 class PropertyNotifier;
62 class NotificationManager;
63 class CompleteNotificationInterface;
71 // value types used by messages
72 template <> struct ParameterType< PropertyNotification::NotifyMode >
73 : public BasicType< PropertyNotification::NotifyMode > {};
82 class RenderTaskProcessor;
88 SceneGraph::Node* node;
90 NodeDepthPair( SceneGraph::Node* node, uint32_t sortedDepth )
92 sortedDepth(sortedDepth)
103 void Add( SceneGraph::Node* node, uint32_t sortedDepth )
105 nodeDepths.push_back( NodeDepthPair( node, sortedDepth ) );
108 std::vector<NodeDepthPair> nodeDepths;
113 * UpdateManager maintains a scene graph i.e. a tree of nodes as well as
114 * other scene graph property owning objects.
115 * It controls the Update traversal, in which nodes are repositioned/animated,
116 * and organizes the the culling and rendering of the scene.
117 * It also maintains the lifecycle of nodes and other property owners that are
118 * disconnected from the scene graph.
120 class UpdateManager : public ShaderSaver
125 * Construct a new UpdateManager.
126 * @param[in] notificationManager This should be notified when animations have finished.
127 * @param[in] animationPlaylist The CompleteNotificationInterface that handles the animations
128 * @param[in] propertyNotifier The PropertyNotifier
129 * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
130 * @param[in] controller After messages are flushed, we request a render from the RenderController.
131 * @param[in] renderManager This is responsible for rendering the results of each "update".
132 * @param[in] renderQueue Used to queue messages for the next render.
133 * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
135 UpdateManager( NotificationManager& notificationManager,
136 CompleteNotificationInterface& animationPlaylist,
137 PropertyNotifier& propertyNotifier,
138 DiscardQueue& discardQueue,
139 Integration::RenderController& controller,
140 RenderManager& renderManager,
141 RenderQueue& renderQueue,
142 RenderTaskProcessor& renderTaskProcessor );
147 virtual ~UpdateManager();
149 // Node connection methods
152 * Installs a new layer as the root node.
153 * @pre The UpdateManager does not already have an installed 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 * Add a Node; UpdateManager takes ownership.
163 * @pre The node does not have a parent.
164 * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
165 * @param[in] node The node to add.
167 void AddNode( OwnerPointer<Node>& node );
170 * Connect a Node to the scene-graph.
171 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
172 * @pre The node does not already have a parent.
173 * @param[in] parent The new parent node.
175 void ConnectNode( Node* parent, Node* node );
178 * Disconnect a Node from the scene-graph.
179 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
180 * @pre The node has a parent.
181 * @param[in] node The node to disconnect.
183 void DisconnectNode( Node* node );
186 * Destroy a Node owned by UpdateManager.
187 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
188 * In the following update, the previously queued Nodes may be deleted.
189 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
190 * @param[in] node The node to destroy.
192 void DestroyNode( Node* node );
195 * Add a camera on scene
196 * @param[in] camera The camera to add
198 void AddCamera( OwnerPointer< Camera >& camera );
201 * Remove a camera from scene
202 * @param[in] camera to remove
204 void RemoveCamera( const Camera* camera );
207 * Add a newly created object.
208 * @param[in] object The object to add.
209 * @post The object is owned by UpdateManager.
211 void AddObject( OwnerPointer<PropertyOwner>& object );
215 * @param[in] object The object to remove.
217 void RemoveObject( PropertyOwner* object );
220 * Add a newly created render task list.
221 * @param[in] taskList The render task list to add.
222 * @post The render task list is owned by UpdateManager.
224 void AddRenderTaskList( OwnerPointer<RenderTaskList>& taskList );
227 * Remove a render task list.
228 * @param[in] taskList The render task list to remove.
230 void RemoveRenderTaskList( RenderTaskList* taskList );
235 * Add a newly created animation.
236 * @param[in] animation The animation to add.
237 * @post The animation is owned by UpdateManager.
239 void AddAnimation( OwnerPointer< SceneGraph::Animation >& animation );
243 * @param[in] animation The animation to stop.
245 void StopAnimation( Animation* animation );
248 * Remove an animation.
249 * @param[in] animation The animation to remove.
251 void RemoveAnimation( Animation* animation );
254 * Query whether any animations are currently running.
255 * @return True if any animations are running.
257 bool IsAnimationRunning() const;
260 * Add a property resetter. UpdateManager takes ownership of the object.
261 * It will be killed by UpdateManager when the associated animator or
262 * constraint has finished; or the property owner of the property is destroyed.
264 void AddPropertyResetter( OwnerPointer<PropertyResetterBase>& propertyResetter );
266 // Property Notification
269 * Add a newly created property notification
270 * @param[in] propertyNotification The notification to add
271 * @post The propertyNotification is owned by UpdateManager.
273 void AddPropertyNotification( OwnerPointer< PropertyNotification >& propertyNotification );
276 * Remove a property notification
277 * @param[in] propertyNotification The notification to remove
279 void RemovePropertyNotification( PropertyNotification* propertyNotification );
282 * Set Notify state for PropertyNotification
283 * @param[in] propertyNotification The notification to remove
284 * @param[in] notifyMode The notification mode.
286 void PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode );
291 * Add a newly created shader.
292 * @param[in] shader The shader to add.
293 * @post The shader is owned by the UpdateManager.
295 void AddShader( OwnerPointer< Shader >& shader );
299 * @pre The shader has been added to the UpdateManager.
300 * @param[in] shader The shader to remove.
301 * @post The shader is destroyed.
303 void RemoveShader( Shader* shader );
306 * Set the shader program for a Shader object
307 * @param[in] shader The shader to modify
308 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
309 * @param[in] modifiesGeometry True if the vertex shader modifies geometry
311 void SetShaderProgram( Shader* shader, Internal::ShaderDataPtr shaderData, bool modifiesGeometry );
314 * @brief Accept compiled shaders passed back on render thread for saving.
315 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
317 virtual void SaveBinary( Internal::ShaderDataPtr shaderData );
320 * @brief Set the destination for compiled shader binaries to be passed on to.
321 * The dispatcher passed in will be called from the update thread.
322 * @param[in] upstream A sink for ShaderDatas to be passed into.
324 void SetShaderSaver( ShaderSaver& upstream );
329 * Add a new renderer to scene
330 * @param renderer to add
332 void AddRenderer( OwnerPointer< Renderer >& renderer );
335 * Add a renderer from scene
336 * @param renderer to remove
338 void RemoveRenderer( Renderer* renderer );
343 * Set the pan gesture processor.
344 * Pan Gesture processor lives for the lifetime of UpdateManager
345 * @param[in] gesture The gesture processor.
346 * @post The gestureProcessor is owned by the UpdateManager.
348 void SetPanGestureProcessor( PanGesture* gestureProcessor );
353 * Add a newly created TextureSet.
354 * @param[in] textureSet The texture set to add.
355 * @post The TextureSet is owned by the UpdateManager.
357 void AddTextureSet( OwnerPointer< TextureSet >& textureSet );
360 * Remove a TextureSet.
361 * @pre The TextureSet has been added to the UpdateManager.
362 * @param[in] textureSet The TextureSet to remove.
363 * @post The TextureSet is destroyed.
365 void RemoveTextureSet( TextureSet* textureSet );
370 * Get the scene graph side list of RenderTasks.
371 * @param[in] systemLevel True if using the system-level overlay.
372 * @return The list of render tasks
374 RenderTaskList* GetRenderTaskList( bool systemLevel );
376 // Message queue handling
379 * Reserve space for another message in the queue; this must then be initialized by the caller.
380 * The message will be read from the update-thread after the next FlushMessages is called.
381 * @post Calling this method may invalidate any previously returned slots.
382 * @param[in] size The message size with respect to the size of type "char".
383 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
384 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
385 * @return A pointer to the first char allocated for the message.
387 uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene = true );
390 * @return the current event-buffer index.
392 BufferIndex GetEventBufferIndex() const
394 // inlined as its called often from event thread
395 return mSceneGraphBuffers.GetEventBufferIndex();
399 * Called by the event-thread to signal that FlushQueue will be called
400 * e.g. when it has finished event processing.
402 void EventProcessingStarted();
405 * Flush the set of messages, which were previously stored with QueueMessage().
406 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
408 * @return True if there are messages to process.
413 * Add a new sampler to RenderManager
414 * @param[in] sampler The sampler to add
415 * @post Sends a message to RenderManager to add the sampler.
416 * The sampler will be owned by RenderManager
418 void AddSampler( OwnerPointer< Render::Sampler >& sampler );
421 * Removes an existing sampler from RenderManager
422 * @param[in] sampler The sampler to remove
423 * @post The sampler will be destroyed in the render thread
425 void RemoveSampler( Render::Sampler* sampler );
428 * Sets the filter modes for an existing sampler
429 * @param[in] sampler The sampler
430 * @param[in] minFilterMode The filter to use under minification
431 * @param[in] magFilterMode The filter to use under magnification
433 void SetFilterMode( Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode );
436 * Sets the wrap mode for an existing sampler
437 * @param[in] sampler The sampler
438 * @param[in] rWrapMode Wrapping mode in z direction
439 * @param[in] sWrapMode Wrapping mode in x direction
440 * @param[in] tWrapMode Wrapping mode in y direction
442 void SetWrapMode( Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode );
445 * Add a new property buffer to RenderManager
446 * @param[in] propertryBuffer The property buffer to add
447 * @post Sends a message to RenderManager to add the property buffer.
448 * The property buffer will be owned by RenderManager
450 void AddPropertyBuffer( OwnerPointer< Render::PropertyBuffer >& propertryBuffer );
453 * Removes an existing PropertyBuffer from RenderManager
454 * @param[in] propertryBuffer The property buffer to remove
455 * @post The property buffer will be destroyed in the render thread
457 void RemovePropertyBuffer( Render::PropertyBuffer* propertryBuffer );
460 * Sets the format of an existing property buffer
461 * @param[in] propertyBuffer The property buffer.
462 * @param[in] format The new format of the buffer
463 * @post Sends a message to RenderManager to set the new format to the property buffer.
465 void SetPropertyBufferFormat( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format );
468 * Sets the data of an existing property buffer
469 * @param[in] propertyBuffer The property buffer.
470 * @param[in] data The new data of the buffer
471 * @param[in] size The new size of the buffer
472 * @post Sends a message to RenderManager to set the new data to the property buffer.
474 void SetPropertyBufferData( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size );
477 * Adds a geometry to the RenderManager
478 * @param[in] geometry The geometry to add
479 * @post Sends a message to RenderManager to add the Geometry
480 * The geometry will be owned by RenderManager
482 void AddGeometry( OwnerPointer< Render::Geometry >& geometry );
485 * Removes an existing Geometry from RenderManager
486 * @param[in] geometry The geometry to remove
487 * @post The geometry will be destroyed in the render thread
489 void RemoveGeometry( Render::Geometry* geometry );
492 * Sets the geometry type of an existing Geometry
493 * @param[in] geometry The geometry
494 * @param[in] geometryType The type of the geometry
496 void SetGeometryType( Render::Geometry* geometry, uint32_t geometryType );
499 * Sets the index buffer to be used by a geometry
500 * @param[in] geometry The geometry
501 * @param[in] indices A vector containing the indices for the geometry
503 void SetIndexBuffer( Render::Geometry* geometry, Dali::Vector<uint16_t>& indices );
506 * Adds a vertex buffer to a geometry
507 * @param[in] geometry The geometry
508 * @param[in] propertyBuffer The property buffer
510 void AttachVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
513 * Removes a vertex buffer from a geometry
514 * @param[in] geometry The geometry
515 * @param[in] propertyBuffer The property buffer
517 void RemoveVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
520 * Adds a texture to the render manager
521 * @param[in] texture The texture to add
522 * The texture will be owned by RenderManager
524 void AddTexture( OwnerPointer< Render::Texture >& texture );
527 * Removes a texture from the render manager
528 * @param[in] texture The texture to remove
529 * @post The texture will be destroyed in the render thread
531 void RemoveTexture( Render::Texture* texture );
534 * Uploads data to a texture owned by the RenderManager
535 * @param[in] texture The texture
536 * @param[in] pixelData The pixel data object
537 * @param[in] params The parameters for the upload
539 void UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params );
542 * Generates mipmaps for a texture owned by the RenderManager
543 * @param[in] texture The texture
545 void GenerateMipmaps( Render::Texture* texture );
548 * Adds a framebuffer to the render manager
549 * @param[in] frameBuffer The framebuffer to add
550 * The framebuffer will be owned by RenderManager
552 void AddFrameBuffer( Render::FrameBuffer* frameBuffer );
555 * Removes a FrameBuffer from the render manager
556 * @param[in] frameBuffer The FrameBuffer to remove
557 * @post The FrameBuffer will be destroyed in the render thread
559 void RemoveFrameBuffer( Render::FrameBuffer* frameBuffer );
562 * Attach a texture as color output to an existing FrameBuffer
563 * @param[in] frameBuffer The FrameBuffer
564 * @param[in] texture The texture that will be used as output when rendering
565 * @param[in] mipmapLevel The mipmap of the texture to be attached
566 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
568 void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face );
573 * Performs an Update traversal on the scene-graph.
574 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
575 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
576 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
577 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
578 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
579 * @return True if further updates are required e.g. during animations.
581 uint32_t Update( float elapsedSeconds,
582 uint32_t lastVSyncTimeMilliseconds,
583 uint32_t nextVSyncTimeMilliseconds,
584 bool renderToFboEnabled,
585 bool isRenderingToFbo );
588 * Set the background color i.e. the glClear color used at the beginning of each frame.
589 * @param[in] color The new background color.
591 void SetBackgroundColor(const Vector4& color);
594 * Set the default surface rect.
595 * @param[in] rect The rect value representing the surface.
597 void SetDefaultSurfaceRect( const Rect<int>& rect );
600 * @copydoc Dali::Stage::KeepRendering()
602 void KeepRendering( float durationSeconds );
605 * @copydoc Dali::DevelStage::SetRenderingBehavior()
607 void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
610 * Sets the depths of all layers.
611 * @param layers The layers in depth order.
612 * @param[in] rootLayer The root layer of the sorted layers.
614 void SetLayerDepths( const std::vector< Layer* >& layers, const Layer* rootLayer );
617 * Set the depth indices of all nodes (in LayerUI's)
618 * @param[in] nodeDepths A vector of nodes and associated depth indices
620 void SetDepthIndices( OwnerPointer< NodeDepths >& nodeDepths );
623 * Query wheter the default surface rect is changed or not.
624 * @return true if the default surface rect is changed.
626 bool IsDefaultSurfaceRectChanged();
629 * Adds an implementation of the FrameCallbackInterface.
630 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface
631 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
633 void AddFrameCallback( FrameCallbackInterface* frameCallback, const Node* rootNode );
636 * Removes the specified implementation of FrameCallbackInterface.
637 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
639 void RemoveFrameCallback( FrameCallbackInterface* frameCallback );
644 UpdateManager(const UpdateManager&);
647 UpdateManager& operator=(const UpdateManager& rhs);
650 * Helper to check whether the update-thread should keep going.
651 * @param[in] elapsedSeconds The time in seconds since the previous update.
652 * @return True if the update-thread should keep going.
654 uint32_t KeepUpdatingCheck( float elapsedSeconds ) const;
657 * Helper to reset all Node properties
658 * @param[in] bufferIndex to use
660 void ResetProperties( BufferIndex bufferIndex );
663 * Perform gesture updates.
664 * @param[in] bufferIndex to use
665 * @param[in] lastVSyncTime The last VSync time in milliseconds.
666 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
667 * @return true, if any properties were updated.
669 bool ProcessGestures( BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds );
672 * Perform animation updates
673 * @param[in] bufferIndex to use
674 * @param[in] elapsedSeconds time since last frame
676 void Animate( BufferIndex bufferIndex, float elapsedSeconds );
679 * Applies constraints to CustomObjects
680 * @param[in] bufferIndex to use
682 void ConstrainCustomObjects( BufferIndex bufferIndex );
685 * Applies constraints to RenderTasks
686 * @param[in] bufferIndex to use
688 void ConstrainRenderTasks( BufferIndex bufferIndex );
691 * Applies constraints to Shaders
692 * @param[in] bufferIndex to use
694 void ConstrainShaders( BufferIndex bufferIndex );
697 * Perform property notification updates
698 * @param[in] bufferIndex to use
700 void ProcessPropertyNotifications( BufferIndex bufferIndex );
703 * Pass shader binaries queued here on to event thread.
705 void ForwardCompiledShadersToEventThread();
708 * Update node shaders, opacity, geometry etc.
709 * @param[in] bufferIndex to use
711 void UpdateNodes( BufferIndex bufferIndex );
715 * @param[in] bufferIndex to use
717 void UpdateRenderers( BufferIndex bufferIndex );
721 // needs to be direct member so that getter for event buffer can be inlined
722 SceneGraphBuffers mSceneGraphBuffers;
729 // Messages for UpdateManager
731 inline void InstallRootMessage( UpdateManager& manager, OwnerPointer<Layer>& root )
733 // Message has ownership of Layer while in transit from event -> update
734 typedef MessageValue1< UpdateManager, OwnerPointer<Layer> > LocalType;
736 // Reserve some memory inside the message queue
737 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
739 // Construct message in the message queue memory; note that delete should not be called on the return value
740 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, root );
743 inline void AddNodeMessage( UpdateManager& manager, OwnerPointer<Node>& node )
745 // Message has ownership of Node while in transit from event -> update
746 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
748 // Reserve some memory inside the message queue
749 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
751 // Construct message in the message queue memory; note that delete should not be called on the return value
752 new (slot) LocalType( &manager, &UpdateManager::AddNode, node );
755 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild )
757 // Update thread can edit the object
758 Node& parent = const_cast< Node& >( constParent );
759 Node& child = const_cast< Node& >( constChild );
761 typedef MessageValue2< UpdateManager, Node*, Node* > LocalType;
763 // Reserve some memory inside the message queue
764 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
766 // Construct message in the message queue memory; note that delete should not be called on the return value
767 new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child );
770 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
772 // Scene graph thread can modify this object.
773 Node& node = const_cast< Node& >( constNode );
775 typedef MessageValue1< UpdateManager, Node* > LocalType;
777 // Reserve some memory inside the message queue
778 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
780 // Construct message in the message queue memory; note that delete should not be called on the return value
781 new (slot) LocalType( &manager, &UpdateManager::DisconnectNode, &node );
784 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
786 // Scene graph thread can destroy this object.
787 Node& node = const_cast< Node& >( constNode );
789 typedef MessageValue1< UpdateManager, Node* > LocalType;
791 // Reserve some memory inside the message queue
792 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
794 // Construct message in the message queue memory; note that delete should not be called on the return value
795 new (slot) LocalType( &manager, &UpdateManager::DestroyNode, &node );
798 inline void AddCameraMessage( UpdateManager& manager, OwnerPointer< Camera >& camera )
800 // Message has ownership of Camera while in transit from event -> update
801 typedef MessageValue1< UpdateManager, OwnerPointer< Camera > > LocalType;
803 // Reserve some memory inside the message queue
804 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
806 // Construct message in the message queue memory; note that delete should not be called on the return value
807 new (slot) LocalType( &manager, &UpdateManager::AddCamera, camera );
810 inline void RemoveCameraMessage( UpdateManager& manager, const Camera* camera )
812 typedef MessageValue1< UpdateManager, const Camera* > LocalType;
814 // Reserve some memory inside the message queue
815 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
817 // Construct message in the message queue memory; note that delete should not be called on the return value
818 new (slot) LocalType( &manager, &UpdateManager::RemoveCamera, camera );
821 inline void AddObjectMessage( UpdateManager& manager, OwnerPointer<PropertyOwner>& object )
823 // Message has ownership of object while in transit from event -> update
824 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
826 // Reserve some memory inside the message queue
827 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
829 // Construct message in the message queue memory; note that delete should not be called on the return value
830 new (slot) LocalType( &manager, &UpdateManager::AddObject, object );
833 inline void RemoveObjectMessage( UpdateManager& manager, PropertyOwner* object )
835 typedef MessageValue1< UpdateManager, PropertyOwner* > LocalType;
837 // Reserve some memory inside the message queue
838 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
840 // Construct message in the message queue memory; note that delete should not be called on the return value
841 new (slot) LocalType( &manager, &UpdateManager::RemoveObject, object );
844 inline void AddAnimationMessage( UpdateManager& manager, OwnerPointer< SceneGraph::Animation >& animation )
846 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Animation > > LocalType;
848 // Reserve some memory inside the message queue
849 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
851 // Construct message in the message queue memory; note that delete should not be called on the return value
852 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
855 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
857 // The scene-graph thread owns this object so it can safely edit it.
858 Animation& animation = const_cast< Animation& >( constAnimation );
860 typedef MessageValue1< UpdateManager, Animation* > LocalType;
862 // Reserve some memory inside the message queue
863 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
865 // Construct message in the message queue memory; note that delete should not be called on the return value
866 new (slot) LocalType( &manager, &UpdateManager::StopAnimation, &animation );
869 inline void RemoveAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
871 // The scene-graph thread owns this object so it can safely edit it.
872 Animation& animation = const_cast< Animation& >( constAnimation );
874 typedef MessageValue1< UpdateManager, Animation* > LocalType;
876 // Reserve some memory inside the message queue
877 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
879 // Construct message in the message queue memory; note that delete should not be called on the return value
880 new (slot) LocalType( &manager, &UpdateManager::RemoveAnimation, &animation );
883 inline void AddRenderTaskListMessage( UpdateManager& manager, OwnerPointer< SceneGraph::RenderTaskList >& taskList )
885 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::RenderTaskList > > LocalType;
887 // Reserve some memory inside the message queue
888 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
890 // Construct message in the message queue memory; note that delete should not be called on the return value
891 new (slot) LocalType( &manager, &UpdateManager::AddRenderTaskList, taskList );
894 inline void RemoveRenderTaskListMessage( UpdateManager& manager, const RenderTaskList& constTaskList )
896 // The scene-graph thread owns this object so it can safely edit it.
897 RenderTaskList& taskList = const_cast< RenderTaskList& >( constTaskList );
899 typedef MessageValue1< UpdateManager, RenderTaskList* > LocalType;
901 // Reserve some memory inside the message queue
902 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
904 // Construct message in the message queue memory; note that delete should not be called on the return value
905 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderTaskList, &taskList );
908 inline void AddPropertyNotificationMessage( UpdateManager& manager, OwnerPointer< PropertyNotification >& propertyNotification )
910 // Message has ownership of PropertyNotification while in transit from event -> update
911 typedef MessageValue1< UpdateManager, OwnerPointer< PropertyNotification > > LocalType;
913 // Reserve some memory inside the message queue
914 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
916 // Construct message in the message queue memory; note that delete should not be called on the return value
917 new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
920 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
922 // The scene-graph thread owns this object so it can safely edit it.
923 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
925 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
927 // Reserve some memory inside the message queue
928 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
930 // Construct message in the message queue memory; note that delete should not be called on the return value
931 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyNotification, &propertyNotification );
934 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
935 const PropertyNotification* constPropertyNotification,
936 PropertyNotification::NotifyMode notifyMode )
938 // The scene-graph thread owns this object so it can safely edit it.
939 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
941 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
943 // Reserve some memory inside the message queue
944 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
946 // Construct message in the message queue memory; note that delete should not be called on the return value
947 new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
950 // The render thread can safely change the Shader
951 inline void AddShaderMessage( UpdateManager& manager, OwnerPointer< Shader >& shader )
953 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > LocalType;
955 // Reserve some memory inside the message queue
956 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
958 // Construct message in the message queue memory; note that delete should not be called on the return value
959 new (slot) LocalType( &manager, &UpdateManager::AddShader, shader );
962 // The render thread can safely change the Shader
963 inline void RemoveShaderMessage( UpdateManager& manager, Shader& shader )
965 typedef MessageValue1< UpdateManager, Shader* > LocalType;
967 // Reserve some memory inside the message queue
968 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
970 // Construct message in the message queue memory; note that delete should not be called on the return value
971 new (slot) LocalType( &manager, &UpdateManager::RemoveShader, &shader );
974 inline void SetShaderProgramMessage( UpdateManager& manager,
976 Internal::ShaderDataPtr shaderData,
977 bool modifiesGeometry )
979 typedef MessageValue3< UpdateManager, Shader*, Internal::ShaderDataPtr, bool > LocalType;
981 // Reserve some memory inside the message queue
982 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
984 // Construct message in the message queue memory; note that delete should not be called on the return value
985 new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, &shader, shaderData, modifiesGeometry );
988 inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
990 typedef MessageValue1< UpdateManager, Vector4 > LocalType;
992 // Reserve some memory inside the message queue
993 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
995 // Construct message in the message queue memory; note that delete should not be called on the return value
996 new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
999 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int32_t>& rect )
1001 typedef MessageValue1< UpdateManager, Rect<int32_t> > LocalType;
1003 // Reserve some memory inside the message queue
1004 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1006 // Construct message in the message queue memory; note that delete should not be called on the return value
1007 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
1010 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
1012 typedef MessageValue1< UpdateManager, float > LocalType;
1014 // Reserve some memory inside the message queue
1015 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1017 // Construct message in the message queue memory; note that delete should not be called on the return value
1018 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
1021 inline void SetRenderingBehaviorMessage( UpdateManager& manager, DevelStage::Rendering renderingBehavior )
1023 typedef MessageValue1< UpdateManager, DevelStage::Rendering > LocalType;
1025 // Reserve some memory inside the message queue
1026 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1028 // Construct message in the message queue memory; note that delete should not be called on the return value
1029 new (slot) LocalType( &manager, &UpdateManager::SetRenderingBehavior, renderingBehavior );
1033 * Create a message for setting the depth of a layer
1034 * @param[in] manager The update manager
1035 * @param[in] layers list of layers
1036 * @param[in] rootLayer True if the layers are added via the SystemOverlay API
1038 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, const Layer* rootLayer )
1040 typedef MessageValue2< UpdateManager, std::vector< Layer* >, const Layer* > LocalType;
1042 // Reserve some memory inside the message queue
1043 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1045 // Construct message in the message queue memory; note that delete should not be called on the return value
1046 new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, rootLayer );
1049 inline void AddRendererMessage( UpdateManager& manager, OwnerPointer< Renderer >& object )
1051 typedef MessageValue1< UpdateManager, OwnerPointer< Renderer > > LocalType;
1053 // Reserve some memory inside the message queue
1054 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1055 // Construct message in the message queue memory; note that delete should not be called on the return value
1056 new (slot) LocalType( &manager, &UpdateManager::AddRenderer, object );
1059 inline void RemoveRendererMessage( UpdateManager& manager, Renderer& object )
1061 typedef MessageValue1< UpdateManager, Renderer* > LocalType;
1063 // Reserve some memory inside the message queue
1064 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1065 // Construct message in the message queue memory; note that delete should not be called on the return value
1066 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderer, &object );
1069 // The render thread can safely change the Shader
1070 inline void AddTextureSetMessage( UpdateManager& manager, OwnerPointer< TextureSet >& textureSet )
1072 typedef MessageValue1< UpdateManager, OwnerPointer< TextureSet > > LocalType;
1074 // Reserve some memory inside the message queue
1075 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1077 // Construct message in the message queue memory; note that delete should not be called on the return value
1078 new (slot) LocalType( &manager, &UpdateManager::AddTextureSet, textureSet );
1081 // The render thread can safely change the Shader
1082 inline void RemoveTextureSetMessage( UpdateManager& manager, TextureSet& textureSet )
1084 typedef MessageValue1< UpdateManager, TextureSet* > LocalType;
1086 // Reserve some memory inside the message queue
1087 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1089 // Construct message in the message queue memory; note that delete should not be called on the return value
1090 new (slot) LocalType( &manager, &UpdateManager::RemoveTextureSet, &textureSet );
1093 inline void AddSamplerMessage( UpdateManager& manager, OwnerPointer< Render::Sampler >& sampler )
1095 // Message has ownership of Sampler while in transit from event -> update
1096 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Sampler > > LocalType;
1098 // Reserve some memory inside the message queue
1099 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1101 // Construct message in the message queue memory; note that delete should not be called on the return value
1102 new (slot) LocalType( &manager, &UpdateManager::AddSampler, sampler );
1105 inline void RemoveSamplerMessage( UpdateManager& manager, Render::Sampler& sampler )
1107 typedef MessageValue1< UpdateManager, Render::Sampler* > LocalType;
1109 // Reserve some memory inside the message queue
1110 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1112 // Construct message in the message queue memory; note that delete should not be called on the return value
1113 new (slot) LocalType( &manager, &UpdateManager::RemoveSampler, &sampler );
1116 inline void SetFilterModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode )
1118 typedef MessageValue3< UpdateManager, Render::Sampler*, uint32_t, uint32_t > LocalType;
1120 // Reserve some memory inside the message queue
1121 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1123 // Construct message in the message queue memory; note that delete should not be called on the return value
1124 new (slot) LocalType( &manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode );
1127 inline void SetWrapModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode )
1129 typedef MessageValue4< UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t > LocalType;
1131 // Reserve some memory inside the message queue
1132 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1134 // Construct message in the message queue memory; note that delete should not be called on the return value
1135 new (slot) LocalType( &manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode );
1138 inline void AddPropertyBuffer( UpdateManager& manager, OwnerPointer< Render::PropertyBuffer >& propertyBuffer )
1140 // Message has ownership of propertyBuffer while in transit from event -> update
1141 typedef MessageValue1< UpdateManager, OwnerPointer< Render::PropertyBuffer > > LocalType;
1143 // Reserve some memory inside the message queue
1144 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1146 // Construct message in the message queue memory; note that delete should not be called on the return value
1147 new (slot) LocalType( &manager, &UpdateManager::AddPropertyBuffer, propertyBuffer );
1150 inline void RemovePropertyBuffer( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer )
1152 typedef MessageValue1< UpdateManager, Render::PropertyBuffer* > LocalType;
1154 // Reserve some memory inside the message queue
1155 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1157 // Construct message in the message queue memory; note that delete should not be called on the return value
1158 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyBuffer, &propertyBuffer );
1161 inline void SetPropertyBufferFormat( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format )
1163 // Message has ownership of PropertyBuffer::Format while in transit from event -> update
1164 typedef MessageValue2< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Render::PropertyBuffer::Format> > LocalType;
1166 // Reserve some memory inside the message queue
1167 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1169 // Construct message in the message queue memory; note that delete should not be called on the return value
1170 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferFormat, &propertyBuffer, format );
1173 inline void SetPropertyBufferData( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
1175 // Message has ownership of PropertyBuffer data while in transit from event -> update
1176 typedef MessageValue3< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Vector<uint8_t> >, uint32_t > LocalType;
1178 // Reserve some memory inside the message queue
1179 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1181 // Construct message in the message queue memory; note that delete should not be called on the return value
1182 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferData, &propertyBuffer, data, size );
1185 inline void AddGeometry( UpdateManager& manager, OwnerPointer< Render::Geometry >& geometry )
1187 // Message has ownership of Geometry while in transit from event -> update
1188 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Geometry > > LocalType;
1190 // Reserve some memory inside the message queue
1191 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1193 // Construct message in the message queue memory; note that delete should not be called on the return value
1194 new (slot) LocalType( &manager, &UpdateManager::AddGeometry, geometry );
1197 inline void RemoveGeometry( UpdateManager& manager, Render::Geometry& geometry )
1199 typedef MessageValue1< UpdateManager, Render::Geometry* > LocalType;
1201 // Reserve some memory inside the message queue
1202 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1204 // Construct message in the message queue memory; note that delete should not be called on the return value
1205 new (slot) LocalType( &manager, &UpdateManager::RemoveGeometry, &geometry );
1208 inline void AttachVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1210 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1212 // Reserve some memory inside the message queue
1213 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1215 // Construct message in the message queue memory; note that delete should not be called on the return value
1216 new (slot) LocalType( &manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1219 inline void RemoveVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1221 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1223 // Reserve some memory inside the message queue
1224 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1226 // Construct message in the message queue memory; note that delete should not be called on the return value
1227 new (slot) LocalType( &manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1230 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1231 template< typename T >
1232 class IndexBufferMessage : public MessageBase
1237 * Constructor which does a Vector::Swap()
1239 IndexBufferMessage( T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices )
1241 mManager( manager ),
1242 mRenderGeometry( geometry )
1244 mIndices.Swap( indices );
1248 * Virtual destructor
1250 virtual ~IndexBufferMessage()
1255 * @copydoc MessageBase::Process
1257 virtual void Process( BufferIndex /*bufferIndex*/ )
1259 DALI_ASSERT_DEBUG( mManager && "Message does not have an object" );
1260 mManager->SetIndexBuffer( mRenderGeometry, mIndices );
1266 Render::Geometry* mRenderGeometry;
1267 Dali::Vector<uint16_t> mIndices;
1270 inline void SetIndexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices )
1272 typedef IndexBufferMessage< UpdateManager > LocalType;
1274 // Reserve some memory inside the message queue
1275 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1277 // Construct message in the message queue memory; note that delete should not be called on the return value
1278 new (slot) LocalType( &manager, &geometry, indices );
1281 inline void SetGeometryTypeMessage( UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType )
1283 typedef MessageValue2< UpdateManager, Render::Geometry*, uint32_t > LocalType;
1285 // Reserve some memory inside the message queue
1286 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1288 // Construct message in the message queue memory; note that delete should not be called on the return value
1289 new (slot) LocalType( &manager, &UpdateManager::SetGeometryType, &geometry, geometryType );
1292 inline void AddTexture( UpdateManager& manager, OwnerPointer< Render::Texture >& texture )
1294 // Message has ownership of Texture while in transit from event -> update
1295 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Texture > > LocalType;
1297 // Reserve some memory inside the message queue
1298 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1300 // Construct message in the message queue memory; note that delete should not be called on the return value
1301 new (slot) LocalType( &manager, &UpdateManager::AddTexture, texture );
1304 inline void RemoveTexture( UpdateManager& manager, Render::Texture& texture )
1306 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1308 // Reserve some memory inside the message queue
1309 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1311 // Construct message in the message queue memory; note that delete should not be called on the return value
1312 new (slot) LocalType( &manager, &UpdateManager::RemoveTexture, &texture );
1315 inline void UploadTextureMessage( UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params )
1317 typedef MessageValue3< UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams > LocalType;
1319 // Reserve some memory inside the message queue
1320 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1322 // Construct message in the message queue memory; note that delete should not be called on the return value
1323 new (slot) LocalType( &manager, &UpdateManager::UploadTexture, &texture, pixelData, params );
1326 inline void GenerateMipmapsMessage( UpdateManager& manager, Render::Texture& texture )
1328 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1330 // Reserve some memory inside the message queue
1331 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1333 // Construct message in the message queue memory; note that delete should not be called on the return value
1334 new (slot) LocalType( &manager, &UpdateManager::GenerateMipmaps, &texture );
1338 inline void AddFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )
1340 typedef MessageValue1< UpdateManager, Render::FrameBuffer* > LocalType;
1342 // Reserve some memory inside the message queue
1343 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1345 // Construct message in the message queue memory; note that delete should not be called on the return value
1346 new (slot) LocalType( &manager, &UpdateManager::AddFrameBuffer, &frameBuffer );
1349 inline void RemoveFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )
1351 typedef MessageValue1< UpdateManager, Render::FrameBuffer* > LocalType;
1353 // Reserve some memory inside the message queue
1354 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1356 // Construct message in the message queue memory; note that delete should not be called on the return value
1357 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer );
1360 inline void AttachColorTextureToFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer )
1362 typedef MessageValue4< UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t > LocalType;
1364 // Reserve some memory inside the message queue
1365 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1367 // Construct message in the message queue memory; note that delete should not be called on the return value
1368 new (slot) LocalType( &manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer );
1371 inline void SetDepthIndicesMessage( UpdateManager& manager, OwnerPointer< NodeDepths >& nodeDepths )
1373 typedef MessageValue1< UpdateManager, OwnerPointer< NodeDepths > > LocalType;
1375 // Reserve some memory inside the message queue
1376 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1378 // Construct message in the message queue memory; note that delete should not be called on the return value
1379 new (slot) LocalType( &manager, &UpdateManager::SetDepthIndices, nodeDepths );
1382 inline void AddResetterMessage( UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter )
1384 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyResetterBase> > LocalType;
1386 // Reserve some memory inside the message queue
1387 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1389 // Construct message in the message queue memory; note that delete should not be called on the return value
1390 new (slot) LocalType( &manager, &UpdateManager::AddPropertyResetter, resetter );
1393 inline void AddFrameCallbackMessage( UpdateManager& manager, FrameCallbackInterface& frameCallback, const Node& rootNode )
1395 typedef MessageValue2< UpdateManager, FrameCallbackInterface*, const Node* > LocalType;
1397 // Reserve some memory inside the message queue
1398 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1400 // Construct message in the message queue memory; note that delete should not be called on the return value
1401 new (slot) LocalType( &manager, &UpdateManager::AddFrameCallback, &frameCallback, &rootNode );
1404 inline void RemoveFrameCallbackMessage( UpdateManager& manager, FrameCallbackInterface& frameCallback )
1406 typedef MessageValue1< UpdateManager, FrameCallbackInterface* > LocalType;
1408 // Reserve some memory inside the message queue
1409 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1411 // Construct message in the message queue memory; note that delete should not be called on the return value
1412 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameCallback, &frameCallback );
1415 } // namespace SceneGraph
1417 } // namespace Internal
1421 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H