1 #ifndef DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/common/vector-wrapper.h>
23 #include <dali/public-api/common/dali-common.h>
25 #include <dali/devel-api/common/stage-devel.h>
27 #include <dali/internal/common/message.h>
28 #include <dali/internal/common/type-abstraction-enums.h>
29 #include <dali/internal/common/shader-saver.h>
30 #include <dali/internal/event/common/event-thread-services.h>
31 #include <dali/internal/update/animation/scene-graph-animation.h>
32 #include <dali/internal/update/common/property-resetter.h>
33 #include <dali/internal/update/common/scene-graph-buffers.h>
34 #include <dali/internal/update/common/scene-graph-property-notification.h>
35 #include <dali/internal/update/nodes/node.h>
36 #include <dali/internal/update/nodes/scene-graph-layer.h>
37 #include <dali/internal/update/manager/scene-graph-frame-callback.h> // for OwnerPointer< FrameCallback >
38 #include <dali/internal/update/rendering/scene-graph-renderer.h> // for OwnerPointer< Renderer >
39 #include <dali/internal/update/rendering/scene-graph-texture-set.h> // for OwnerPointer< TextureSet >
40 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
41 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
42 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
43 #include <dali/internal/render/shaders/scene-graph-shader.h> // for OwnerPointer< Shader >
44 #include <dali/internal/render/renderers/render-property-buffer.h>
45 #include <dali/internal/event/rendering/texture-impl.h>
50 class FrameCallbackInterface;
54 class GlSyncAbstraction;
55 class RenderController;
57 } // namespace Integration
62 class PropertyNotifier;
63 class NotificationManager;
64 class CompleteNotificationInterface;
72 // value types used by messages
73 template <> struct ParameterType< PropertyNotification::NotifyMode >
74 : public BasicType< PropertyNotification::NotifyMode > {};
83 class RenderTaskProcessor;
89 SceneGraph::Node* node;
91 NodeDepthPair( SceneGraph::Node* node, uint32_t sortedDepth )
93 sortedDepth(sortedDepth)
104 void Add( SceneGraph::Node* node, uint32_t sortedDepth )
106 nodeDepths.push_back( NodeDepthPair( node, sortedDepth ) );
109 std::vector<NodeDepthPair> nodeDepths;
114 * UpdateManager maintains a scene graph i.e. a tree of nodes as well as
115 * other scene graph property owning objects.
116 * It controls the Update traversal, in which nodes are repositioned/animated,
117 * and organizes the the culling and rendering of the scene.
118 * It also maintains the lifecycle of nodes and other property owners that are
119 * disconnected from the scene graph.
121 class UpdateManager : public ShaderSaver
126 * Construct a new UpdateManager.
127 * @param[in] notificationManager This should be notified when animations have finished.
128 * @param[in] animationPlaylist The CompleteNotificationInterface that handles the animations
129 * @param[in] propertyNotifier The PropertyNotifier
130 * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
131 * @param[in] controller After messages are flushed, we request a render from the RenderController.
132 * @param[in] renderManager This is responsible for rendering the results of each "update".
133 * @param[in] renderQueue Used to queue messages for the next render.
134 * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
135 * @param[in] partialUpdateAvailble whether the partial update is available
137 UpdateManager( NotificationManager& notificationManager,
138 CompleteNotificationInterface& animationPlaylist,
139 PropertyNotifier& propertyNotifier,
140 DiscardQueue& discardQueue,
141 Integration::RenderController& controller,
142 RenderManager& renderManager,
143 RenderQueue& renderQueue,
144 RenderTaskProcessor& renderTaskProcessor,
145 bool partialUpdateAvailable );
150 virtual ~UpdateManager();
152 // Node connection methods
155 * Installs a new layer as the root node.
156 * @pre The layer is of derived Node type Layer.
157 * @pre The layer does not have a parent.
158 * @param[in] layer The new root node.
159 * @post The node is owned by UpdateManager.
161 void InstallRoot( OwnerPointer<Layer>& layer );
164 * Uninstalls the root node.
165 * @pre The layer is of derived Node type Layer.
166 * @pre The layer does not have a parent.
167 * @param[in] layer The root node.
168 * @post The node is owned by UpdateManager.
170 void UninstallRoot( Layer* layer );
173 * Add a Node; UpdateManager takes ownership.
174 * @pre The node does not have a parent.
175 * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
176 * @param[in] node The node to add.
178 void AddNode( OwnerPointer<Node>& node );
181 * Connect a Node to the scene-graph.
182 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
183 * @pre The node does not already have a parent.
184 * @param[in] parent The new parent node.
186 void ConnectNode( Node* parent, Node* node );
189 * Disconnect a Node from the scene-graph.
190 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
191 * @pre The node has a parent.
192 * @param[in] node The node to disconnect.
194 void DisconnectNode( Node* node );
197 * Destroy a Node owned by UpdateManager.
198 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
199 * In the following update, the previously queued Nodes may be deleted.
200 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
201 * @param[in] node The node to destroy.
203 void DestroyNode( Node* node );
206 * Add a camera on scene
207 * @param[in] camera The camera to add
209 void AddCamera( OwnerPointer< Camera >& camera );
212 * Remove a camera from scene
213 * @param[in] camera to remove
215 void RemoveCamera( Camera* camera );
218 * Add a newly created object.
219 * @param[in] object The object to add.
220 * @post The object is owned by UpdateManager.
222 void AddObject( OwnerPointer<PropertyOwner>& object );
226 * @param[in] object The object to remove.
228 void RemoveObject( PropertyOwner* object );
231 * Add a newly created render task list.
232 * @param[in] taskList The render task list to add.
233 * @post The render task list is owned by UpdateManager.
235 void AddRenderTaskList( OwnerPointer<RenderTaskList>& taskList );
238 * Remove a render task list.
239 * @param[in] taskList The render task list to remove.
241 void RemoveRenderTaskList( RenderTaskList* taskList );
246 * Add a newly created animation.
247 * @param[in] animation The animation to add.
248 * @post The animation is owned by UpdateManager.
250 void AddAnimation( OwnerPointer< SceneGraph::Animation >& animation );
254 * @param[in] animation The animation to stop.
256 void StopAnimation( Animation* animation );
259 * Remove an animation.
260 * @param[in] animation The animation to remove.
262 void RemoveAnimation( Animation* animation );
265 * Query whether any animations are currently running.
266 * @return True if any animations are running.
268 bool IsAnimationRunning() const;
271 * Add a property resetter. UpdateManager takes ownership of the object.
272 * It will be killed by UpdateManager when the associated animator or
273 * constraint has finished; or the property owner of the property is destroyed.
275 void AddPropertyResetter( OwnerPointer<PropertyResetterBase>& propertyResetter );
277 // Property Notification
280 * Add a newly created property notification
281 * @param[in] propertyNotification The notification to add
282 * @post The propertyNotification is owned by UpdateManager.
284 void AddPropertyNotification( OwnerPointer< PropertyNotification >& propertyNotification );
287 * Remove a property notification
288 * @param[in] propertyNotification The notification to remove
290 void RemovePropertyNotification( PropertyNotification* propertyNotification );
293 * Set Notify state for PropertyNotification
294 * @param[in] propertyNotification The notification to remove
295 * @param[in] notifyMode The notification mode.
297 void PropertyNotificationSetNotify( PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode );
302 * Add a newly created shader.
303 * @param[in] shader The shader to add.
304 * @post The shader is owned by the UpdateManager.
306 void AddShader( OwnerPointer< Shader >& shader );
310 * @pre The shader has been added to the UpdateManager.
311 * @param[in] shader The shader to remove.
312 * @post The shader is destroyed.
314 void RemoveShader( Shader* shader );
317 * Set the shader program for a Shader object
318 * @param[in] shader The shader to modify
319 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
320 * @param[in] modifiesGeometry True if the vertex shader modifies geometry
322 void SetShaderProgram( Shader* shader, Internal::ShaderDataPtr shaderData, bool modifiesGeometry );
325 * @brief Accept compiled shaders passed back on render thread for saving.
326 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
328 virtual void SaveBinary( Internal::ShaderDataPtr shaderData );
331 * @brief Set the destination for compiled shader binaries to be passed on to.
332 * The dispatcher passed in will be called from the update thread.
333 * @param[in] upstream A sink for ShaderDatas to be passed into.
335 void SetShaderSaver( ShaderSaver& upstream );
340 * Add a new renderer to scene
341 * @param renderer to add
343 void AddRenderer( OwnerPointer< Renderer >& renderer );
346 * Add a renderer from scene
347 * @param renderer to remove
349 void RemoveRenderer( Renderer* renderer );
354 * Set the pan gesture processor.
355 * Pan Gesture processor lives for the lifetime of UpdateManager
356 * @param[in] gesture The gesture processor.
357 * @post The gestureProcessor is owned by the UpdateManager.
359 void SetPanGestureProcessor( PanGesture* gestureProcessor );
364 * Add a newly created TextureSet.
365 * @param[in] textureSet The texture set to add.
366 * @post The TextureSet is owned by the UpdateManager.
368 void AddTextureSet( OwnerPointer< TextureSet >& textureSet );
371 * Remove a TextureSet.
372 * @pre The TextureSet has been added to the UpdateManager.
373 * @param[in] textureSet The TextureSet to remove.
374 * @post The TextureSet is destroyed.
376 void RemoveTextureSet( TextureSet* textureSet );
381 * Get the scene graph side list of RenderTasks.
382 * @param[in] systemLevel True if using the system-level overlay.
383 * @return The list of render tasks
385 RenderTaskList* GetRenderTaskList( bool systemLevel );
387 // Message queue handling
390 * Reserve space for another message in the queue; this must then be initialized by the caller.
391 * The message will be read from the update-thread after the next FlushMessages is called.
392 * @post Calling this method may invalidate any previously returned slots.
393 * @param[in] size The message size with respect to the size of type "char".
394 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
395 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
396 * @return A pointer to the first char allocated for the message.
398 uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene = true );
401 * @return the current event-buffer index.
403 BufferIndex GetEventBufferIndex() const
405 // inlined as its called often from event thread
406 return mSceneGraphBuffers.GetEventBufferIndex();
410 * Called by the event-thread to signal that FlushQueue will be called
411 * e.g. when it has finished event processing.
413 void EventProcessingStarted();
416 * Flush the set of messages, which were previously stored with QueueMessage().
417 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
419 * @return True if there are messages to process.
424 * Add a new sampler to RenderManager
425 * @param[in] sampler The sampler to add
426 * @post Sends a message to RenderManager to add the sampler.
427 * The sampler will be owned by RenderManager
429 void AddSampler( OwnerPointer< Render::Sampler >& sampler );
432 * Removes an existing sampler from RenderManager
433 * @param[in] sampler The sampler to remove
434 * @post The sampler will be destroyed in the render thread
436 void RemoveSampler( Render::Sampler* sampler );
439 * Sets the filter modes for an existing sampler
440 * @param[in] sampler The sampler
441 * @param[in] minFilterMode The filter to use under minification
442 * @param[in] magFilterMode The filter to use under magnification
444 void SetFilterMode( Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode );
447 * Sets the wrap mode for an existing sampler
448 * @param[in] sampler The sampler
449 * @param[in] rWrapMode Wrapping mode in z direction
450 * @param[in] sWrapMode Wrapping mode in x direction
451 * @param[in] tWrapMode Wrapping mode in y direction
453 void SetWrapMode( Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode );
456 * Add a new property buffer to RenderManager
457 * @param[in] propertryBuffer The property buffer to add
458 * @post Sends a message to RenderManager to add the property buffer.
459 * The property buffer will be owned by RenderManager
461 void AddPropertyBuffer( OwnerPointer< Render::PropertyBuffer >& propertryBuffer );
464 * Removes an existing PropertyBuffer from RenderManager
465 * @param[in] propertryBuffer The property buffer to remove
466 * @post The property buffer will be destroyed in the render thread
468 void RemovePropertyBuffer( Render::PropertyBuffer* propertryBuffer );
471 * Sets the format of an existing property buffer
472 * @param[in] propertyBuffer The property buffer.
473 * @param[in] format The new format of the buffer
474 * @post Sends a message to RenderManager to set the new format to the property buffer.
476 void SetPropertyBufferFormat( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format );
479 * Sets the data of an existing property buffer
480 * @param[in] propertyBuffer The property buffer.
481 * @param[in] data The new data of the buffer
482 * @param[in] size The new size of the buffer
483 * @post Sends a message to RenderManager to set the new data to the property buffer.
485 void SetPropertyBufferData( Render::PropertyBuffer* propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size );
488 * Adds a geometry to the RenderManager
489 * @param[in] geometry The geometry to add
490 * @post Sends a message to RenderManager to add the Geometry
491 * The geometry will be owned by RenderManager
493 void AddGeometry( OwnerPointer< Render::Geometry >& geometry );
496 * Removes an existing Geometry from RenderManager
497 * @param[in] geometry The geometry to remove
498 * @post The geometry will be destroyed in the render thread
500 void RemoveGeometry( Render::Geometry* geometry );
503 * Sets the geometry type of an existing Geometry
504 * @param[in] geometry The geometry
505 * @param[in] geometryType The type of the geometry
507 void SetGeometryType( Render::Geometry* geometry, uint32_t geometryType );
510 * Sets the index buffer to be used by a geometry
511 * @param[in] geometry The geometry
512 * @param[in] indices A vector containing the indices for the geometry
514 void SetIndexBuffer( Render::Geometry* geometry, Dali::Vector<uint16_t>& indices );
517 * Adds a vertex buffer to a geometry
518 * @param[in] geometry The geometry
519 * @param[in] propertyBuffer The property buffer
521 void AttachVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
524 * Removes a vertex buffer from a geometry
525 * @param[in] geometry The geometry
526 * @param[in] propertyBuffer The property buffer
528 void RemoveVertexBuffer( Render::Geometry* geometry, Render::PropertyBuffer* propertyBuffer );
531 * Adds a texture to the render manager
532 * @param[in] texture The texture to add
533 * The texture will be owned by RenderManager
535 void AddTexture( OwnerPointer< Render::Texture >& texture );
538 * Removes a texture from the render manager
539 * @param[in] texture The texture to remove
540 * @post The texture will be destroyed in the render thread
542 void RemoveTexture( Render::Texture* texture );
545 * Uploads data to a texture owned by the RenderManager
546 * @param[in] texture The texture
547 * @param[in] pixelData The pixel data object
548 * @param[in] params The parameters for the upload
550 void UploadTexture( Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params );
553 * Generates mipmaps for a texture owned by the RenderManager
554 * @param[in] texture The texture
556 void GenerateMipmaps( Render::Texture* texture );
559 * Adds a framebuffer to the render manager
560 * @param[in] frameBuffer The framebuffer to add
561 * The framebuffer will be owned by RenderManager
563 void AddFrameBuffer( OwnerPointer< Render::FrameBuffer >& frameBuffer );
566 * Removes a FrameBuffer from the render manager
567 * @param[in] frameBuffer The FrameBuffer to remove
568 * @post The FrameBuffer will be destroyed in the render thread
570 void RemoveFrameBuffer( Render::FrameBuffer* frameBuffer );
573 * Attach a texture as color output to an existing FrameBuffer
574 * @param[in] frameBuffer The FrameBuffer
575 * @param[in] texture The texture that will be used as output when rendering
576 * @param[in] mipmapLevel The mipmap of the texture to be attached
577 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
579 void AttachColorTextureToFrameBuffer( Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face );
584 * Performs an Update traversal on the scene-graph.
585 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
586 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
587 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
588 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
589 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
590 * @return True if further updates are required e.g. during animations.
592 uint32_t Update( float elapsedSeconds,
593 uint32_t lastVSyncTimeMilliseconds,
594 uint32_t nextVSyncTimeMilliseconds,
595 bool renderToFboEnabled,
596 bool isRenderingToFbo );
599 * Set the default surface rect.
600 * @param[in] rect The rect value representing the surface.
602 void SetDefaultSurfaceRect( const Rect<int>& rect );
605 * Set the default surface orientation.
606 * @param[in] orientation The orientation value representing the surface.
608 void SetDefaultSurfaceOrientation( int orientation );
611 * @copydoc Dali::Stage::KeepRendering()
613 void KeepRendering( float durationSeconds );
616 * @copydoc Dali::DevelStage::SetRenderingBehavior()
618 void SetRenderingBehavior( DevelStage::Rendering renderingBehavior );
621 * Sets the depths of all layers.
622 * @param layers The layers in depth order.
623 * @param[in] rootLayer The root layer of the sorted layers.
625 void SetLayerDepths( const std::vector< Layer* >& layers, const Layer* rootLayer );
628 * Set the depth indices of all nodes (in LayerUI's)
629 * @param[in] nodeDepths A vector of nodes and associated depth indices
631 void SetDepthIndices( OwnerPointer< NodeDepths >& nodeDepths );
634 * Query wheter the default surface rect is changed or not.
635 * @return true if the default surface rect is changed.
637 bool IsDefaultSurfaceRectChanged();
640 * Adds an implementation of the FrameCallbackInterface.
641 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
642 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
644 void AddFrameCallback( OwnerPointer< FrameCallback >& frameCallback, const Node* rootNode );
647 * Removes the specified implementation of FrameCallbackInterface.
648 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
650 void RemoveFrameCallback( FrameCallbackInterface* frameCallback );
655 UpdateManager(const UpdateManager&);
658 UpdateManager& operator=(const UpdateManager& rhs);
661 * Helper to check whether the update-thread should keep going.
662 * @param[in] elapsedSeconds The time in seconds since the previous update.
663 * @return True if the update-thread should keep going.
665 uint32_t KeepUpdatingCheck( float elapsedSeconds ) const;
668 * Helper to reset all Node properties
669 * @param[in] bufferIndex to use
671 void ResetProperties( BufferIndex bufferIndex );
674 * Perform gesture updates.
675 * @param[in] bufferIndex to use
676 * @param[in] lastVSyncTime The last VSync time in milliseconds.
677 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
678 * @return true, if any properties were updated.
680 bool ProcessGestures( BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds );
683 * Perform animation updates
684 * @param[in] bufferIndex to use
685 * @param[in] elapsedSeconds time since last frame
687 void Animate( BufferIndex bufferIndex, float elapsedSeconds );
690 * Applies constraints to CustomObjects
691 * @param[in] bufferIndex to use
693 void ConstrainCustomObjects( BufferIndex bufferIndex );
696 * Applies constraints to RenderTasks
697 * @param[in] bufferIndex to use
699 void ConstrainRenderTasks( BufferIndex bufferIndex );
702 * Applies constraints to Shaders
703 * @param[in] bufferIndex to use
705 void ConstrainShaders( BufferIndex bufferIndex );
708 * Perform property notification updates
709 * @param[in] bufferIndex to use
711 void ProcessPropertyNotifications( BufferIndex bufferIndex );
714 * Pass shader binaries queued here on to event thread.
716 void ForwardCompiledShadersToEventThread();
719 * Update node shaders, opacity, geometry etc.
720 * @param[in] bufferIndex to use
722 void UpdateNodes( BufferIndex bufferIndex );
726 * @param[in] bufferIndex to use
728 void UpdateRenderers( BufferIndex bufferIndex );
732 // needs to be direct member so that getter for event buffer can be inlined
733 SceneGraphBuffers mSceneGraphBuffers;
740 // Messages for UpdateManager
742 inline void InstallRootMessage( UpdateManager& manager, OwnerPointer<Layer>& root )
744 // Message has ownership of Layer while in transit from event -> update
745 typedef MessageValue1< UpdateManager, OwnerPointer<Layer> > LocalType;
747 // Reserve some memory inside the message queue
748 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
750 // Construct message in the message queue memory; note that delete should not be called on the return value
751 new (slot) LocalType( &manager, &UpdateManager::InstallRoot, root );
754 inline void UninstallRootMessage( UpdateManager& manager, const Layer* constRoot )
756 // Scene graph thread can destroy this object.
757 Layer* root = const_cast< Layer* >( constRoot );
759 typedef MessageValue1< UpdateManager, Layer* > LocalType;
761 // Reserve some memory inside the message queue
762 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
764 // Construct message in the message queue memory; note that delete should not be called on the return value
765 new (slot) LocalType( &manager, &UpdateManager::UninstallRoot, root );
768 inline void AddNodeMessage( UpdateManager& manager, OwnerPointer<Node>& node )
770 // Message has ownership of Node while in transit from event -> update
771 typedef MessageValue1< UpdateManager, OwnerPointer<Node> > LocalType;
773 // Reserve some memory inside the message queue
774 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
776 // Construct message in the message queue memory; note that delete should not be called on the return value
777 new (slot) LocalType( &manager, &UpdateManager::AddNode, node );
780 inline void ConnectNodeMessage( UpdateManager& manager, const Node& constParent, const Node& constChild )
782 // Update thread can edit the object
783 Node& parent = const_cast< Node& >( constParent );
784 Node& child = const_cast< Node& >( constChild );
786 typedef MessageValue2< UpdateManager, Node*, Node* > LocalType;
788 // Reserve some memory inside the message queue
789 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
791 // Construct message in the message queue memory; note that delete should not be called on the return value
792 new (slot) LocalType( &manager, &UpdateManager::ConnectNode, &parent, &child );
795 inline void DisconnectNodeMessage( UpdateManager& manager, const Node& constNode )
797 // Scene graph thread can modify this object.
798 Node& node = const_cast< Node& >( constNode );
800 typedef MessageValue1< UpdateManager, Node* > LocalType;
802 // Reserve some memory inside the message queue
803 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
805 // Construct message in the message queue memory; note that delete should not be called on the return value
806 new (slot) LocalType( &manager, &UpdateManager::DisconnectNode, &node );
809 inline void DestroyNodeMessage( UpdateManager& manager, const Node& constNode )
811 // Scene graph thread can destroy this object.
812 Node& node = const_cast< Node& >( constNode );
814 typedef MessageValue1< UpdateManager, Node* > LocalType;
816 // Reserve some memory inside the message queue
817 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
819 // Construct message in the message queue memory; note that delete should not be called on the return value
820 new (slot) LocalType( &manager, &UpdateManager::DestroyNode, &node );
823 inline void AddCameraMessage( UpdateManager& manager, OwnerPointer< Camera >& camera )
825 // Message has ownership of Camera while in transit from event -> update
826 typedef MessageValue1< UpdateManager, OwnerPointer< Camera > > LocalType;
828 // Reserve some memory inside the message queue
829 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
831 // Construct message in the message queue memory; note that delete should not be called on the return value
832 new (slot) LocalType( &manager, &UpdateManager::AddCamera, camera );
835 inline void RemoveCameraMessage( UpdateManager& manager, const Camera* camera )
837 typedef MessageValue1< UpdateManager, Camera* > LocalType;
839 // Reserve some memory inside the message queue
840 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
842 // Construct message in the message queue memory; note that delete should not be called on the return value
843 new (slot) LocalType( &manager, &UpdateManager::RemoveCamera, const_cast<Camera*>( camera ) );
846 inline void AddObjectMessage( UpdateManager& manager, OwnerPointer<PropertyOwner>& object )
848 // Message has ownership of object while in transit from event -> update
849 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyOwner> > LocalType;
851 // Reserve some memory inside the message queue
852 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
854 // Construct message in the message queue memory; note that delete should not be called on the return value
855 new (slot) LocalType( &manager, &UpdateManager::AddObject, object );
858 inline void RemoveObjectMessage( UpdateManager& manager, const PropertyOwner* object )
860 typedef MessageValue1< UpdateManager, PropertyOwner* > 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::RemoveObject, const_cast<PropertyOwner*>( object ) );
869 inline void AddAnimationMessage( UpdateManager& manager, OwnerPointer< SceneGraph::Animation >& animation )
871 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::Animation > > LocalType;
873 // Reserve some memory inside the message queue
874 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
876 // Construct message in the message queue memory; note that delete should not be called on the return value
877 new (slot) LocalType( &manager, &UpdateManager::AddAnimation, animation );
880 inline void StopAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
882 // The scene-graph thread owns this object so it can safely edit it.
883 Animation& animation = const_cast< Animation& >( constAnimation );
885 typedef MessageValue1< UpdateManager, Animation* > 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::StopAnimation, &animation );
894 inline void RemoveAnimationMessage( UpdateManager& manager, const Animation& constAnimation )
896 // The scene-graph thread owns this object so it can safely edit it.
897 Animation& animation = const_cast< Animation& >( constAnimation );
899 typedef MessageValue1< UpdateManager, Animation* > 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::RemoveAnimation, &animation );
908 inline void AddRenderTaskListMessage( UpdateManager& manager, OwnerPointer< SceneGraph::RenderTaskList >& taskList )
910 typedef MessageValue1< UpdateManager, OwnerPointer< SceneGraph::RenderTaskList > > LocalType;
912 // Reserve some memory inside the message queue
913 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
915 // Construct message in the message queue memory; note that delete should not be called on the return value
916 new (slot) LocalType( &manager, &UpdateManager::AddRenderTaskList, taskList );
919 inline void RemoveRenderTaskListMessage( UpdateManager& manager, const RenderTaskList& constTaskList )
921 // The scene-graph thread owns this object so it can safely edit it.
922 RenderTaskList& taskList = const_cast< RenderTaskList& >( constTaskList );
924 typedef MessageValue1< UpdateManager, RenderTaskList* > LocalType;
926 // Reserve some memory inside the message queue
927 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
929 // Construct message in the message queue memory; note that delete should not be called on the return value
930 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderTaskList, &taskList );
933 inline void AddPropertyNotificationMessage( UpdateManager& manager, OwnerPointer< PropertyNotification >& propertyNotification )
935 // Message has ownership of PropertyNotification while in transit from event -> update
936 typedef MessageValue1< UpdateManager, OwnerPointer< PropertyNotification > > LocalType;
938 // Reserve some memory inside the message queue
939 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
941 // Construct message in the message queue memory; note that delete should not be called on the return value
942 new (slot) LocalType( &manager, &UpdateManager::AddPropertyNotification, propertyNotification );
945 inline void RemovePropertyNotificationMessage( UpdateManager& manager, const PropertyNotification& constPropertyNotification )
947 // The scene-graph thread owns this object so it can safely edit it.
948 PropertyNotification& propertyNotification = const_cast< PropertyNotification& >( constPropertyNotification );
950 typedef MessageValue1< UpdateManager, PropertyNotification* > LocalType;
952 // Reserve some memory inside the message queue
953 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
955 // Construct message in the message queue memory; note that delete should not be called on the return value
956 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyNotification, &propertyNotification );
959 inline void PropertyNotificationSetNotifyModeMessage( UpdateManager& manager,
960 const PropertyNotification* constPropertyNotification,
961 PropertyNotification::NotifyMode notifyMode )
963 // The scene-graph thread owns this object so it can safely edit it.
964 PropertyNotification* propertyNotification = const_cast< PropertyNotification* >( constPropertyNotification );
966 typedef MessageValue2< UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode > LocalType;
968 // Reserve some memory inside the message queue
969 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
971 // Construct message in the message queue memory; note that delete should not be called on the return value
972 new (slot) LocalType( &manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode );
975 // The render thread can safely change the Shader
976 inline void AddShaderMessage( UpdateManager& manager, OwnerPointer< Shader >& shader )
978 typedef MessageValue1< UpdateManager, OwnerPointer< Shader > > LocalType;
980 // Reserve some memory inside the message queue
981 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
983 // Construct message in the message queue memory; note that delete should not be called on the return value
984 new (slot) LocalType( &manager, &UpdateManager::AddShader, shader );
987 // The render thread can safely change the Shader
988 inline void RemoveShaderMessage( UpdateManager& manager, const Shader* shader )
990 typedef MessageValue1< UpdateManager, Shader* > 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::RemoveShader, const_cast<Shader*>( shader ) );
999 inline void SetShaderProgramMessage( UpdateManager& manager,
1000 const Shader& shader,
1001 Internal::ShaderDataPtr shaderData,
1002 bool modifiesGeometry )
1004 typedef MessageValue3< UpdateManager, Shader*, Internal::ShaderDataPtr, bool > LocalType;
1006 // Reserve some memory inside the message queue
1007 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1009 // Construct message in the message queue memory; note that delete should not be called on the return value
1010 new (slot) LocalType( &manager, &UpdateManager::SetShaderProgram, const_cast<Shader*>( &shader ), shaderData, modifiesGeometry );
1013 inline void SetDefaultSurfaceRectMessage( UpdateManager& manager, const Rect<int32_t>& rect )
1015 typedef MessageValue1< UpdateManager, Rect<int32_t> > LocalType;
1017 // Reserve some memory inside the message queue
1018 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1020 // Construct message in the message queue memory; note that delete should not be called on the return value
1021 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceRect, rect );
1024 inline void SetDefaultSurfaceOrientationMessage( UpdateManager& manager, int orientation )
1026 typedef MessageValue1< UpdateManager, int > LocalType;
1028 // Reserve some memory inside the message queue
1029 unsigned int* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1031 // Construct message in the message queue memory; note that delete should not be called on the return value
1032 new (slot) LocalType( &manager, &UpdateManager::SetDefaultSurfaceOrientation, orientation );
1035 inline void KeepRenderingMessage( UpdateManager& manager, float durationSeconds )
1037 typedef MessageValue1< UpdateManager, float > LocalType;
1039 // Reserve some memory inside the message queue
1040 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1042 // Construct message in the message queue memory; note that delete should not be called on the return value
1043 new (slot) LocalType( &manager, &UpdateManager::KeepRendering, durationSeconds );
1046 inline void SetRenderingBehaviorMessage( UpdateManager& manager, DevelStage::Rendering renderingBehavior )
1048 typedef MessageValue1< UpdateManager, DevelStage::Rendering > LocalType;
1050 // Reserve some memory inside the message queue
1051 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1053 // Construct message in the message queue memory; note that delete should not be called on the return value
1054 new (slot) LocalType( &manager, &UpdateManager::SetRenderingBehavior, renderingBehavior );
1058 * Create a message for setting the depth of a layer
1059 * @param[in] manager The update manager
1060 * @param[in] layers list of layers
1061 * @param[in] rootLayer The rool layer
1063 inline void SetLayerDepthsMessage( UpdateManager& manager, const std::vector< Layer* >& layers, const Layer* rootLayer )
1065 typedef MessageValue2< UpdateManager, std::vector< Layer* >, const Layer* > LocalType;
1067 // Reserve some memory inside the message queue
1068 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1070 // Construct message in the message queue memory; note that delete should not be called on the return value
1071 new (slot) LocalType( &manager, &UpdateManager::SetLayerDepths, layers, rootLayer );
1074 inline void AddRendererMessage( UpdateManager& manager, OwnerPointer< Renderer >& object )
1076 typedef MessageValue1< UpdateManager, OwnerPointer< Renderer > > LocalType;
1078 // Reserve some memory inside the message queue
1079 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1080 // Construct message in the message queue memory; note that delete should not be called on the return value
1081 new (slot) LocalType( &manager, &UpdateManager::AddRenderer, object );
1084 inline void RemoveRendererMessage( UpdateManager& manager, const Renderer& object )
1086 typedef MessageValue1< UpdateManager, Renderer* > LocalType;
1088 // Reserve some memory inside the message queue
1089 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1090 // Construct message in the message queue memory; note that delete should not be called on the return value
1091 new (slot) LocalType( &manager, &UpdateManager::RemoveRenderer, const_cast<Renderer*>( &object ) );
1094 // The render thread can safely change the Shader
1095 inline void AddTextureSetMessage( UpdateManager& manager, OwnerPointer< TextureSet >& textureSet )
1097 typedef MessageValue1< UpdateManager, OwnerPointer< TextureSet > > LocalType;
1099 // Reserve some memory inside the message queue
1100 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1102 // Construct message in the message queue memory; note that delete should not be called on the return value
1103 new (slot) LocalType( &manager, &UpdateManager::AddTextureSet, textureSet );
1106 // The render thread can safely change the Shader
1107 inline void RemoveTextureSetMessage( UpdateManager& manager, TextureSet& textureSet )
1109 typedef MessageValue1< UpdateManager, TextureSet* > LocalType;
1111 // Reserve some memory inside the message queue
1112 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1114 // Construct message in the message queue memory; note that delete should not be called on the return value
1115 new (slot) LocalType( &manager, &UpdateManager::RemoveTextureSet, &textureSet );
1118 inline void AddSamplerMessage( UpdateManager& manager, OwnerPointer< Render::Sampler >& sampler )
1120 // Message has ownership of Sampler while in transit from event -> update
1121 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Sampler > > LocalType;
1123 // Reserve some memory inside the message queue
1124 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1126 // Construct message in the message queue memory; note that delete should not be called on the return value
1127 new (slot) LocalType( &manager, &UpdateManager::AddSampler, sampler );
1130 inline void RemoveSamplerMessage( UpdateManager& manager, Render::Sampler& sampler )
1132 typedef MessageValue1< UpdateManager, Render::Sampler* > LocalType;
1134 // Reserve some memory inside the message queue
1135 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1137 // Construct message in the message queue memory; note that delete should not be called on the return value
1138 new (slot) LocalType( &manager, &UpdateManager::RemoveSampler, &sampler );
1141 inline void SetFilterModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode )
1143 typedef MessageValue3< UpdateManager, Render::Sampler*, uint32_t, uint32_t > LocalType;
1145 // Reserve some memory inside the message queue
1146 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1148 // Construct message in the message queue memory; note that delete should not be called on the return value
1149 new (slot) LocalType( &manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode );
1152 inline void SetWrapModeMessage( UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode )
1154 typedef MessageValue4< UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t > LocalType;
1156 // Reserve some memory inside the message queue
1157 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1159 // Construct message in the message queue memory; note that delete should not be called on the return value
1160 new (slot) LocalType( &manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode );
1163 inline void AddPropertyBuffer( UpdateManager& manager, OwnerPointer< Render::PropertyBuffer >& propertyBuffer )
1165 // Message has ownership of propertyBuffer while in transit from event -> update
1166 typedef MessageValue1< UpdateManager, OwnerPointer< Render::PropertyBuffer > > LocalType;
1168 // Reserve some memory inside the message queue
1169 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1171 // Construct message in the message queue memory; note that delete should not be called on the return value
1172 new (slot) LocalType( &manager, &UpdateManager::AddPropertyBuffer, propertyBuffer );
1175 inline void RemovePropertyBuffer( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer )
1177 typedef MessageValue1< UpdateManager, Render::PropertyBuffer* > LocalType;
1179 // Reserve some memory inside the message queue
1180 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1182 // Construct message in the message queue memory; note that delete should not be called on the return value
1183 new (slot) LocalType( &manager, &UpdateManager::RemovePropertyBuffer, &propertyBuffer );
1186 inline void SetPropertyBufferFormat( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Render::PropertyBuffer::Format>& format )
1188 // Message has ownership of PropertyBuffer::Format while in transit from event -> update
1189 typedef MessageValue2< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Render::PropertyBuffer::Format> > LocalType;
1191 // Reserve some memory inside the message queue
1192 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1194 // Construct message in the message queue memory; note that delete should not be called on the return value
1195 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferFormat, &propertyBuffer, format );
1198 inline void SetPropertyBufferData( UpdateManager& manager, Render::PropertyBuffer& propertyBuffer, OwnerPointer< Vector<uint8_t> >& data, uint32_t size )
1200 // Message has ownership of PropertyBuffer data while in transit from event -> update
1201 typedef MessageValue3< UpdateManager, Render::PropertyBuffer*, OwnerPointer< Vector<uint8_t> >, uint32_t > LocalType;
1203 // Reserve some memory inside the message queue
1204 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1206 // Construct message in the message queue memory; note that delete should not be called on the return value
1207 new (slot) LocalType( &manager, &UpdateManager::SetPropertyBufferData, &propertyBuffer, data, size );
1210 inline void AddGeometry( UpdateManager& manager, OwnerPointer< Render::Geometry >& geometry )
1212 // Message has ownership of Geometry while in transit from event -> update
1213 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Geometry > > LocalType;
1215 // Reserve some memory inside the message queue
1216 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1218 // Construct message in the message queue memory; note that delete should not be called on the return value
1219 new (slot) LocalType( &manager, &UpdateManager::AddGeometry, geometry );
1222 inline void RemoveGeometry( UpdateManager& manager, Render::Geometry& geometry )
1224 typedef MessageValue1< UpdateManager, Render::Geometry* > LocalType;
1226 // Reserve some memory inside the message queue
1227 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1229 // Construct message in the message queue memory; note that delete should not be called on the return value
1230 new (slot) LocalType( &manager, &UpdateManager::RemoveGeometry, &geometry );
1233 inline void AttachVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1235 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1237 // Reserve some memory inside the message queue
1238 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1240 // Construct message in the message queue memory; note that delete should not be called on the return value
1241 new (slot) LocalType( &manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1244 inline void RemoveVertexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
1246 typedef MessageValue2< UpdateManager, Render::Geometry*, Render::PropertyBuffer* > LocalType;
1248 // Reserve some memory inside the message queue
1249 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1251 // Construct message in the message queue memory; note that delete should not be called on the return value
1252 new (slot) LocalType( &manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::PropertyBuffer*>(&vertexBuffer) );
1255 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1256 template< typename T >
1257 class IndexBufferMessage : public MessageBase
1262 * Constructor which does a Vector::Swap()
1264 IndexBufferMessage( T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices )
1266 mManager( manager ),
1267 mRenderGeometry( geometry )
1269 mIndices.Swap( indices );
1273 * Virtual destructor
1275 virtual ~IndexBufferMessage()
1280 * @copydoc MessageBase::Process
1282 virtual void Process( BufferIndex /*bufferIndex*/ )
1284 DALI_ASSERT_DEBUG( mManager && "Message does not have an object" );
1285 mManager->SetIndexBuffer( mRenderGeometry, mIndices );
1291 Render::Geometry* mRenderGeometry;
1292 Dali::Vector<uint16_t> mIndices;
1295 inline void SetIndexBufferMessage( UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices )
1297 typedef IndexBufferMessage< UpdateManager > LocalType;
1299 // Reserve some memory inside the message queue
1300 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1302 // Construct message in the message queue memory; note that delete should not be called on the return value
1303 new (slot) LocalType( &manager, &geometry, indices );
1306 inline void SetGeometryTypeMessage( UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType )
1308 typedef MessageValue2< UpdateManager, Render::Geometry*, uint32_t > LocalType;
1310 // Reserve some memory inside the message queue
1311 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1313 // Construct message in the message queue memory; note that delete should not be called on the return value
1314 new (slot) LocalType( &manager, &UpdateManager::SetGeometryType, &geometry, geometryType );
1317 inline void AddTexture( UpdateManager& manager, OwnerPointer< Render::Texture >& texture )
1319 // Message has ownership of Texture while in transit from event -> update
1320 typedef MessageValue1< UpdateManager, OwnerPointer< Render::Texture > > LocalType;
1322 // Reserve some memory inside the message queue
1323 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1325 // Construct message in the message queue memory; note that delete should not be called on the return value
1326 new (slot) LocalType( &manager, &UpdateManager::AddTexture, texture );
1329 inline void RemoveTexture( UpdateManager& manager, Render::Texture& texture )
1331 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1333 // Reserve some memory inside the message queue
1334 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1336 // Construct message in the message queue memory; note that delete should not be called on the return value
1337 new (slot) LocalType( &manager, &UpdateManager::RemoveTexture, &texture );
1340 inline void UploadTextureMessage( UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params )
1342 typedef MessageValue3< UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams > LocalType;
1344 // Reserve some memory inside the message queue
1345 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1347 // Construct message in the message queue memory; note that delete should not be called on the return value
1348 new (slot) LocalType( &manager, &UpdateManager::UploadTexture, &texture, pixelData, params );
1351 inline void GenerateMipmapsMessage( UpdateManager& manager, Render::Texture& texture )
1353 typedef MessageValue1< UpdateManager, Render::Texture* > LocalType;
1355 // Reserve some memory inside the message queue
1356 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1358 // Construct message in the message queue memory; note that delete should not be called on the return value
1359 new (slot) LocalType( &manager, &UpdateManager::GenerateMipmaps, &texture );
1363 inline void AddFrameBuffer( UpdateManager& manager, OwnerPointer< Render::FrameBuffer >& frameBuffer )
1365 typedef MessageValue1< UpdateManager, OwnerPointer< Render::FrameBuffer > > LocalType;
1367 // Reserve some memory inside the message queue
1368 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1370 // Construct message in the message queue memory; note that delete should not be called on the return value
1371 new (slot) LocalType( &manager, &UpdateManager::AddFrameBuffer, frameBuffer );
1374 inline void RemoveFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer )
1376 typedef MessageValue1< UpdateManager, Render::FrameBuffer* > LocalType;
1378 // Reserve some memory inside the message queue
1379 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1381 // Construct message in the message queue memory; note that delete should not be called on the return value
1382 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer );
1385 inline void AttachColorTextureToFrameBuffer( UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer )
1387 typedef MessageValue4< UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t > LocalType;
1389 // Reserve some memory inside the message queue
1390 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1392 // Construct message in the message queue memory; note that delete should not be called on the return value
1393 new (slot) LocalType( &manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer );
1396 inline void SetDepthIndicesMessage( UpdateManager& manager, OwnerPointer< NodeDepths >& nodeDepths )
1398 typedef MessageValue1< UpdateManager, OwnerPointer< NodeDepths > > LocalType;
1400 // Reserve some memory inside the message queue
1401 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1403 // Construct message in the message queue memory; note that delete should not be called on the return value
1404 new (slot) LocalType( &manager, &UpdateManager::SetDepthIndices, nodeDepths );
1407 inline void AddResetterMessage( UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter )
1409 typedef MessageValue1< UpdateManager, OwnerPointer<PropertyResetterBase> > LocalType;
1411 // Reserve some memory inside the message queue
1412 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1414 // Construct message in the message queue memory; note that delete should not be called on the return value
1415 new (slot) LocalType( &manager, &UpdateManager::AddPropertyResetter, resetter );
1418 inline void AddFrameCallbackMessage( UpdateManager& manager, OwnerPointer< FrameCallback >& frameCallback, const Node& rootNode )
1420 typedef MessageValue2< UpdateManager, OwnerPointer< FrameCallback >, const Node* > LocalType;
1422 // Reserve some memory inside the message queue
1423 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1425 // Construct message in the message queue memory; note that delete should not be called on the return value
1426 new (slot) LocalType( &manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode );
1429 inline void RemoveFrameCallbackMessage( UpdateManager& manager, FrameCallbackInterface& frameCallback )
1431 typedef MessageValue1< UpdateManager, FrameCallbackInterface* > LocalType;
1433 // Reserve some memory inside the message queue
1434 uint32_t* slot = manager.ReserveMessageSlot( sizeof( LocalType ) );
1436 // Construct message in the message queue memory; note that delete should not be called on the return value
1437 new (slot) LocalType( &manager, &UpdateManager::RemoveFrameCallback, &frameCallback );
1440 } // namespace SceneGraph
1442 } // namespace Internal
1446 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H