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/render/shaders/scene-graph-shader.h> // for OwnerPointer< Shader >
42 #include <dali/internal/render/renderers/render-property-buffer.h>
43 #include <dali/internal/event/rendering/texture-impl.h>
48 class FrameCallbackInterface;
52 class GlSyncAbstraction;
53 class RenderController;
55 } // namespace Integration
60 class PropertyNotifier;
61 class NotificationManager;
62 class CompleteNotificationInterface;
70 // value types used by messages
71 template <> struct ParameterType< PropertyNotification::NotifyMode >
72 : public BasicType< PropertyNotification::NotifyMode > {};
81 class RenderTaskProcessor;
87 SceneGraph::Node* node;
89 NodeDepthPair( SceneGraph::Node* node, uint32_t sortedDepth )
91 sortedDepth(sortedDepth)
102 void Add( SceneGraph::Node* node, uint32_t sortedDepth )
104 nodeDepths.push_back( NodeDepthPair( node, sortedDepth ) );
107 std::vector<NodeDepthPair> nodeDepths;
112 * UpdateManager maintains a scene graph i.e. a tree of nodes as well as
113 * other scene graph property owning objects.
114 * It controls the Update traversal, in which nodes are repositioned/animated,
115 * and organizes the the culling and rendering of the scene.
116 * It also maintains the lifecycle of nodes and other property owners that are
117 * disconnected from the scene graph.
119 class UpdateManager : public ShaderSaver
124 * Construct a new UpdateManager.
125 * @param[in] notificationManager This should be notified when animations have finished.
126 * @param[in] animationPlaylist The CompleteNotificationInterface that handles the animations
127 * @param[in] propertyNotifier The PropertyNotifier
128 * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
129 * @param[in] controller After messages are flushed, we request a render from the RenderController.
130 * @param[in] renderManager This is responsible for rendering the results of each "update".
131 * @param[in] renderQueue Used to queue messages for the next render.
132 * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
134 UpdateManager( NotificationManager& notificationManager,
135 CompleteNotificationInterface& animationPlaylist,
136 PropertyNotifier& propertyNotifier,
137 DiscardQueue& discardQueue,
138 Integration::RenderController& controller,
139 RenderManager& renderManager,
140 RenderQueue& renderQueue,
141 RenderTaskProcessor& renderTaskProcessor );
146 virtual ~UpdateManager();
148 // Node connection methods
151 * Installs a new layer as the root node.
152 * @pre The UpdateManager does not already have an installed root node.
153 * @pre The layer is of derived Node type Layer.
154 * @pre The layer does not have a parent.
155 * @param[in] layer The new root node.
156 * @param[in] systemLevel True if using the system-level overlay.
157 * @post The node is owned by UpdateManager.
159 void InstallRoot( OwnerPointer<Layer>& layer, bool systemLevel );
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 );
222 * Add a newly created animation.
223 * @param[in] animation The animation to add.
224 * @post The animation is owned by UpdateManager.
226 void AddAnimation( OwnerPointer< SceneGraph::Animation >& animation );
230 * @param[in] animation The animation to stop.
232 void StopAnimation( Animation* animation );
235 * Remove an animation.
236 * @param[in] animation The animation to remove.
238 void RemoveAnimation( Animation* animation );
241 * Query whether any animations are currently running.
242 * @return True if any animations are running.
244 bool IsAnimationRunning() const;
247 * Add a property resetter. UpdateManager takes ownership of the object.
248 * It will be killed by UpdateManager when the associated animator or
249 * constraint has finished; or the property owner of the property is destroyed.
251 void AddPropertyResetter( OwnerPointer<PropertyResetterBase>& propertyResetter );
253 // Property Notification
256 * Add a newly created property notification
257 * @param[in] propertyNotification The notification to add
258 * @post The propertyNotification is owned by UpdateManager.
260 void AddPropertyNotification( OwnerPointer< PropertyNotification >& propertyNotification );
263 * Remove a property notification
264 * @param[in] propertyNotification The notification to remove
266 void RemovePropertyNotification( PropertyNotification* propertyNotification );
269 * Set Notify state for PropertyNotification
270 * @param[in] propertyNotification The notification to remove
271 * @param[in] notifyMode The notification mode.
273 void PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode );
278 * Add a newly created shader.
279 * @param[in] shader The shader to add.
280 * @post The shader is owned by the UpdateManager.
282 void AddShader( OwnerPointer< Shader >& shader );
286 * @pre The shader has been added to the UpdateManager.
287 * @param[in] shader The shader to remove.
288 * @post The shader is destroyed.
290 void RemoveShader( Shader* shader );
293 * Set the shader program for a Shader object
294 * @param[in] shader The shader to modify
295 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
296 * @param[in] modifiesGeometry True if the vertex shader modifies geometry
298 void SetShaderProgram( Shader* shader, Internal::ShaderDataPtr shaderData, bool modifiesGeometry );
301 * @brief Accept compiled shaders passed back on render thread for saving.
302 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
304 virtual void SaveBinary( Internal::ShaderDataPtr shaderData );
307 * @brief Set the destination for compiled shader binaries to be passed on to.
308 * The dispatcher passed in will be called from the update thread.
309 * @param[in] upstream A sink for ShaderDatas to be passed into.
311 void SetShaderSaver( ShaderSaver& upstream );
316 * Add a new renderer to scene
317 * @param renderer to add
319 void AddRenderer( OwnerPointer< Renderer >& renderer );
322 * Add a renderer from scene
323 * @param renderer to remove
325 void RemoveRenderer( Renderer* renderer );
330 * Set the pan gesture processor.
331 * Pan Gesture processor lives for the lifetime of UpdateManager
332 * @param[in] gesture The gesture processor.
333 * @post The gestureProcessor is owned by the UpdateManager.
335 void SetPanGestureProcessor( PanGesture* gestureProcessor );
340 * Add a newly created TextureSet.
341 * @param[in] textureSet The texture set to add.
342 * @post The TextureSet is owned by the UpdateManager.
344 void AddTextureSet( OwnerPointer< TextureSet >& textureSet );
347 * Remove a TextureSet.
348 * @pre The TextureSet has been added to the UpdateManager.
349 * @param[in] textureSet The TextureSet to remove.
350 * @post The TextureSet is destroyed.
352 void RemoveTextureSet( TextureSet* textureSet );
357 * Get the scene graph side list of RenderTasks.
358 * @param[in] systemLevel True if using the system-level overlay.
359 * @return The list of render tasks
361 RenderTaskList* GetRenderTaskList( bool systemLevel );
363 // Message queue handling
366 * Reserve space for another message in the queue; this must then be initialized by the caller.
367 * The message will be read from the update-thread after the next FlushMessages is called.
368 * @post Calling this method may invalidate any previously returned slots.
369 * @param[in] size The message size with respect to the size of type "char".
370 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
371 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
372 * @return A pointer to the first char allocated for the message.
374 uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene = true );
377 * @return the current event-buffer index.
379 BufferIndex GetEventBufferIndex() const
381 // inlined as its called often from event thread
382 return mSceneGraphBuffers.GetEventBufferIndex();
386 * Called by the event-thread to signal that FlushQueue will be called
387 * e.g. when it has finished event processing.
389 void EventProcessingStarted();
392 * Flush the set of messages, which were previously stored with QueueMessage().
393 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
395 * @return True if there are messages to process.
400 * Add a new sampler to RenderManager
401 * @param[in] sampler The sampler to add
402 * @post Sends a message to RenderManager to add the sampler.
403 * The sampler will be owned by RenderManager
405 void AddSampler( OwnerPointer< Render::Sampler >& sampler );
408 * Removes an existing sampler from RenderManager
409 * @param[in] sampler The sampler to remove
410 * @post The sampler will be destroyed in the render thread
412 void RemoveSampler( Render::Sampler* sampler );
415 * Sets the filter modes for an existing sampler
416 * @param[in] sampler The sampler
417 * @param[in] minFilterMode The filter to use under minification
418 * @param[in] magFilterMode The filter to use under magnification
420 void SetFilterMode( Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode );
423 * Sets the wrap mode for an existing sampler
424 * @param[in] sampler The sampler
425 * @param[in] rWrapMode Wrapping mode in z direction
426 * @param[in] sWrapMode Wrapping mode in x direction
427 * @param[in] tWrapMode Wrapping mode in y direction
429 void SetWrapMode( Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode );
432 * Add a new property buffer to RenderManager
433 * @param[in] propertryBuffer The property buffer to add
434 * @post Sends a message to RenderManager to add the property buffer.
435 * The property buffer will be owned by RenderManager
437 void AddPropertyBuffer( OwnerPointer< Render::PropertyBuffer >& propertryBuffer );
440 * Removes an existing PropertyBuffer from RenderManager
441 * @param[in] propertryBuffer The property buffer to remove
442 * @post The property buffer will be destroyed in the render thread
444 void RemovePropertyBuffer( Render::PropertyBuffer* propertryBuffer );
447 * Sets the format of an existing property buffer
448 * @param[in] propertyBuffer The property buffer.
449 * @param[in] format The new format of the buffer
450 * @post Sends a message to RenderManager to set the new format to the property buffer.
452 void SetPropertyBufferFormat( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format );
455 * Sets the data of an existing property buffer
456 * @param[in] propertyBuffer The property buffer.
457 * @param[in] data The new data of the buffer
458 * @param[in] size The new size of the buffer
459 * @post Sends a message to RenderManager to set the new data to the property buffer.
461 void SetPropertyBufferData( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size );
464 * Adds a geometry to the RenderManager
465 * @param[in] geometry The geometry to add
466 * @post Sends a message to RenderManager to add the Geometry
467 * The geometry will be owned by RenderManager
469 void AddGeometry( OwnerPointer< Render::Geometry >& geometry );
472 * Removes an existing Geometry from RenderManager
473 * @param[in] geometry The geometry to remove
474 * @post The geometry will be destroyed in the render thread
476 void RemoveGeometry( Render::Geometry* geometry );
479 * Sets the geometry type of an existing Geometry
480 * @param[in] geometry The geometry
481 * @param[in] geometryType The type of the geometry
483 void SetGeometryType( Render::Geometry* geometry, uint32_t geometryType );
486 * Sets the index buffer to be used by a geometry
487 * @param[in] geometry The geometry
488 * @param[in] indices A vector containing the indices for the geometry
490 void SetIndexBuffer( Render::Geometry* geometry, Dali::Vector<uint16_t>& indices );
493 * Adds a vertex buffer to a geometry
494 * @param[in] geometry The geometry
495 * @param[in] propertyBuffer The property buffer
497 void AttachVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
500 * Removes a vertex buffer from a geometry
501 * @param[in] geometry The geometry
502 * @param[in] propertyBuffer The property buffer
504 void RemoveVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
507 * Adds a texture to the render manager
508 * @param[in] texture The texture to add
509 * The texture will be owned by RenderManager
511 void AddTexture( OwnerPointer< Render::Texture >& texture );
514 * Removes a texture from the render manager
515 * @param[in] texture The texture to remove
516 * @post The texture will be destroyed in the render thread
518 void RemoveTexture( Render::Texture* texture );
521 * Uploads data to a texture owned by the RenderManager
522 * @param[in] texture The texture
523 * @param[in] pixelData The pixel data object
524 * @param[in] params The parameters for the upload
526 void UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params );
529 * Generates mipmaps for a texture owned by the RenderManager
530 * @param[in] texture The texture
532 void GenerateMipmaps( Render::Texture* texture );
535 * Adds a framebuffer to the render manager
536 * @param[in] frameBuffer The framebuffer to add
537 * The framebuffer will be owned by RenderManager
539 void AddFrameBuffer( Render::FrameBuffer* frameBuffer );
542 * Removes a FrameBuffer from the render manager
543 * @param[in] frameBuffer The FrameBuffer to remove
544 * @post The FrameBuffer will be destroyed in the render thread
546 void RemoveFrameBuffer( Render::FrameBuffer* frameBuffer );
549 * Attach a texture as color output to an existing FrameBuffer
550 * @param[in] frameBuffer The FrameBuffer
551 * @param[in] texture The texture that will be used as output when rendering
552 * @param[in] mipmapLevel The mipmap of the texture to be attached
553 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
555 void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face );
560 * Performs an Update traversal on the scene-graph.
561 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
562 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
563 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
564 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
565 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
566 * @return True if further updates are required e.g. during animations.
568 uint32_t Update( float elapsedSeconds,
569 uint32_t lastVSyncTimeMilliseconds,
570 uint32_t nextVSyncTimeMilliseconds,
571 bool renderToFboEnabled,
572 bool isRenderingToFbo );
575 * Set the background color i.e. the glClear color used at the beginning of each frame.
576 * @param[in] color The new background color.
578 void SetBackgroundColor(const Vector4& color);
581 * Set the default surface rect.
582 * @param[in] rect The rect value representing the surface.
584 void SetDefaultSurfaceRect( const Rect<int>& rect );
587 * @copydoc Dali::Stage::KeepRendering()
589 void KeepRendering( float durationSeconds );
592 * @copydoc Dali::DevelStage::SetRenderingBehavior()
594 void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
597 * Sets the depths of all layers.
598 * @param layers The layers in depth order.
599 * @param[in] systemLevel True if using the system-level overlay.
601 void SetLayerDepths( const std::vector< Layer* >& layers, bool systemLevel );
604 * Set the depth indices of all nodes (in LayerUI's)
605 * @param[in] nodeDepths A vector of nodes and associated depth indices
607 void SetDepthIndices( OwnerPointer< NodeDepths >& nodeDepths );
610 * Query wheter the default surface rect is changed or not.
611 * @return true if the default surface rect is changed.
613 bool IsDefaultSurfaceRectChanged();
616 * Adds an implementation of the FrameCallbackInterface.
617 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface
618 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
620 void AddFrameCallback( FrameCallbackInterface* frameCallback, const Node* rootNode );
623 * Removes the specified implementation of FrameCallbackInterface.
624 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
626 void RemoveFrameCallback( FrameCallbackInterface* frameCallback );
631 UpdateManager(const UpdateManager&);
634 UpdateManager& operator=(const UpdateManager& rhs);
637 * Helper to check whether the update-thread should keep going.
638 * @param[in] elapsedSeconds The time in seconds since the previous update.
639 * @return True if the update-thread should keep going.
641 uint32_t KeepUpdatingCheck( float elapsedSeconds ) const;
644 * Helper to reset all Node properties
645 * @param[in] bufferIndex to use
647 void ResetProperties( BufferIndex bufferIndex );
650 * Perform gesture updates.
651 * @param[in] bufferIndex to use
652 * @param[in] lastVSyncTime The last VSync time in milliseconds.
653 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
654 * @return true, if any properties were updated.
656 bool ProcessGestures( BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds );
659 * Perform animation updates
660 * @param[in] bufferIndex to use
661 * @param[in] elapsedSeconds time since last frame
663 void Animate( BufferIndex bufferIndex, float elapsedSeconds );
666 * Applies constraints to CustomObjects
667 * @param[in] bufferIndex to use
669 void ConstrainCustomObjects( BufferIndex bufferIndex );
672 * Applies constraints to RenderTasks
673 * @param[in] bufferIndex to use
675 void ConstrainRenderTasks( BufferIndex bufferIndex );
678 * Applies constraints to Shaders
679 * @param[in] bufferIndex to use
681 void ConstrainShaders( BufferIndex bufferIndex );
684 * Perform property notification updates
685 * @param[in] bufferIndex to use
687 void ProcessPropertyNotifications( BufferIndex bufferIndex );
690 * Pass shader binaries queued here on to event thread.
692 void ForwardCompiledShadersToEventThread();
695 * Update node shaders, opacity, geometry etc.
696 * @param[in] bufferIndex to use
698 void UpdateNodes( BufferIndex bufferIndex );
702 * @param[in] bufferIndex to use
704 void UpdateRenderers( BufferIndex bufferIndex );
708 // needs to be direct member so that getter for event buffer can be inlined
709 SceneGraphBuffers mSceneGraphBuffers;
716 // Messages for UpdateManager
718 inline void InstallRootMessage( UpdateManager& manager, OwnerPointer<Layer>& root, bool systemLevel )
720 // Message has ownership of Layer while in transit from event -> update
721 typedef MessageValue2< UpdateManager, OwnerPointer<Layer>, bool > LocalType;
723 // Reserve some memory inside the message queue
724 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
726 // Construct message in the message queue memory; note that delete should not be called on the return value
727 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, root, systemLevel );
730 inline void AddNodeMessage( UpdateManager& manager, OwnerPointer<Node>& node )
732 // Message has ownership of Node while in transit from event -> update
733 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
735 // Reserve some memory inside the message queue
736 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
738 // Construct message in the message queue memory; note that delete should not be called on the return value
739 new (slot) LocalType( &manager, &UpdateManager::AddNode, node );
742 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild )
744 // Update thread can edit the object
745 Node& parent = const_cast< Node& >( constParent );
746 Node& child = const_cast< Node& >( constChild );
748 typedef MessageValue2< UpdateManager, Node*, Node* > LocalType;
750 // Reserve some memory inside the message queue
751 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
753 // Construct message in the message queue memory; note that delete should not be called on the return value
754 new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child );
757 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
759 // Scene graph thread can modify this object.
760 Node& node = const_cast< Node& >( constNode );
762 typedef MessageValue1< UpdateManager, 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::DisconnectNode, &node );
771 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
773 // Scene graph thread can destroy 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::DestroyNode, &node );
785 inline void AddCameraMessage( UpdateManager& manager, OwnerPointer< Camera >& camera )
787 // Message has ownership of Camera while in transit from event -> update
788 typedef MessageValue1< UpdateManager, OwnerPointer< Camera > > LocalType;
790 // Reserve some memory inside the message queue
791 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
793 // Construct message in the message queue memory; note that delete should not be called on the return value
794 new (slot) LocalType( &manager, &UpdateManager::AddCamera, camera );
797 inline void RemoveCameraMessage( UpdateManager& manager, const Camera* camera )
799 typedef MessageValue1< UpdateManager, const Camera* > LocalType;
801 // Reserve some memory inside the message queue
802 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
804 // Construct message in the message queue memory; note that delete should not be called on the return value
805 new (slot) LocalType( &manager, &UpdateManager::RemoveCamera, camera );
808 inline void AddObjectMessage( UpdateManager& manager, OwnerPointer<PropertyOwner>& object )
810 // Message has ownership of object while in transit from event -> update
811 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
813 // Reserve some memory inside the message queue
814 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
816 // Construct message in the message queue memory; note that delete should not be called on the return value
817 new (slot) LocalType( &manager, &UpdateManager::AddObject, object );
820 inline void RemoveObjectMessage( UpdateManager& manager, PropertyOwner* object )
822 typedef MessageValue1< UpdateManager, PropertyOwner* > LocalType;
824 // Reserve some memory inside the message queue
825 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
827 // Construct message in the message queue memory; note that delete should not be called on the return value
828 new (slot) LocalType( &manager, &UpdateManager::RemoveObject, object );
831 inline void AddAnimationMessage( UpdateManager& manager, OwnerPointer< SceneGraph::Animation >& animation )
833 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Animation > > LocalType;
835 // Reserve some memory inside the message queue
836 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
838 // Construct message in the message queue memory; note that delete should not be called on the return value
839 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
842 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
844 // The scene-graph thread owns this object so it can safely edit it.
845 Animation& animation = const_cast< Animation& >( constAnimation );
847 typedef MessageValue1< UpdateManager, 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::StopAnimation, &animation );
856 inline void RemoveAnimationMessage( 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::RemoveAnimation, &animation );
870 inline void AddPropertyNotificationMessage( UpdateManager& manager, OwnerPointer< PropertyNotification >& propertyNotification )
872 // Message has ownership of PropertyNotification while in transit from event -> update
873 typedef MessageValue1< UpdateManager, OwnerPointer< PropertyNotification > > LocalType;
875 // Reserve some memory inside the message queue
876 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
878 // Construct message in the message queue memory; note that delete should not be called on the return value
879 new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
882 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
884 // The scene-graph thread owns this object so it can safely edit it.
885 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
887 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
889 // Reserve some memory inside the message queue
890 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
892 // Construct message in the message queue memory; note that delete should not be called on the return value
893 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyNotification, &propertyNotification );
896 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
897 const PropertyNotification* constPropertyNotification,
898 PropertyNotification::NotifyMode notifyMode )
900 // The scene-graph thread owns this object so it can safely edit it.
901 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
903 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
905 // Reserve some memory inside the message queue
906 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
908 // Construct message in the message queue memory; note that delete should not be called on the return value
909 new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
912 // The render thread can safely change the Shader
913 inline void AddShaderMessage( UpdateManager& manager, OwnerPointer< Shader >& shader )
915 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > LocalType;
917 // Reserve some memory inside the message queue
918 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
920 // Construct message in the message queue memory; note that delete should not be called on the return value
921 new (slot) LocalType( &manager, &UpdateManager::AddShader, shader );
924 // The render thread can safely change the Shader
925 inline void RemoveShaderMessage( UpdateManager& manager, Shader& shader )
927 typedef MessageValue1< UpdateManager, Shader* > LocalType;
929 // Reserve some memory inside the message queue
930 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
932 // Construct message in the message queue memory; note that delete should not be called on the return value
933 new (slot) LocalType( &manager, &UpdateManager::RemoveShader, &shader );
936 inline void SetShaderProgramMessage( UpdateManager& manager,
938 Internal::ShaderDataPtr shaderData,
939 bool modifiesGeometry )
941 typedef MessageValue3< UpdateManager, Shader*, Internal::ShaderDataPtr, bool > 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::SetShaderProgram, &shader, shaderData, modifiesGeometry );
950 inline void SetBackgroundColorMessage( UpdateManager& manager, const Vector4& color )
952 typedef MessageValue1< UpdateManager, Vector4 > LocalType;
954 // Reserve some memory inside the message queue
955 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
957 // Construct message in the message queue memory; note that delete should not be called on the return value
958 new (slot) LocalType( &manager, &UpdateManager::SetBackgroundColor, color );
961 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int32_t>& rect )
963 typedef MessageValue1< UpdateManager, Rect<int32_t> > LocalType;
965 // Reserve some memory inside the message queue
966 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
968 // Construct message in the message queue memory; note that delete should not be called on the return value
969 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
972 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
974 typedef MessageValue1< UpdateManager, float > LocalType;
976 // Reserve some memory inside the message queue
977 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
979 // Construct message in the message queue memory; note that delete should not be called on the return value
980 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
983 inline void SetRenderingBehaviorMessage( UpdateManager& manager, DevelStage::Rendering renderingBehavior )
985 typedef MessageValue1< UpdateManager, DevelStage::Rendering > LocalType;
987 // Reserve some memory inside the message queue
988 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
990 // Construct message in the message queue memory; note that delete should not be called on the return value
991 new (slot) LocalType( &manager, &UpdateManager::SetRenderingBehavior, renderingBehavior );
995 * Create a message for setting the depth of a layer
996 * @param[in] manager The update manager
997 * @param[in] layers list of layers
998 * @param[in] systemLevel True if the layers are added via the SystemOverlay API
1000 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, bool systemLevel )
1002 typedef MessageValue2< UpdateManager, std::vector< Layer* >, bool > 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::SetLayerDepths, layers, systemLevel );
1011 inline void AddRendererMessage( UpdateManager& manager, OwnerPointer< Renderer >& object )
1013 typedef MessageValue1< UpdateManager, OwnerPointer< Renderer > > LocalType;
1015 // Reserve some memory inside the message queue
1016 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::AddRenderer, object );
1021 inline void RemoveRendererMessage( UpdateManager& manager, Renderer& object )
1023 typedef MessageValue1< UpdateManager, Renderer* > LocalType;
1025 // Reserve some memory inside the message queue
1026 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1027 // Construct message in the message queue memory; note that delete should not be called on the return value
1028 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderer, &object );
1031 // The render thread can safely change the Shader
1032 inline void AddTextureSetMessage( UpdateManager& manager, OwnerPointer< TextureSet >& textureSet )
1034 typedef MessageValue1< UpdateManager, OwnerPointer< TextureSet > > LocalType;
1036 // Reserve some memory inside the message queue
1037 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1039 // Construct message in the message queue memory; note that delete should not be called on the return value
1040 new (slot) LocalType( &manager, &UpdateManager::AddTextureSet, textureSet );
1043 // The render thread can safely change the Shader
1044 inline void RemoveTextureSetMessage( UpdateManager& manager, TextureSet& textureSet )
1046 typedef MessageValue1< UpdateManager, TextureSet* > LocalType;
1048 // Reserve some memory inside the message queue
1049 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1051 // Construct message in the message queue memory; note that delete should not be called on the return value
1052 new (slot) LocalType( &manager, &UpdateManager::RemoveTextureSet, &textureSet );
1055 inline void AddSamplerMessage( UpdateManager& manager, OwnerPointer< Render::Sampler >& sampler )
1057 // Message has ownership of Sampler while in transit from event -> update
1058 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Sampler > > LocalType;
1060 // Reserve some memory inside the message queue
1061 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1063 // Construct message in the message queue memory; note that delete should not be called on the return value
1064 new (slot) LocalType( &manager, &UpdateManager::AddSampler, sampler );
1067 inline void RemoveSamplerMessage( UpdateManager& manager, Render::Sampler& sampler )
1069 typedef MessageValue1< UpdateManager, Render::Sampler* > LocalType;
1071 // Reserve some memory inside the message queue
1072 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1074 // Construct message in the message queue memory; note that delete should not be called on the return value
1075 new (slot) LocalType( &manager, &UpdateManager::RemoveSampler, &sampler );
1078 inline void SetFilterModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode )
1080 typedef MessageValue3< UpdateManager, Render::Sampler*, uint32_t, uint32_t > LocalType;
1082 // Reserve some memory inside the message queue
1083 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1085 // Construct message in the message queue memory; note that delete should not be called on the return value
1086 new (slot) LocalType( &manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode );
1089 inline void SetWrapModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode )
1091 typedef MessageValue4< UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t > LocalType;
1093 // Reserve some memory inside the message queue
1094 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1096 // Construct message in the message queue memory; note that delete should not be called on the return value
1097 new (slot) LocalType( &manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode );
1100 inline void AddPropertyBuffer( UpdateManager& manager, OwnerPointer< Render::PropertyBuffer >& propertyBuffer )
1102 // Message has ownership of propertyBuffer while in transit from event -> update
1103 typedef MessageValue1< UpdateManager, OwnerPointer< Render::PropertyBuffer > > LocalType;
1105 // Reserve some memory inside the message queue
1106 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1108 // Construct message in the message queue memory; note that delete should not be called on the return value
1109 new (slot) LocalType( &manager, &UpdateManager::AddPropertyBuffer, propertyBuffer );
1112 inline void RemovePropertyBuffer( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer )
1114 typedef MessageValue1< UpdateManager, Render::PropertyBuffer* > LocalType;
1116 // Reserve some memory inside the message queue
1117 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1119 // Construct message in the message queue memory; note that delete should not be called on the return value
1120 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyBuffer, &propertyBuffer );
1123 inline void SetPropertyBufferFormat( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format )
1125 // Message has ownership of PropertyBuffer::Format while in transit from event -> update
1126 typedef MessageValue2< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Render::PropertyBuffer::Format> > LocalType;
1128 // Reserve some memory inside the message queue
1129 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1131 // Construct message in the message queue memory; note that delete should not be called on the return value
1132 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferFormat, &propertyBuffer, format );
1135 inline void SetPropertyBufferData( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
1137 // Message has ownership of PropertyBuffer data while in transit from event -> update
1138 typedef MessageValue3< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Vector<uint8_t> >, uint32_t > LocalType;
1140 // Reserve some memory inside the message queue
1141 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1143 // Construct message in the message queue memory; note that delete should not be called on the return value
1144 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferData, &propertyBuffer, data, size );
1147 inline void AddGeometry( UpdateManager& manager, OwnerPointer< Render::Geometry >& geometry )
1149 // Message has ownership of Geometry while in transit from event -> update
1150 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Geometry > > LocalType;
1152 // Reserve some memory inside the message queue
1153 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1155 // Construct message in the message queue memory; note that delete should not be called on the return value
1156 new (slot) LocalType( &manager, &UpdateManager::AddGeometry, geometry );
1159 inline void RemoveGeometry( UpdateManager& manager, Render::Geometry& geometry )
1161 typedef MessageValue1< UpdateManager, Render::Geometry* > LocalType;
1163 // Reserve some memory inside the message queue
1164 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1166 // Construct message in the message queue memory; note that delete should not be called on the return value
1167 new (slot) LocalType( &manager, &UpdateManager::RemoveGeometry, &geometry );
1170 inline void AttachVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1172 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1174 // Reserve some memory inside the message queue
1175 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1177 // Construct message in the message queue memory; note that delete should not be called on the return value
1178 new (slot) LocalType( &manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1181 inline void RemoveVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1183 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1185 // Reserve some memory inside the message queue
1186 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1188 // Construct message in the message queue memory; note that delete should not be called on the return value
1189 new (slot) LocalType( &manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1192 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1193 template< typename T >
1194 class IndexBufferMessage : public MessageBase
1199 * Constructor which does a Vector::Swap()
1201 IndexBufferMessage( T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices )
1203 mManager( manager ),
1204 mRenderGeometry( geometry )
1206 mIndices.Swap( indices );
1210 * Virtual destructor
1212 virtual ~IndexBufferMessage()
1217 * @copydoc MessageBase::Process
1219 virtual void Process( BufferIndex /*bufferIndex*/ )
1221 DALI_ASSERT_DEBUG( mManager && "Message does not have an object" );
1222 mManager->SetIndexBuffer( mRenderGeometry, mIndices );
1228 Render::Geometry* mRenderGeometry;
1229 Dali::Vector<uint16_t> mIndices;
1232 inline void SetIndexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices )
1234 typedef IndexBufferMessage< UpdateManager > LocalType;
1236 // Reserve some memory inside the message queue
1237 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1239 // Construct message in the message queue memory; note that delete should not be called on the return value
1240 new (slot) LocalType( &manager, &geometry, indices );
1243 inline void SetGeometryTypeMessage( UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType )
1245 typedef MessageValue2< UpdateManager, Render::Geometry*, uint32_t > LocalType;
1247 // Reserve some memory inside the message queue
1248 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1250 // Construct message in the message queue memory; note that delete should not be called on the return value
1251 new (slot) LocalType( &manager, &UpdateManager::SetGeometryType, &geometry, geometryType );
1254 inline void AddTexture( UpdateManager& manager, OwnerPointer< Render::Texture >& texture )
1256 // Message has ownership of Texture while in transit from event -> update
1257 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Texture > > LocalType;
1259 // Reserve some memory inside the message queue
1260 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1262 // Construct message in the message queue memory; note that delete should not be called on the return value
1263 new (slot) LocalType( &manager, &UpdateManager::AddTexture, texture );
1266 inline void RemoveTexture( UpdateManager& manager, Render::Texture& texture )
1268 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1270 // Reserve some memory inside the message queue
1271 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1273 // Construct message in the message queue memory; note that delete should not be called on the return value
1274 new (slot) LocalType( &manager, &UpdateManager::RemoveTexture, &texture );
1277 inline void UploadTextureMessage( UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params )
1279 typedef MessageValue3< UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams > LocalType;
1281 // Reserve some memory inside the message queue
1282 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1284 // Construct message in the message queue memory; note that delete should not be called on the return value
1285 new (slot) LocalType( &manager, &UpdateManager::UploadTexture, &texture, pixelData, params );
1288 inline void GenerateMipmapsMessage( UpdateManager& manager, Render::Texture& texture )
1290 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1292 // Reserve some memory inside the message queue
1293 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1295 // Construct message in the message queue memory; note that delete should not be called on the return value
1296 new (slot) LocalType( &manager, &UpdateManager::GenerateMipmaps, &texture );
1300 inline void AddFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )
1302 typedef MessageValue1< UpdateManager, Render::FrameBuffer* > LocalType;
1304 // Reserve some memory inside the message queue
1305 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1307 // Construct message in the message queue memory; note that delete should not be called on the return value
1308 new (slot) LocalType( &manager, &UpdateManager::AddFrameBuffer, &frameBuffer );
1311 inline void RemoveFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )
1313 typedef MessageValue1< UpdateManager, Render::FrameBuffer* > LocalType;
1315 // Reserve some memory inside the message queue
1316 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1318 // Construct message in the message queue memory; note that delete should not be called on the return value
1319 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer );
1322 inline void AttachColorTextureToFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer )
1324 typedef MessageValue4< UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t > LocalType;
1326 // Reserve some memory inside the message queue
1327 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1329 // Construct message in the message queue memory; note that delete should not be called on the return value
1330 new (slot) LocalType( &manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer );
1333 inline void SetDepthIndicesMessage( UpdateManager& manager, OwnerPointer< NodeDepths >& nodeDepths )
1335 typedef MessageValue1< UpdateManager, OwnerPointer< NodeDepths > > LocalType;
1337 // Reserve some memory inside the message queue
1338 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1340 // Construct message in the message queue memory; note that delete should not be called on the return value
1341 new (slot) LocalType( &manager, &UpdateManager::SetDepthIndices, nodeDepths );
1344 inline void AddResetterMessage( UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter )
1346 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyResetterBase> > LocalType;
1348 // Reserve some memory inside the message queue
1349 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1351 // Construct message in the message queue memory; note that delete should not be called on the return value
1352 new (slot) LocalType( &manager, &UpdateManager::AddPropertyResetter, resetter );
1355 inline void AddFrameCallbackMessage( UpdateManager& manager, FrameCallbackInterface& frameCallback, const Node& rootNode )
1357 typedef MessageValue2< UpdateManager, FrameCallbackInterface*, const Node* > LocalType;
1359 // Reserve some memory inside the message queue
1360 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1362 // Construct message in the message queue memory; note that delete should not be called on the return value
1363 new (slot) LocalType( &manager, &UpdateManager::AddFrameCallback, &frameCallback, &rootNode );
1366 inline void RemoveFrameCallbackMessage( UpdateManager& manager, FrameCallbackInterface& frameCallback )
1368 typedef MessageValue1< UpdateManager, FrameCallbackInterface* > LocalType;
1370 // Reserve some memory inside the message queue
1371 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1373 // Construct message in the message queue memory; note that delete should not be called on the return value
1374 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameCallback, &frameCallback );
1377 } // namespace SceneGraph
1379 } // namespace Internal
1383 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H