1 #ifndef DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
5 * Copyright (c) 2022 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/dali-common.h>
23 #include <dali/public-api/common/vector-wrapper.h>
25 #include <dali/devel-api/common/stage-devel.h>
27 #include <dali/internal/common/message.h>
28 #include <dali/internal/common/shader-saver.h>
29 #include <dali/internal/common/type-abstraction-enums.h>
30 #include <dali/internal/event/common/event-thread-services.h>
31 #include <dali/internal/event/rendering/texture-impl.h>
32 #include <dali/internal/render/renderers/render-texture.h> // For OwnerPointer<Render::Texture>
33 #include <dali/internal/render/renderers/render-vertex-buffer.h>
34 #include <dali/internal/render/shaders/render-shader.h> // for OwnerPointer< Shader >
35 #include <dali/internal/update/animation/scene-graph-animation.h>
36 #include <dali/internal/update/common/node-resetter.h>
37 #include <dali/internal/update/common/property-resetter.h>
38 #include <dali/internal/update/common/scene-graph-buffers.h>
39 #include <dali/internal/update/common/scene-graph-property-notification.h>
40 #include <dali/internal/update/common/scene-graph-scene.h>
41 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
42 #include <dali/internal/update/manager/scene-graph-frame-callback.h> // for OwnerPointer< FrameCallback >
43 #include <dali/internal/update/nodes/node.h>
44 #include <dali/internal/update/nodes/scene-graph-layer.h>
45 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
46 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
47 #include <dali/internal/update/rendering/scene-graph-renderer.h> // for OwnerPointer< Renderer >
48 #include <dali/internal/update/rendering/scene-graph-texture-set.h> // for OwnerPointer< TextureSet >
52 class FrameCallbackInterface;
56 class RenderController;
58 } // namespace Integration
62 class PropertyNotifier;
63 class NotificationManager;
64 class CompleteNotificationInterface;
72 // value types used by messages
74 struct ParameterType<PropertyNotification::NotifyMode>
75 : public BasicType<PropertyNotification::NotifyMode>
85 class RenderTaskProcessor;
90 * UpdateManager maintains a scene graph i.e. a tree of nodes as well as
91 * other scene graph property owning objects.
92 * It controls the Update traversal, in which nodes are repositioned/animated,
93 * and organizes the the culling and rendering of the scene.
94 * It also maintains the lifecycle of nodes and other property owners that are
95 * disconnected from the scene graph.
97 class UpdateManager : public ShaderSaver
101 * Construct a new UpdateManager.
102 * @param[in] notificationManager This should be notified when animations have finished.
103 * @param[in] animationPlaylist The CompleteNotificationInterface that handles the animations
104 * @param[in] propertyNotifier The PropertyNotifier
105 * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
106 * @param[in] controller After messages are flushed, we request a render from the RenderController.
107 * @param[in] renderManager This is responsible for rendering the results of each "update".
108 * @param[in] renderQueue Used to queue messages for the next render.
109 * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
111 UpdateManager(NotificationManager& notificationManager,
112 CompleteNotificationInterface& animationPlaylist,
113 PropertyNotifier& propertyNotifier,
114 DiscardQueue& discardQueue,
115 Integration::RenderController& controller,
116 RenderManager& renderManager,
117 RenderQueue& renderQueue,
118 RenderTaskProcessor& renderTaskProcessor);
123 ~UpdateManager() override;
125 // Node connection methods
128 * Installs a new layer as the root node.
129 * @pre The layer is of derived Node type Layer.
130 * @pre The layer does not have a parent.
131 * @param[in] layer The new root node.
132 * @post The node is owned by UpdateManager.
134 void InstallRoot(OwnerPointer<Layer>& layer);
137 * Uninstalls the root node.
138 * @pre The layer is of derived Node type Layer.
139 * @pre The layer does not have a parent.
140 * @param[in] layer The root node.
141 * @post The node is owned by UpdateManager.
143 void UninstallRoot(Layer* layer);
146 * Add a Node; UpdateManager takes ownership.
147 * @pre The node does not have a parent.
148 * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
149 * @param[in] node The node to add.
151 void AddNode(OwnerPointer<Node>& node);
154 * Connect a Node to the scene-graph.
155 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
156 * @pre The node does not already have a parent.
157 * @param[in] parent The new parent node.
159 void ConnectNode(Node* parent, Node* node);
162 * Disconnect a Node from the scene-graph.
163 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
164 * @pre The node has a parent.
165 * @param[in] node The node to disconnect.
167 void DisconnectNode(Node* node);
170 * Destroy a Node owned by UpdateManager.
171 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
172 * In the following update, the previously queued Nodes may be deleted.
173 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
174 * @param[in] node The node to destroy.
176 void DestroyNode(Node* node);
179 * Add a newly created object.
180 * @param[in] object The object to add.
181 * @post The object is owned by UpdateManager.
183 void AddObject(OwnerPointer<PropertyOwner>& object);
187 * @param[in] object The object to remove.
189 void RemoveObject(PropertyOwner* object);
192 * Add a newly created render task list.
193 * @param[in] taskList The render task list to add.
194 * @post The render task list is owned by UpdateManager.
196 void AddRenderTaskList(OwnerPointer<RenderTaskList>& taskList);
199 * Remove a render task list.
200 * @param[in] taskList The render task list to remove.
202 void RemoveRenderTaskList(RenderTaskList* taskList);
205 * Add a newly created scene.
206 * @param[in] scene The scene to add.
207 * @post The scene is owned by UpdateManager.
209 void AddScene(OwnerPointer<Scene>& scene);
213 * @param[in] scene The scene to remove.
215 void RemoveScene(Scene* scene);
220 * Add a newly created animation.
221 * @param[in] animation The animation to add.
222 * @post The animation is owned by UpdateManager.
224 void AddAnimation(OwnerPointer<SceneGraph::Animation>& animation);
228 * @param[in] animation The animation to stop.
230 void StopAnimation(Animation* animation);
233 * Remove an animation.
234 * @param[in] animation The animation to remove.
236 void RemoveAnimation(Animation* animation);
239 * Query whether any animations are currently running.
240 * @return True if any animations are running.
242 bool IsAnimationRunning() const;
245 * Add a property resetter. UpdateManager takes ownership of the object.
246 * It will be killed by UpdateManager when the associated animator or
247 * constraint has finished; or the property owner of the property is destroyed.
249 void AddPropertyResetter(OwnerPointer<PropertyResetterBase>& propertyResetter);
252 * Add a node resetter. UpdateManager takes ownership of the object.
253 * It will be killed by UpdateManager when the node is disconnected from the scene graph;
254 * or when the node is destroyed.
256 void AddNodeResetter(const Node& node);
258 // Property Notification
261 * Add a newly created property notification
262 * @param[in] propertyNotification The notification to add
263 * @post The propertyNotification is owned by UpdateManager.
265 void AddPropertyNotification(OwnerPointer<PropertyNotification>& propertyNotification);
268 * Remove a property notification
269 * @param[in] propertyNotification The notification to remove
271 void RemovePropertyNotification(PropertyNotification* propertyNotification);
274 * Set Notify state for PropertyNotification
275 * @param[in] propertyNotification The notification to remove
276 * @param[in] notifyMode The notification mode.
278 void PropertyNotificationSetNotify(PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode);
283 * Add a newly created shader.
284 * @param[in] shader The shader to add.
285 * @post The shader is owned by the UpdateManager.
287 void AddShader(OwnerPointer<Shader>& shader);
291 * @pre The shader has been added to the UpdateManager.
292 * @param[in] shader The shader to remove.
293 * @post The shader is destroyed.
295 void RemoveShader(Shader* shader);
298 * Set the shader data for a Shader object
299 * @param[in] shader The shader to modify
300 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
302 void SetShaderData(Shader* shader, Internal::ShaderDataPtr shaderData);
305 * @brief Accept compiled shaders passed back on render thread for saving.
306 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
308 void SaveBinary(Internal::ShaderDataPtr shaderData) override;
311 * @brief Set the destination for compiled shader binaries to be passed on to.
312 * The dispatcher passed in will be called from the update thread.
313 * @param[in] upstream A sink for ShaderDatas to be passed into.
315 void SetShaderSaver(ShaderSaver& upstream);
320 * Add a new renderer to scene
321 * @param renderer to add
323 void AddRenderer(OwnerPointer<Renderer>& renderer);
326 * Add a renderer from scene
327 * @param renderer to remove
329 void RemoveRenderer(Renderer* renderer);
332 * Attach a renderer to node
333 * @param renderer to attach
335 void AttachRenderer(Node* node, Renderer* renderer);
340 * Set the pan gesture processor.
341 * Pan Gesture processor lives for the lifetime of UpdateManager
342 * @param[in] gesture The gesture processor.
343 * @post The gestureProcessor is owned by the UpdateManager.
345 void SetPanGestureProcessor(PanGesture* gestureProcessor);
350 * Add a newly created TextureSet.
351 * @param[in] textureSet The texture set to add.
352 * @post The TextureSet is owned by the UpdateManager.
354 void AddTextureSet(OwnerPointer<TextureSet>& textureSet);
357 * Remove a TextureSet.
358 * @pre The TextureSet has been added to the UpdateManager.
359 * @param[in] textureSet The TextureSet to remove.
360 * @post The TextureSet is destroyed.
362 void RemoveTextureSet(TextureSet* textureSet);
367 * Get the scene graph side list of RenderTasks.
368 * @param[in] systemLevel True if using the system-level overlay.
369 * @return The list of render tasks
371 RenderTaskList* GetRenderTaskList(bool systemLevel);
373 // Message queue handling
376 * Reserve space for another message in the queue; this must then be initialized by the caller.
377 * The message will be read from the update-thread after the next FlushMessages is called.
378 * @post Calling this method may invalidate any previously returned slots.
379 * @param[in] size The message size with respect to the size of type "char".
380 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
381 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
382 * @return A pointer to the first char allocated for the message.
384 uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene = true);
387 * @return the current event-buffer index.
389 BufferIndex GetEventBufferIndex() const
391 // inlined as its called often from event thread
392 return mSceneGraphBuffers.GetEventBufferIndex();
396 * Called by the event-thread to signal that FlushQueue will be called
397 * e.g. when it has finished event processing.
399 void EventProcessingStarted();
402 * Flush the set of messages, which were previously stored with QueueMessage().
403 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
405 * @return True if there are messages to process.
410 * Add a new sampler to RenderManager
411 * @param[in] sampler The sampler to add
412 * @post Sends a message to RenderManager to add the sampler.
413 * The sampler will be owned by RenderManager
415 void AddSampler(OwnerPointer<Render::Sampler>& sampler);
418 * Removes an existing sampler from RenderManager
419 * @param[in] sampler The sampler to remove
420 * @post The sampler will be destroyed in the render thread
422 void RemoveSampler(Render::Sampler* sampler);
425 * Sets the filter modes for an existing sampler
426 * @param[in] sampler The sampler
427 * @param[in] minFilterMode The filter to use under minification
428 * @param[in] magFilterMode The filter to use under magnification
430 void SetFilterMode(Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode);
433 * Sets the wrap mode for an existing sampler
434 * @param[in] sampler The sampler
435 * @param[in] rWrapMode Wrapping mode in z direction
436 * @param[in] sWrapMode Wrapping mode in x direction
437 * @param[in] tWrapMode Wrapping mode in y direction
439 void SetWrapMode(Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode);
442 * Add a new property buffer to RenderManager
443 * @param[in] propertryBuffer The property buffer to add
444 * @post Sends a message to RenderManager to add the property buffer.
445 * The property buffer will be owned by RenderManager
447 void AddVertexBuffer(OwnerPointer<Render::VertexBuffer>& propertryBuffer);
450 * Removes an existing VertexBuffer from RenderManager
451 * @param[in] propertryBuffer The property buffer to remove
452 * @post The property buffer will be destroyed in the render thread
454 void RemoveVertexBuffer(Render::VertexBuffer* propertryBuffer);
457 * Sets the format of an existing property buffer
458 * @param[in] vertexBuffer The property buffer.
459 * @param[in] format The new format of the buffer
460 * @post Sends a message to RenderManager to set the new format to the property buffer.
462 void SetVertexBufferFormat(Render::VertexBuffer* vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format);
465 * Sets the data of an existing property buffer
466 * @param[in] vertexBuffer The property buffer.
467 * @param[in] data The new data of the buffer
468 * @param[in] size The new size of the buffer
469 * @post Sends a message to RenderManager to set the new data to the property buffer.
471 void SetVertexBufferData(Render::VertexBuffer* vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size);
474 * Adds a geometry to the RenderManager
475 * @param[in] geometry The geometry to add
476 * @post Sends a message to RenderManager to add the Geometry
477 * The geometry will be owned by RenderManager
479 void AddGeometry(OwnerPointer<Render::Geometry>& geometry);
482 * Removes an existing Geometry from RenderManager
483 * @param[in] geometry The geometry to remove
484 * @post The geometry will be destroyed in the render thread
486 void RemoveGeometry(Render::Geometry* geometry);
489 * Sets the geometry type of an existing Geometry
490 * @param[in] geometry The geometry
491 * @param[in] geometryType The type of the geometry
493 void SetGeometryType(Render::Geometry* geometry, uint32_t geometryType);
496 * Sets the index buffer to be used by a geometry
497 * @param[in] geometry The geometry
498 * @param[in] indices A vector containing the indices for the geometry
500 void SetIndexBuffer(Render::Geometry* geometry, Dali::Vector<uint16_t>& indices);
503 * Adds a vertex buffer to a geometry
504 * @param[in] geometry The geometry
505 * @param[in] vertexBuffer The property buffer
507 void AttachVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
510 * Removes a vertex buffer from a geometry
511 * @param[in] geometry The geometry
512 * @param[in] vertexBuffer The property buffer
514 void RemoveVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
517 * Adds a texture to the render manager
518 * @param[in] texture The texture to add
519 * The texture will be owned by RenderManager
521 void AddTexture(OwnerPointer<Render::Texture>& texture);
524 * Removes a texture from the render manager
525 * @param[in] texture The texture to remove
526 * @post The texture will be destroyed in the render thread
528 void RemoveTexture(Render::Texture* texture);
531 * Uploads data to a texture owned by the RenderManager
532 * @param[in] texture The texture
533 * @param[in] pixelData The pixel data object
534 * @param[in] params The parameters for the upload
536 void UploadTexture(Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params);
539 * Generates mipmaps for a texture owned by the RenderManager
540 * @param[in] texture The texture
542 void GenerateMipmaps(Render::Texture* texture);
545 * Adds a framebuffer to the render manager
546 * @param[in] frameBuffer The framebuffer to add
547 * The framebuffer will be owned by RenderManager
549 void AddFrameBuffer(OwnerPointer<Render::FrameBuffer>& frameBuffer);
552 * Removes a FrameBuffer from the render manager
553 * @param[in] frameBuffer The FrameBuffer to remove
554 * @post The FrameBuffer will be destroyed in the render thread
556 void RemoveFrameBuffer(Render::FrameBuffer* frameBuffer);
559 * Attach a texture as color output to an existing FrameBuffer
560 * @param[in] frameBuffer The FrameBuffer
561 * @param[in] texture The texture that will be used as output when rendering
562 * @param[in] mipmapLevel The mipmap of the texture to be attached
563 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
565 void AttachColorTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face);
568 * Attach a texture as depth output to an existing FrameBuffer
569 * @param[in] frameBuffer The FrameBuffer
570 * @param[in] texture The texture that will be used as output when rendering
571 * @param[in] mipmapLevel The mipmap of the texture to be attached
573 void AttachDepthTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
576 * Attach a texture as depth/stencil output to an existing FrameBuffer
577 * @param[in] frameBuffer The FrameBuffer
578 * @param[in] texture The texture that will be used as output when rendering
579 * @param[in] mipmapLevel The mipmap of the texture to be attached
581 void AttachDepthStencilTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
584 * Set a multisampling level value as texture output to the existing FrameBuffer
585 * @param[in] frameBuffer The FrameBuffer
586 * @param[in] multiSamplingLevel The level of multisampling
588 void SetMultiSamplingLevelToFrameBuffer(Render::FrameBuffer* frameBuffer, uint8_t multiSamplingLevel);
591 * This is called when the surface of the scene has been replaced.
592 * @param[in] scene The scene.
594 void SurfaceReplaced(Scene* scene);
598 * Performs an Update traversal on the scene-graph.
599 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
600 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
601 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
602 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
603 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
604 * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
605 * @return True if further updates are required e.g. during animations.
607 uint32_t Update(float elapsedSeconds,
608 uint32_t lastVSyncTimeMilliseconds,
609 uint32_t nextVSyncTimeMilliseconds,
610 bool renderToFboEnabled,
611 bool isRenderingToFbo,
615 * This is called after rendering all the scenes in the next frame.
620 * @copydoc Dali::Stage::KeepRendering()
622 void KeepRendering(float durationSeconds);
625 * @copydoc Dali::DevelStage::SetRenderingBehavior()
627 void SetRenderingBehavior(DevelStage::Rendering renderingBehavior);
630 * Request to render the current frame
631 * @note This is a temporary workaround (to be removed in the future) to request the rendering of
632 * the current frame if the color or visibility of any actor is updated. It MUST NOT be used
633 * for any other purposes.
635 void RequestRendering();
638 * Sets the depths of all layers.
639 * @param layers The layers in depth order.
640 * @param[in] rootLayer The root layer of the sorted layers.
642 void SetLayerDepths(const std::vector<Layer*>& layers, const Layer* rootLayer);
645 * Set the depth indices of all nodes (in LayerUI's)
646 * @param[in] nodeDepths A vector of nodes and associated depth indices
648 void SetDepthIndices(OwnerPointer<NodeDepths>& nodeDepths);
651 * Adds an implementation of the FrameCallbackInterface.
652 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
653 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
655 void AddFrameCallback(OwnerPointer<FrameCallback>& frameCallback, const Node* rootNode);
658 * Removes the specified implementation of FrameCallbackInterface.
659 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
661 void RemoveFrameCallback(FrameCallbackInterface* frameCallback);
665 UpdateManager(const UpdateManager&);
668 UpdateManager& operator=(const UpdateManager& rhs);
671 * Add a camera on scene
672 * @param[in] camera The camera to add
674 void AddCamera(Camera* camera);
677 * Remove a camera from scene
678 * @param[in] camera to remove
680 void RemoveCamera(Camera* camera);
683 * Helper to check whether the update-thread should keep going.
684 * @param[in] elapsedSeconds The time in seconds since the previous update.
685 * @return True if the update-thread should keep going.
687 uint32_t KeepUpdatingCheck(float elapsedSeconds) const;
690 * Helper to reset all Node properties
691 * @param[in] bufferIndex to use
693 void ResetProperties(BufferIndex bufferIndex);
696 * Perform gesture updates.
697 * @param[in] bufferIndex to use
698 * @param[in] lastVSyncTime The last VSync time in milliseconds.
699 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
700 * @return true, if any properties were updated.
702 bool ProcessGestures(BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds);
705 * Perform animation updates
706 * @param[in] bufferIndex to use
707 * @param[in] elapsedSeconds time since last frame
708 * @return true if at least one animations is currently active or false otherwise
710 bool Animate(BufferIndex bufferIndex, float elapsedSeconds);
713 * Applies constraints to CustomObjects
714 * @param[in] bufferIndex to use
716 void ConstrainCustomObjects(BufferIndex bufferIndex);
719 * Applies constraints to RenderTasks
720 * @param[in] bufferIndex to use
722 void ConstrainRenderTasks(BufferIndex bufferIndex);
725 * Applies constraints to Shaders
726 * @param[in] bufferIndex to use
728 void ConstrainShaders(BufferIndex bufferIndex);
731 * Perform property notification updates
732 * @param[in] bufferIndex to use
734 void ProcessPropertyNotifications(BufferIndex bufferIndex);
737 * Pass shader binaries queued here on to event thread.
739 void ForwardCompiledShadersToEventThread();
742 * Update node shaders, opacity, geometry etc.
743 * @param[in] bufferIndex to use
745 void UpdateNodes(BufferIndex bufferIndex);
748 * initialize layer renderables
749 * @param[in] bufferIndex
751 void UpdateLayers(BufferIndex bufferIndex);
755 * @param[in] bufferIndex to use
757 void UpdateRenderers(BufferIndex bufferIndex);
760 // needs to be direct member so that getter for event buffer can be inlined
761 SceneGraphBuffers mSceneGraphBuffers;
767 // Messages for UpdateManager
769 inline void InstallRootMessage(UpdateManager& manager, OwnerPointer<Layer>& root)
771 // Message has ownership of Layer while in transit from event -> update
772 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Layer>>;
774 // Reserve some memory inside the message queue
775 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
777 // Construct message in the message queue memory; note that delete should not be called on the return value
778 new(slot) LocalType(&manager, &UpdateManager::InstallRoot, root);
781 inline void UninstallRootMessage(UpdateManager& manager, const Layer* constRoot)
783 // Scene graph thread can destroy this object.
784 Layer* root = const_cast<Layer*>(constRoot);
786 using LocalType = MessageValue1<UpdateManager, Layer*>;
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::UninstallRoot, root);
795 inline void AddNodeMessage(UpdateManager& manager, OwnerPointer<Node>& node)
797 // Message has ownership of Node while in transit from event -> update
798 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Node>>;
800 // Reserve some memory inside the message queue
801 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
803 // Construct message in the message queue memory; note that delete should not be called on the return value
804 new(slot) LocalType(&manager, &UpdateManager::AddNode, node);
807 inline void ConnectNodeMessage(UpdateManager& manager, const Node& constParent, const Node& constChild)
809 // Update thread can edit the object
810 Node& parent = const_cast<Node&>(constParent);
811 Node& child = const_cast<Node&>(constChild);
813 using LocalType = MessageValue2<UpdateManager, Node*, Node*>;
815 // Reserve some memory inside the message queue
816 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
818 // Construct message in the message queue memory; note that delete should not be called on the return value
819 new(slot) LocalType(&manager, &UpdateManager::ConnectNode, &parent, &child);
822 inline void DisconnectNodeMessage(UpdateManager& manager, const Node& constNode)
824 // Scene graph thread can modify this object.
825 Node& node = const_cast<Node&>(constNode);
827 using LocalType = MessageValue1<UpdateManager, Node*>;
829 // Reserve some memory inside the message queue
830 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
832 // Construct message in the message queue memory; note that delete should not be called on the return value
833 new(slot) LocalType(&manager, &UpdateManager::DisconnectNode, &node);
836 inline void DestroyNodeMessage(UpdateManager& manager, const Node& constNode)
838 // Scene graph thread can destroy this object.
839 Node& node = const_cast<Node&>(constNode);
841 using LocalType = MessageValue1<UpdateManager, Node*>;
843 // Reserve some memory inside the message queue
844 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
846 // Construct message in the message queue memory; note that delete should not be called on the return value
847 new(slot) LocalType(&manager, &UpdateManager::DestroyNode, &node);
850 inline void AddObjectMessage(UpdateManager& manager, OwnerPointer<PropertyOwner>& object)
852 // Message has ownership of object while in transit from event -> update
853 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyOwner>>;
855 // Reserve some memory inside the message queue
856 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
858 // Construct message in the message queue memory; note that delete should not be called on the return value
859 new(slot) LocalType(&manager, &UpdateManager::AddObject, object);
862 inline void RemoveObjectMessage(UpdateManager& manager, const PropertyOwner* object)
864 using LocalType = MessageValue1<UpdateManager, PropertyOwner*>;
866 // Reserve some memory inside the message queue
867 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
869 // Construct message in the message queue memory; note that delete should not be called on the return value
870 new(slot) LocalType(&manager, &UpdateManager::RemoveObject, const_cast<PropertyOwner*>(object));
873 inline void AddAnimationMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Animation>& animation)
875 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Animation>>;
877 // Reserve some memory inside the message queue
878 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
880 // Construct message in the message queue memory; note that delete should not be called on the return value
881 new(slot) LocalType(&manager, &UpdateManager::AddAnimation, animation);
884 inline void StopAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
886 // The scene-graph thread owns this object so it can safely edit it.
887 Animation& animation = const_cast<Animation&>(constAnimation);
889 using LocalType = MessageValue1<UpdateManager, Animation*>;
891 // Reserve some memory inside the message queue
892 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
894 // Construct message in the message queue memory; note that delete should not be called on the return value
895 new(slot) LocalType(&manager, &UpdateManager::StopAnimation, &animation);
898 inline void RemoveAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
900 // The scene-graph thread owns this object so it can safely edit it.
901 Animation& animation = const_cast<Animation&>(constAnimation);
903 using LocalType = MessageValue1<UpdateManager, Animation*>;
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::RemoveAnimation, &animation);
912 inline void AddRenderTaskListMessage(UpdateManager& manager, OwnerPointer<SceneGraph::RenderTaskList>& taskList)
914 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::RenderTaskList>>;
916 // Reserve some memory inside the message queue
917 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
919 // Construct message in the message queue memory; note that delete should not be called on the return value
920 new(slot) LocalType(&manager, &UpdateManager::AddRenderTaskList, taskList);
923 inline void RemoveRenderTaskListMessage(UpdateManager& manager, const RenderTaskList& constTaskList)
925 // The scene-graph thread owns this object so it can safely edit it.
926 RenderTaskList& taskList = const_cast<RenderTaskList&>(constTaskList);
928 using LocalType = MessageValue1<UpdateManager, RenderTaskList*>;
930 // Reserve some memory inside the message queue
931 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
933 // Construct message in the message queue memory; note that delete should not be called on the return value
934 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderTaskList, &taskList);
937 inline void AddSceneMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Scene>& scene)
939 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Scene>>;
941 // Reserve some memory inside the message queue
942 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
944 // Construct message in the message queue memory; note that delete should not be called on the return value
945 new(slot) LocalType(&manager, &UpdateManager::AddScene, scene);
948 inline void RemoveSceneMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
950 // The scene-graph thread owns this object so it can safely edit it.
951 Scene& scene = const_cast<Scene&>(constScene);
953 using LocalType = MessageValue1<UpdateManager, Scene*>;
955 // Reserve some memory inside the message queue
956 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
958 // Construct message in the message queue memory; note that delete should not be called on the return value
959 new(slot) LocalType(&manager, &UpdateManager::RemoveScene, &scene);
962 inline void AddPropertyNotificationMessage(UpdateManager& manager, OwnerPointer<PropertyNotification>& propertyNotification)
964 // Message has ownership of PropertyNotification while in transit from event -> update
965 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyNotification>>;
967 // Reserve some memory inside the message queue
968 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
970 // Construct message in the message queue memory; note that delete should not be called on the return value
971 new(slot) LocalType(&manager, &UpdateManager::AddPropertyNotification, propertyNotification);
974 inline void RemovePropertyNotificationMessage(UpdateManager& manager, const PropertyNotification& constPropertyNotification)
976 // The scene-graph thread owns this object so it can safely edit it.
977 PropertyNotification& propertyNotification = const_cast<PropertyNotification&>(constPropertyNotification);
979 using LocalType = MessageValue1<UpdateManager, PropertyNotification*>;
981 // Reserve some memory inside the message queue
982 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
984 // Construct message in the message queue memory; note that delete should not be called on the return value
985 new(slot) LocalType(&manager, &UpdateManager::RemovePropertyNotification, &propertyNotification);
988 inline void PropertyNotificationSetNotifyModeMessage(UpdateManager& manager,
989 const PropertyNotification* constPropertyNotification,
990 PropertyNotification::NotifyMode notifyMode)
992 // The scene-graph thread owns this object so it can safely edit it.
993 PropertyNotification* propertyNotification = const_cast<PropertyNotification*>(constPropertyNotification);
995 using LocalType = MessageValue2<UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode>;
997 // Reserve some memory inside the message queue
998 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1000 // Construct message in the message queue memory; note that delete should not be called on the return value
1001 new(slot) LocalType(&manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode);
1004 // The render thread can safely change the Shader
1005 inline void AddShaderMessage(UpdateManager& manager, OwnerPointer<Shader>& shader)
1007 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Shader>>;
1009 // Reserve some memory inside the message queue
1010 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1012 // Construct message in the message queue memory; note that delete should not be called on the return value
1013 new(slot) LocalType(&manager, &UpdateManager::AddShader, shader);
1016 // The render thread can safely change the Shader
1017 inline void RemoveShaderMessage(UpdateManager& manager, const Shader* shader)
1019 using LocalType = MessageValue1<UpdateManager, Shader*>;
1021 // Reserve some memory inside the message queue
1022 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1024 // Construct message in the message queue memory; note that delete should not be called on the return value
1025 new(slot) LocalType(&manager, &UpdateManager::RemoveShader, const_cast<Shader*>(shader));
1028 inline void SurfaceReplacedMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
1030 // The scene-graph thread owns this object so it can safely edit it.
1031 Scene& scene = const_cast<Scene&>(constScene);
1033 using LocalType = MessageValue1<UpdateManager, Scene*>;
1035 // Reserve some memory inside the message queue
1036 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1038 // Construct message in the message queue memory; note that delete should not be called on the return value
1039 new(slot) LocalType(&manager, &UpdateManager::SurfaceReplaced, &scene);
1042 inline void KeepRenderingMessage(UpdateManager& manager, float durationSeconds)
1044 using LocalType = MessageValue1<UpdateManager, float>;
1046 // Reserve some memory inside the message queue
1047 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1049 // Construct message in the message queue memory; note that delete should not be called on the return value
1050 new(slot) LocalType(&manager, &UpdateManager::KeepRendering, durationSeconds);
1053 inline void SetRenderingBehaviorMessage(UpdateManager& manager, DevelStage::Rendering renderingBehavior)
1055 using LocalType = MessageValue1<UpdateManager, DevelStage::Rendering>;
1057 // Reserve some memory inside the message queue
1058 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1060 // Construct message in the message queue memory; note that delete should not be called on the return value
1061 new(slot) LocalType(&manager, &UpdateManager::SetRenderingBehavior, renderingBehavior);
1064 inline void RequestRenderingMessage(UpdateManager& manager)
1066 using LocalType = Message<UpdateManager>;
1068 // Reserve some memory inside the message queue
1069 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1071 // Construct message in the message queue memory; note that delete should not be called on the return value
1072 new(slot) LocalType(&manager, &UpdateManager::RequestRendering);
1076 * Create a message for setting the depth of a layer
1077 * @param[in] manager The update manager
1078 * @param[in] layers list of layers
1079 * @param[in] rootLayer The rool layer
1081 inline void SetLayerDepthsMessage(UpdateManager& manager, const std::vector<Layer*>& layers, const Layer* rootLayer)
1083 using LocalType = MessageValue2<UpdateManager, std::vector<Layer*>, const Layer*>;
1085 // Reserve some memory inside the message queue
1086 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1088 // Construct message in the message queue memory; note that delete should not be called on the return value
1089 new(slot) LocalType(&manager, &UpdateManager::SetLayerDepths, layers, rootLayer);
1092 inline void AddRendererMessage(UpdateManager& manager, OwnerPointer<Renderer>& object)
1094 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Renderer>>;
1096 // Reserve some memory inside the message queue
1097 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1098 // Construct message in the message queue memory; note that delete should not be called on the return value
1099 new(slot) LocalType(&manager, &UpdateManager::AddRenderer, object);
1102 inline void RemoveRendererMessage(UpdateManager& manager, const Renderer& object)
1104 using LocalType = MessageValue1<UpdateManager, Renderer*>;
1106 // Reserve some memory inside the message queue
1107 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::RemoveRenderer, const_cast<Renderer*>(&object));
1112 inline void AttachRendererMessage(UpdateManager& manager, const Node& node, const Renderer& renderer)
1114 using LocalType = MessageValue2<UpdateManager, Node*, Renderer*>;
1116 // Reserve some memory inside the message queue
1117 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1118 // Construct message in the message queue memory; note that delete should not be called on the return value
1119 new(slot) LocalType(&manager, &UpdateManager::AttachRenderer, const_cast<Node*>(&node), const_cast<Renderer*>(&renderer));
1122 // The render thread can safely change the Shader
1123 inline void AddTextureSetMessage(UpdateManager& manager, OwnerPointer<TextureSet>& textureSet)
1125 using LocalType = MessageValue1<UpdateManager, OwnerPointer<TextureSet>>;
1127 // Reserve some memory inside the message queue
1128 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1130 // Construct message in the message queue memory; note that delete should not be called on the return value
1131 new(slot) LocalType(&manager, &UpdateManager::AddTextureSet, textureSet);
1134 // The render thread can safely change the Shader
1135 inline void RemoveTextureSetMessage(UpdateManager& manager, TextureSet& textureSet)
1137 using LocalType = MessageValue1<UpdateManager, TextureSet*>;
1139 // Reserve some memory inside the message queue
1140 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1142 // Construct message in the message queue memory; note that delete should not be called on the return value
1143 new(slot) LocalType(&manager, &UpdateManager::RemoveTextureSet, &textureSet);
1146 inline void AddSamplerMessage(UpdateManager& manager, OwnerPointer<Render::Sampler>& sampler)
1148 // Message has ownership of Sampler while in transit from event -> update
1149 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Sampler>>;
1151 // Reserve some memory inside the message queue
1152 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1154 // Construct message in the message queue memory; note that delete should not be called on the return value
1155 new(slot) LocalType(&manager, &UpdateManager::AddSampler, sampler);
1158 inline void RemoveSamplerMessage(UpdateManager& manager, Render::Sampler& sampler)
1160 using LocalType = MessageValue1<UpdateManager, Render::Sampler*>;
1162 // Reserve some memory inside the message queue
1163 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1165 // Construct message in the message queue memory; note that delete should not be called on the return value
1166 new(slot) LocalType(&manager, &UpdateManager::RemoveSampler, &sampler);
1169 inline void SetFilterModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode)
1171 using LocalType = MessageValue3<UpdateManager, Render::Sampler*, uint32_t, uint32_t>;
1173 // Reserve some memory inside the message queue
1174 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1176 // Construct message in the message queue memory; note that delete should not be called on the return value
1177 new(slot) LocalType(&manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode);
1180 inline void SetWrapModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode)
1182 using LocalType = MessageValue4<UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t>;
1184 // Reserve some memory inside the message queue
1185 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1187 // Construct message in the message queue memory; note that delete should not be called on the return value
1188 new(slot) LocalType(&manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode);
1191 inline void AddVertexBuffer(UpdateManager& manager, OwnerPointer<Render::VertexBuffer>& vertexBuffer)
1193 // Message has ownership of vertexBuffer while in transit from event -> update
1194 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::VertexBuffer>>;
1196 // Reserve some memory inside the message queue
1197 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1199 // Construct message in the message queue memory; note that delete should not be called on the return value
1200 new(slot) LocalType(&manager, &UpdateManager::AddVertexBuffer, vertexBuffer);
1203 inline void RemoveVertexBuffer(UpdateManager& manager, Render::VertexBuffer& vertexBuffer)
1205 using LocalType = MessageValue1<UpdateManager, Render::VertexBuffer*>;
1207 // Reserve some memory inside the message queue
1208 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1210 // Construct message in the message queue memory; note that delete should not be called on the return value
1211 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &vertexBuffer);
1214 inline void SetVertexBufferFormat(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format)
1216 // Message has ownership of VertexBuffer::Format while in transit from event -> update
1217 using LocalType = MessageValue2<UpdateManager, Render::VertexBuffer*, OwnerPointer<Render::VertexBuffer::Format>>;
1219 // Reserve some memory inside the message queue
1220 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1222 // Construct message in the message queue memory; note that delete should not be called on the return value
1223 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferFormat, &vertexBuffer, format);
1226 inline void SetVertexBufferData(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size)
1228 // Message has ownership of VertexBuffer data while in transit from event -> update
1229 using LocalType = MessageValue3<UpdateManager, Render::VertexBuffer*, OwnerPointer<Vector<uint8_t>>, uint32_t>;
1231 // Reserve some memory inside the message queue
1232 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1234 // Construct message in the message queue memory; note that delete should not be called on the return value
1235 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferData, &vertexBuffer, data, size);
1238 inline void AddGeometry(UpdateManager& manager, OwnerPointer<Render::Geometry>& geometry)
1240 // Message has ownership of Geometry while in transit from event -> update
1241 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Geometry>>;
1243 // Reserve some memory inside the message queue
1244 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1246 // Construct message in the message queue memory; note that delete should not be called on the return value
1247 new(slot) LocalType(&manager, &UpdateManager::AddGeometry, geometry);
1250 inline void RemoveGeometry(UpdateManager& manager, Render::Geometry& geometry)
1252 using LocalType = MessageValue1<UpdateManager, Render::Geometry*>;
1254 // Reserve some memory inside the message queue
1255 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1257 // Construct message in the message queue memory; note that delete should not be called on the return value
1258 new(slot) LocalType(&manager, &UpdateManager::RemoveGeometry, &geometry);
1261 inline void AttachVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1263 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1265 // Reserve some memory inside the message queue
1266 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1268 // Construct message in the message queue memory; note that delete should not be called on the return value
1269 new(slot) LocalType(&manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1272 inline void RemoveVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1274 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1276 // Reserve some memory inside the message queue
1277 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1279 // Construct message in the message queue memory; note that delete should not be called on the return value
1280 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1283 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1284 template<typename T>
1285 class IndexBufferMessage : public MessageBase
1289 * Constructor which does a Vector::Swap()
1291 IndexBufferMessage(T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices)
1294 mRenderGeometry(geometry)
1296 mIndices.Swap(indices);
1300 * Virtual destructor
1302 ~IndexBufferMessage() override = default;
1305 * @copydoc MessageBase::Process
1307 void Process(BufferIndex /*bufferIndex*/) override
1309 DALI_ASSERT_DEBUG(mManager && "Message does not have an object");
1310 mManager->SetIndexBuffer(mRenderGeometry, mIndices);
1315 Render::Geometry* mRenderGeometry;
1316 Dali::Vector<uint16_t> mIndices;
1319 inline void SetIndexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices)
1321 using LocalType = IndexBufferMessage<UpdateManager>;
1323 // Reserve some memory inside the message queue
1324 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1326 // Construct message in the message queue memory; note that delete should not be called on the return value
1327 new(slot) LocalType(&manager, &geometry, indices);
1330 inline void SetGeometryTypeMessage(UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType)
1332 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, uint32_t>;
1334 // Reserve some memory inside the message queue
1335 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1337 // Construct message in the message queue memory; note that delete should not be called on the return value
1338 new(slot) LocalType(&manager, &UpdateManager::SetGeometryType, &geometry, geometryType);
1341 inline void AddTexture(UpdateManager& manager, OwnerPointer<Render::Texture>& texture)
1343 // Message has ownership of Texture while in transit from event -> update
1344 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Texture>>;
1346 // Reserve some memory inside the message queue
1347 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1349 // Construct message in the message queue memory; note that delete should not be called on the return value
1350 new(slot) LocalType(&manager, &UpdateManager::AddTexture, texture);
1353 inline void RemoveTexture(UpdateManager& manager, Render::Texture& texture)
1355 using LocalType = MessageValue1<UpdateManager, Render::Texture*>;
1357 // Reserve some memory inside the message queue
1358 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1360 // Construct message in the message queue memory; note that delete should not be called on the return value
1361 new(slot) LocalType(&manager, &UpdateManager::RemoveTexture, &texture);
1364 inline void UploadTextureMessage(UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params)
1366 using LocalType = MessageValue3<UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams>;
1368 // Reserve some memory inside the message queue
1369 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1371 // Construct message in the message queue memory; note that delete should not be called on the return value
1372 new(slot) LocalType(&manager, &UpdateManager::UploadTexture, &texture, pixelData, params);
1375 inline void GenerateMipmapsMessage(UpdateManager& manager, Render::Texture& texture)
1377 using LocalType = MessageValue1<UpdateManager, Render::Texture*>;
1379 // Reserve some memory inside the message queue
1380 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1382 // Construct message in the message queue memory; note that delete should not be called on the return value
1383 new(slot) LocalType(&manager, &UpdateManager::GenerateMipmaps, &texture);
1386 inline void AddFrameBuffer(UpdateManager& manager, OwnerPointer<Render::FrameBuffer>& frameBuffer)
1388 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::FrameBuffer>>;
1390 // Reserve some memory inside the message queue
1391 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1393 // Construct message in the message queue memory; note that delete should not be called on the return value
1394 new(slot) LocalType(&manager, &UpdateManager::AddFrameBuffer, frameBuffer);
1397 inline void RemoveFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer)
1399 using LocalType = MessageValue1<UpdateManager, Render::FrameBuffer*>;
1401 // Reserve some memory inside the message queue
1402 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1404 // Construct message in the message queue memory; note that delete should not be called on the return value
1405 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer);
1408 inline void AttachColorTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer)
1410 using LocalType = MessageValue4<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t>;
1412 // Reserve some memory inside the message queue
1413 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1415 // Construct message in the message queue memory; note that delete should not be called on the return value
1416 new(slot) LocalType(&manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer);
1419 inline void AttachDepthTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1421 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1423 // Reserve some memory inside the message queue
1424 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1426 // Construct message in the message queue memory; note that delete should not be called on the return value
1427 new(slot) LocalType(&manager, &UpdateManager::AttachDepthTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1430 inline void AttachDepthStencilTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1432 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1434 // Reserve some memory inside the message queue
1435 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1437 // Construct message in the message queue memory; note that delete should not be called on the return value
1438 new(slot) LocalType(&manager, &UpdateManager::AttachDepthStencilTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1441 inline void SetMultiSamplingLevelToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, uint8_t multiSamplingLevel)
1443 using LocalType = MessageValue2<UpdateManager, Render::FrameBuffer*, uint8_t>;
1445 // Reserve some memory inside the message queue
1446 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1448 // Construct message in the message queue memory; note that delete should not be called on the return value
1449 new(slot) LocalType(&manager, &UpdateManager::SetMultiSamplingLevelToFrameBuffer, &frameBuffer, multiSamplingLevel);
1452 inline void SetDepthIndicesMessage(UpdateManager& manager, OwnerPointer<NodeDepths>& nodeDepths)
1454 using LocalType = MessageValue1<UpdateManager, OwnerPointer<NodeDepths>>;
1456 // Reserve some memory inside the message queue
1457 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1459 // Construct message in the message queue memory; note that delete should not be called on the return value
1460 new(slot) LocalType(&manager, &UpdateManager::SetDepthIndices, nodeDepths);
1463 inline void AddResetterMessage(UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter)
1465 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyResetterBase>>;
1467 // Reserve some memory inside the message queue
1468 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1470 // Construct message in the message queue memory; note that delete should not be called on the return value
1471 new(slot) LocalType(&manager, &UpdateManager::AddPropertyResetter, resetter);
1474 inline void AddFrameCallbackMessage(UpdateManager& manager, OwnerPointer<FrameCallback>& frameCallback, const Node& rootNode)
1476 using LocalType = MessageValue2<UpdateManager, OwnerPointer<FrameCallback>, const Node*>;
1478 // Reserve some memory inside the message queue
1479 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1481 // Construct message in the message queue memory; note that delete should not be called on the return value
1482 new(slot) LocalType(&manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode);
1485 inline void RemoveFrameCallbackMessage(UpdateManager& manager, FrameCallbackInterface& frameCallback)
1487 using LocalType = MessageValue1<UpdateManager, FrameCallbackInterface*>;
1489 // Reserve some memory inside the message queue
1490 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1492 // Construct message in the message queue memory; note that delete should not be called on the return value
1493 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameCallback, &frameCallback);
1496 } // namespace SceneGraph
1498 } // namespace Internal
1502 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H