1 #ifndef DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
5 * Copyright (c) 2023 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-key.h> // For RenderTextureKey
33 #include <dali/internal/render/renderers/render-texture.h> // For OwnerPointer<Render::Texture>
34 #include <dali/internal/render/renderers/render-vertex-buffer.h>
35 #include <dali/internal/render/shaders/render-shader.h> // for OwnerPointer< Shader >
36 #include <dali/internal/update/animation/scene-graph-animation.h>
37 #include <dali/internal/update/common/node-resetter.h>
38 #include <dali/internal/update/common/property-resetter.h>
39 #include <dali/internal/update/common/scene-graph-buffers.h>
40 #include <dali/internal/update/common/scene-graph-property-notification.h>
41 #include <dali/internal/update/common/scene-graph-scene.h>
42 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
43 #include <dali/internal/update/manager/scene-graph-frame-callback.h> // for OwnerPointer< FrameCallback >
44 #include <dali/internal/update/nodes/node.h>
45 #include <dali/internal/update/nodes/scene-graph-layer.h>
46 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
47 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
48 #include <dali/internal/update/rendering/scene-graph-renderer.h> // for OwnerPointer< Renderer >
49 #include <dali/internal/update/rendering/scene-graph-texture-set.h> // for OwnerPointer< TextureSet >
56 class FrameCallbackInterface;
60 class RenderController;
62 } // namespace Integration
66 class PropertyNotifier;
67 class NotificationManager;
68 class CompleteNotificationInterface;
76 // value types used by messages
78 struct ParameterType<PropertyNotification::NotifyMode>
79 : public BasicType<PropertyNotification::NotifyMode>
88 class RenderTaskProcessor;
93 * UpdateManager maintains a scene graph i.e. a tree of nodes as well as
94 * other scene graph property owning objects.
95 * It controls the Update traversal, in which nodes are repositioned/animated,
96 * and organizes the the culling and rendering of the scene.
97 * It also maintains the lifecycle of nodes and other property owners that are
98 * disconnected from the scene graph.
100 class UpdateManager : public ShaderSaver
104 * Construct a new UpdateManager.
105 * @param[in] notificationManager This should be notified when animations have finished.
106 * @param[in] animationPlaylist The CompleteNotificationInterface that handles the animations
107 * @param[in] propertyNotifier The PropertyNotifier
108 * @param[in] controller After messages are flushed, we request a render from the RenderController.
109 * @param[in] renderManager This is responsible for rendering the results of each "update".
110 * @param[in] renderQueue Used to queue messages for the next render.
111 * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
113 UpdateManager(NotificationManager& notificationManager,
114 CompleteNotificationInterface& animationPlaylist,
115 PropertyNotifier& propertyNotifier,
116 Integration::RenderController& controller,
117 RenderManager& renderManager,
118 RenderQueue& renderQueue,
119 RenderTaskProcessor& renderTaskProcessor);
124 ~UpdateManager() override;
126 // Node connection methods
129 * Installs a new layer as the root node.
130 * @pre The layer is of derived Node type Layer.
131 * @pre The layer does not have a parent.
132 * @param[in] layer The new root node.
133 * @post The node is owned by UpdateManager.
135 void InstallRoot(OwnerPointer<Layer>& layer);
138 * Uninstalls the root node.
139 * @pre The layer is of derived Node type Layer.
140 * @pre The layer does not have a parent.
141 * @param[in] layer The root node.
142 * @post The node is owned by UpdateManager.
144 void UninstallRoot(Layer* layer);
147 * Add a Node; UpdateManager takes ownership.
148 * @pre The node does not have a parent.
149 * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
150 * @param[in] node The node to add.
152 void AddNode(OwnerPointer<Node>& node);
155 * Connect a Node to the scene-graph.
156 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
157 * @pre The node does not already have a parent.
158 * @param[in] parent The new parent node.
160 void ConnectNode(Node* parent, Node* node);
163 * Disconnect a Node from the scene-graph.
164 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
165 * @pre The node has a parent.
166 * @param[in] node The node to disconnect.
168 void DisconnectNode(Node* node);
171 * Destroy a Node owned by UpdateManager.
172 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
173 * In the following update, the previously queued Nodes may be deleted.
174 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
175 * @param[in] node The node to destroy.
177 void DestroyNode(Node* node);
180 * Add a newly created object.
181 * @param[in] object The object to add.
182 * @post The object is owned by UpdateManager.
184 void AddObject(OwnerPointer<PropertyOwner>& object);
188 * @param[in] object The object to remove.
190 void RemoveObject(PropertyOwner* object);
193 * Add a newly created render task list.
194 * @param[in] taskList The render task list to add.
195 * @post The render task list is owned by UpdateManager.
197 void AddRenderTaskList(OwnerPointer<RenderTaskList>& taskList);
200 * Remove a render task list.
201 * @param[in] taskList The render task list to remove.
203 void RemoveRenderTaskList(RenderTaskList* taskList);
206 * Add a newly created scene.
207 * @param[in] scene The scene to add.
208 * @post The scene is owned by UpdateManager.
210 void AddScene(OwnerPointer<Scene>& scene);
214 * @param[in] scene The scene to remove.
216 void RemoveScene(Scene* scene);
221 * Add a newly created animation.
222 * @param[in] animation The animation to add.
223 * @post The animation is owned by UpdateManager.
225 void AddAnimation(OwnerPointer<SceneGraph::Animation>& animation);
229 * @param[in] animation The animation to stop.
231 void StopAnimation(Animation* animation);
234 * Remove an animation.
235 * @param[in] animation The animation to remove.
237 void RemoveAnimation(Animation* animation);
240 * Query whether any animations are currently running.
241 * @return True if any animations are running.
243 bool IsAnimationRunning() const;
246 * Add a property resetter. UpdateManager takes ownership of the object.
247 * It will be killed by UpdateManager when the associated animator or
248 * constraint has finished; or the property owner of the property is destroyed.
250 void AddPropertyResetter(OwnerPointer<PropertyResetterBase>& propertyResetter);
253 * Add a node resetter. UpdateManager takes ownership of the object.
254 * It will be killed by UpdateManager when the node is disconnected from the scene graph;
255 * or when the node is destroyed.
257 void AddNodeResetter(const Node& node);
259 // Property Notification
262 * Add a newly created property notification
263 * @param[in] propertyNotification The notification to add
264 * @post The propertyNotification is owned by UpdateManager.
266 void AddPropertyNotification(OwnerPointer<PropertyNotification>& propertyNotification);
269 * Remove a property notification
270 * @param[in] propertyNotification The notification to remove
272 void RemovePropertyNotification(PropertyNotification* propertyNotification);
275 * Set Notify state for PropertyNotification
276 * @param[in] propertyNotification The notification to remove
277 * @param[in] notifyMode The notification mode.
279 void PropertyNotificationSetNotify(PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode);
284 * Add a newly created shader.
285 * @param[in] shader The shader to add.
286 * @post The shader is owned by the UpdateManager.
288 void AddShader(OwnerPointer<Shader>& shader);
292 * @pre The shader has been added to the UpdateManager.
293 * @param[in] shader The shader to remove.
294 * @post The shader is destroyed.
296 void RemoveShader(Shader* shader);
299 * Set the shader data for a Shader object
300 * @param[in] shader The shader to modify
301 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
303 void SetShaderData(Shader* shader, Internal::ShaderDataPtr shaderData);
306 * @brief Accept compiled shaders passed back on render thread for saving.
307 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
309 void SaveBinary(Internal::ShaderDataPtr shaderData) override;
312 * @brief Set the destination for compiled shader binaries to be passed on to.
313 * The dispatcher passed in will be called from the update thread.
314 * @param[in] upstream A sink for ShaderDatas to be passed into.
316 void SetShaderSaver(ShaderSaver& upstream);
321 * Add a new renderer to scene
322 * @param renderer to add
324 void AddRenderer(const RendererKey& renderer);
327 * Remove a renderer from scene
328 * @param renderer to remove
330 void RemoveRenderer(const RendererKey& renderer);
333 * Attach a renderer to node
334 * @param renderer to attach
336 void AttachRenderer(Node* node, Renderer* renderer);
341 * Set the pan gesture processor.
342 * Pan Gesture processor lives for the lifetime of UpdateManager
343 * @param[in] gesture The gesture processor.
344 * @post The gestureProcessor is owned by the UpdateManager.
346 void SetPanGestureProcessor(PanGesture* gestureProcessor);
351 * Add a newly created TextureSet.
352 * @param[in] textureSet The texture set to add.
353 * @post The TextureSet is owned by the UpdateManager.
355 void AddTextureSet(OwnerPointer<TextureSet>& textureSet);
358 * Remove a TextureSet.
359 * @pre The TextureSet has been added to the UpdateManager.
360 * @param[in] textureSet The TextureSet to remove.
361 * @post The TextureSet is destroyed.
363 void RemoveTextureSet(TextureSet* textureSet);
368 * Get the scene graph side list of RenderTasks.
369 * @param[in] systemLevel True if using the system-level overlay.
370 * @return The list of render tasks
372 RenderTaskList* GetRenderTaskList(bool systemLevel);
374 // Message queue handling
377 * Reserve space for another message in the queue; this must then be initialized by the caller.
378 * The message will be read from the update-thread after the next FlushMessages is called.
379 * @post Calling this method may invalidate any previously returned slots.
380 * @param[in] size The message size with respect to the size of type "char".
381 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
382 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
383 * @return A pointer to the first char allocated for the message.
385 uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene = true);
388 * @return the current event-buffer index.
390 BufferIndex GetEventBufferIndex() const
392 // inlined as its called often from event thread
393 return mSceneGraphBuffers.GetEventBufferIndex();
397 * Called by the event-thread to signal that FlushQueue will be called
398 * e.g. when it has finished event processing.
400 void EventProcessingStarted();
403 * Flush the set of messages, which were previously stored with QueueMessage().
404 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
406 * @return True if there are messages to process.
411 * Add a new sampler to RenderManager
412 * @param[in] sampler The sampler to add
413 * @post Sends a message to RenderManager to add the sampler.
414 * The sampler will be owned by RenderManager
416 void AddSampler(OwnerPointer<Render::Sampler>& sampler);
419 * Removes an existing sampler from RenderManager
420 * @param[in] sampler The sampler to remove
421 * @post The sampler will be destroyed in the render thread
423 void RemoveSampler(Render::Sampler* sampler);
426 * Sets the filter modes for an existing sampler
427 * @param[in] sampler The sampler
428 * @param[in] minFilterMode The filter to use under minification
429 * @param[in] magFilterMode The filter to use under magnification
431 void SetFilterMode(Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode);
434 * Sets the wrap mode for an existing sampler
435 * @param[in] sampler The sampler
436 * @param[in] rWrapMode Wrapping mode in z direction
437 * @param[in] sWrapMode Wrapping mode in x direction
438 * @param[in] tWrapMode Wrapping mode in y direction
440 void SetWrapMode(Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode);
443 * Add a new property buffer to RenderManager
444 * @param[in] propertryBuffer The property buffer to add
445 * @post Sends a message to RenderManager to add the property buffer.
446 * The property buffer will be owned by RenderManager
448 void AddVertexBuffer(OwnerPointer<Render::VertexBuffer>& propertryBuffer);
451 * Removes an existing VertexBuffer from RenderManager
452 * @param[in] propertryBuffer The property buffer to remove
453 * @post The property buffer will be destroyed in the render thread
455 void RemoveVertexBuffer(Render::VertexBuffer* propertryBuffer);
458 * Sets the format of an existing property buffer
459 * @param[in] vertexBuffer The property buffer.
460 * @param[in] format The new format of the buffer
461 * @post Sends a message to RenderManager to set the new format to the property buffer.
463 void SetVertexBufferFormat(Render::VertexBuffer* vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format);
466 * Sets the data of an existing property buffer
467 * @param[in] vertexBuffer The property buffer.
468 * @param[in] data The new data of the buffer
469 * @param[in] size The new size of the buffer
470 * @post Sends a message to RenderManager to set the new data to the property buffer.
472 void SetVertexBufferData(Render::VertexBuffer* vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size);
475 * Adds a geometry to the RenderManager
476 * @param[in] geometry The geometry to add
477 * @post Sends a message to RenderManager to add the Geometry
478 * The geometry will be owned by RenderManager
480 void AddGeometry(OwnerPointer<Render::Geometry>& geometry);
483 * Removes an existing Geometry from RenderManager
484 * @param[in] geometry The geometry to remove
485 * @post The geometry will be destroyed in the render thread
487 void RemoveGeometry(Render::Geometry* geometry);
490 * Sets the geometry type of an existing Geometry
491 * @param[in] geometry The geometry
492 * @param[in] geometryType The type of the geometry
494 void SetGeometryType(Render::Geometry* geometry, uint32_t geometryType);
497 * Sets the index buffer to be used by a geometry
498 * @param[in] geometry The geometry
499 * @param[in] indices A vector containing the indices for the geometry
501 void SetIndexBuffer(Render::Geometry* geometry, Dali::Vector<uint16_t>& indices);
504 * Adds a vertex buffer to a geometry
505 * @param[in] geometry The geometry
506 * @param[in] vertexBuffer The property buffer
508 void AttachVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
511 * Removes a vertex buffer from a geometry
512 * @param[in] geometry The geometry
513 * @param[in] vertexBuffer The property buffer
515 void RemoveVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
518 * Adds a texture to the render manager
519 * @param[in] texture The texture to add
520 * The texture will be owned by RenderManager
522 void AddTexture(const Render::TextureKey& texture);
525 * Removes a texture from the render manager
526 * @param[in] texture The texture to remove
527 * @post The texture will be destroyed in the render thread
529 void RemoveTexture(const Render::TextureKey& texture);
532 * Uploads data to a texture owned by the RenderManager
533 * @param[in] texture The texture
534 * @param[in] pixelData The pixel data object
535 * @param[in] params The parameters for the upload
537 void UploadTexture(const Render::TextureKey& texture, PixelDataPtr pixelData, const Texture::UploadParams& params);
540 * Generates mipmaps for a texture owned by the RenderManager
541 * @param[in] texture The texture
543 void GenerateMipmaps(const Render::TextureKey& texture);
546 * Adds a framebuffer to the render manager
547 * @param[in] frameBuffer The framebuffer to add
548 * The framebuffer will be owned by RenderManager
550 void AddFrameBuffer(OwnerPointer<Render::FrameBuffer>& frameBuffer);
553 * Removes a FrameBuffer from the render manager
554 * @param[in] frameBuffer The FrameBuffer to remove
555 * @post The FrameBuffer will be destroyed in the render thread
557 void RemoveFrameBuffer(Render::FrameBuffer* frameBuffer);
560 * Attach a texture as color output to an existing FrameBuffer
561 * @param[in] frameBuffer The FrameBuffer
562 * @param[in] texture The texture that will be used as output when rendering
563 * @param[in] mipmapLevel The mipmap of the texture to be attached
564 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
566 void AttachColorTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face);
569 * Attach a texture as depth output to an existing FrameBuffer
570 * @param[in] frameBuffer The FrameBuffer
571 * @param[in] texture The texture that will be used as output when rendering
572 * @param[in] mipmapLevel The mipmap of the texture to be attached
574 void AttachDepthTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
577 * Attach a texture as depth/stencil output to an existing FrameBuffer
578 * @param[in] frameBuffer The FrameBuffer
579 * @param[in] texture The texture that will be used as output when rendering
580 * @param[in] mipmapLevel The mipmap of the texture to be attached
582 void AttachDepthStencilTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
585 * Set a multisampling level value as texture output to the existing FrameBuffer
586 * @param[in] frameBuffer The FrameBuffer
587 * @param[in] multiSamplingLevel The level of multisampling
589 void SetMultiSamplingLevelToFrameBuffer(Render::FrameBuffer* frameBuffer, uint8_t multiSamplingLevel);
592 * This is called when the surface of the scene has been replaced.
593 * @param[in] scene The scene.
595 void SurfaceReplaced(Scene* scene);
599 * Performs an Update traversal on the scene-graph.
600 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
601 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
602 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
603 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
604 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
605 * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
606 * @return True if further updates are required e.g. during animations.
608 uint32_t Update(float elapsedSeconds,
609 uint32_t lastVSyncTimeMilliseconds,
610 uint32_t nextVSyncTimeMilliseconds,
611 bool renderToFboEnabled,
612 bool isRenderingToFbo,
616 * This is called after rendering all the scenes in the next frame.
621 * @copydoc Dali::Stage::KeepRendering()
623 void KeepRendering(float durationSeconds);
626 * @copydoc Dali::DevelStage::SetRenderingBehavior()
628 void SetRenderingBehavior(DevelStage::Rendering renderingBehavior);
631 * Request to render the current frame
632 * @note This is a temporary workaround (to be removed in the future) to request the rendering of
633 * the current frame if the color or visibility of any actor is updated. It MUST NOT be used
634 * for any other purposes.
636 void RequestRendering();
639 * Sets the depths of all layers.
640 * @param layers The layers in depth order.
641 * @param[in] rootLayer The root layer of the sorted layers.
643 void SetLayerDepths(const std::vector<Layer*>& layers, const Layer* rootLayer);
646 * Set the depth indices of all nodes (in LayerUI's)
647 * @param[in] nodeDepths A vector of nodes and associated depth indices
649 void SetDepthIndices(OwnerPointer<NodeDepths>& nodeDepths);
652 * Adds an implementation of the FrameCallbackInterface.
653 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
654 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
656 void AddFrameCallback(OwnerPointer<FrameCallback>& frameCallback, const Node* rootNode);
659 * Removes the specified implementation of FrameCallbackInterface.
660 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
662 void RemoveFrameCallback(FrameCallbackInterface* frameCallback);
665 * Get the update message queue capacity (mutex locked)
667 std::size_t GetUpdateMessageQueueCapacity() const;
670 * Get the render message queue capacity
672 std::size_t GetRenderMessageQueueCapacity() const;
675 * Get the render instruction capacity
677 std::size_t GetRenderInstructionCapacity() const;
681 UpdateManager(const UpdateManager&);
684 UpdateManager& operator=(const UpdateManager& rhs);
687 * Add a camera on scene
688 * @param[in] camera The camera to add
690 void AddCamera(Camera* camera);
693 * Remove a camera from scene
694 * @param[in] camera to remove
696 void RemoveCamera(Camera* camera);
699 * Helper to check whether the update-thread should keep going.
700 * @param[in] elapsedSeconds The time in seconds since the previous update.
701 * @return True if the update-thread should keep going.
703 uint32_t KeepUpdatingCheck(float elapsedSeconds) const;
706 * Helper to reset all Node properties
707 * @param[in] bufferIndex to use
709 void ResetProperties(BufferIndex bufferIndex);
712 * Perform gesture updates.
713 * @param[in] bufferIndex to use
714 * @param[in] lastVSyncTime The last VSync time in milliseconds.
715 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
716 * @return true, if any properties were updated.
718 bool ProcessGestures(BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds);
721 * Perform animation updates
722 * @param[in] bufferIndex to use
723 * @param[in] elapsedSeconds time since last frame
724 * @return true if at least one animations is currently active or false otherwise
726 bool Animate(BufferIndex bufferIndex, float elapsedSeconds);
729 * Applies constraints to CustomObjects
730 * @param[in] bufferIndex to use
732 void ConstrainCustomObjects(BufferIndex bufferIndex);
735 * Applies constraints to RenderTasks
736 * @param[in] bufferIndex to use
738 void ConstrainRenderTasks(BufferIndex bufferIndex);
741 * Applies constraints to Shaders
742 * @param[in] bufferIndex to use
744 void ConstrainShaders(BufferIndex bufferIndex);
747 * Perform property notification updates
748 * @param[in] bufferIndex to use
750 void ProcessPropertyNotifications(BufferIndex bufferIndex);
753 * Pass shader binaries queued here on to event thread.
755 void ForwardCompiledShadersToEventThread();
758 * Update node shaders, opacity, geometry etc.
759 * @param[in] bufferIndex to use
761 void UpdateNodes(BufferIndex bufferIndex);
764 * initialize layer renderables
765 * @param[in] bufferIndex
767 void UpdateLayers(BufferIndex bufferIndex);
771 * @param[in] bufferIndex to use
773 void UpdateRenderers(BufferIndex bufferIndex);
776 // needs to be direct member so that getter for event buffer can be inlined
777 SceneGraphBuffers mSceneGraphBuffers;
783 // Messages for UpdateManager
785 inline void InstallRootMessage(UpdateManager& manager, OwnerPointer<Layer>& root)
787 // Message has ownership of Layer while in transit from event -> update
788 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Layer>>;
790 // Reserve some memory inside the message queue
791 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
793 // Construct message in the message queue memory; note that delete should not be called on the return value
794 new(slot) LocalType(&manager, &UpdateManager::InstallRoot, root);
797 inline void UninstallRootMessage(UpdateManager& manager, const Layer* constRoot)
799 // Scene graph thread can destroy this object.
800 Layer* root = const_cast<Layer*>(constRoot);
802 using LocalType = MessageValue1<UpdateManager, Layer*>;
804 // Reserve some memory inside the message queue
805 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
807 // Construct message in the message queue memory; note that delete should not be called on the return value
808 new(slot) LocalType(&manager, &UpdateManager::UninstallRoot, root);
811 inline void AddNodeMessage(UpdateManager& manager, OwnerPointer<Node>& node)
813 // Message has ownership of Node while in transit from event -> update
814 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Node>>;
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::AddNode, node);
823 inline void ConnectNodeMessage(UpdateManager& manager, const Node& constParent, const Node& constChild)
825 // Update thread can edit the object
826 Node& parent = const_cast<Node&>(constParent);
827 Node& child = const_cast<Node&>(constChild);
829 using LocalType = MessageValue2<UpdateManager, Node*, Node*>;
831 // Reserve some memory inside the message queue
832 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
834 // Construct message in the message queue memory; note that delete should not be called on the return value
835 new(slot) LocalType(&manager, &UpdateManager::ConnectNode, &parent, &child);
838 inline void DisconnectNodeMessage(UpdateManager& manager, const Node& constNode)
840 // Scene graph thread can modify this object.
841 Node& node = const_cast<Node&>(constNode);
843 using LocalType = MessageValue1<UpdateManager, Node*>;
845 // Reserve some memory inside the message queue
846 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
848 // Construct message in the message queue memory; note that delete should not be called on the return value
849 new(slot) LocalType(&manager, &UpdateManager::DisconnectNode, &node);
852 inline void DestroyNodeMessage(UpdateManager& manager, const Node& constNode)
854 // Scene graph thread can destroy this object.
855 Node& node = const_cast<Node&>(constNode);
857 using LocalType = MessageValue1<UpdateManager, Node*>;
859 // Reserve some memory inside the message queue
860 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
862 // Construct message in the message queue memory; note that delete should not be called on the return value
863 new(slot) LocalType(&manager, &UpdateManager::DestroyNode, &node);
866 inline void AddObjectMessage(UpdateManager& manager, OwnerPointer<PropertyOwner>& object)
868 // Message has ownership of object while in transit from event -> update
869 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyOwner>>;
871 // Reserve some memory inside the message queue
872 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
874 // Construct message in the message queue memory; note that delete should not be called on the return value
875 new(slot) LocalType(&manager, &UpdateManager::AddObject, object);
878 inline void RemoveObjectMessage(UpdateManager& manager, const PropertyOwner* object)
880 using LocalType = MessageValue1<UpdateManager, PropertyOwner*>;
882 // Reserve some memory inside the message queue
883 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
885 // Construct message in the message queue memory; note that delete should not be called on the return value
886 new(slot) LocalType(&manager, &UpdateManager::RemoveObject, const_cast<PropertyOwner*>(object));
889 inline void AddAnimationMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Animation>& animation)
891 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Animation>>;
893 // Reserve some memory inside the message queue
894 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
896 // Construct message in the message queue memory; note that delete should not be called on the return value
897 new(slot) LocalType(&manager, &UpdateManager::AddAnimation, animation);
900 inline void StopAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
902 // The scene-graph thread owns this object so it can safely edit it.
903 Animation& animation = const_cast<Animation&>(constAnimation);
905 using LocalType = MessageValue1<UpdateManager, Animation*>;
907 // Reserve some memory inside the message queue
908 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
910 // Construct message in the message queue memory; note that delete should not be called on the return value
911 new(slot) LocalType(&manager, &UpdateManager::StopAnimation, &animation);
914 inline void RemoveAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
916 // The scene-graph thread owns this object so it can safely edit it.
917 Animation& animation = const_cast<Animation&>(constAnimation);
919 using LocalType = MessageValue1<UpdateManager, Animation*>;
921 // Reserve some memory inside the message queue
922 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
924 // Construct message in the message queue memory; note that delete should not be called on the return value
925 new(slot) LocalType(&manager, &UpdateManager::RemoveAnimation, &animation);
928 inline void AddRenderTaskListMessage(UpdateManager& manager, OwnerPointer<SceneGraph::RenderTaskList>& taskList)
930 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::RenderTaskList>>;
932 // Reserve some memory inside the message queue
933 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
935 // Construct message in the message queue memory; note that delete should not be called on the return value
936 new(slot) LocalType(&manager, &UpdateManager::AddRenderTaskList, taskList);
939 inline void RemoveRenderTaskListMessage(UpdateManager& manager, const RenderTaskList& constTaskList)
941 // The scene-graph thread owns this object so it can safely edit it.
942 RenderTaskList& taskList = const_cast<RenderTaskList&>(constTaskList);
944 using LocalType = MessageValue1<UpdateManager, RenderTaskList*>;
946 // Reserve some memory inside the message queue
947 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
949 // Construct message in the message queue memory; note that delete should not be called on the return value
950 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderTaskList, &taskList);
953 inline void AddSceneMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Scene>& scene)
955 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Scene>>;
957 // Reserve some memory inside the message queue
958 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
960 // Construct message in the message queue memory; note that delete should not be called on the return value
961 new(slot) LocalType(&manager, &UpdateManager::AddScene, scene);
964 inline void RemoveSceneMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
966 // The scene-graph thread owns this object so it can safely edit it.
967 Scene& scene = const_cast<Scene&>(constScene);
969 using LocalType = MessageValue1<UpdateManager, Scene*>;
971 // Reserve some memory inside the message queue
972 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
974 // Construct message in the message queue memory; note that delete should not be called on the return value
975 new(slot) LocalType(&manager, &UpdateManager::RemoveScene, &scene);
978 inline void AddPropertyNotificationMessage(UpdateManager& manager, OwnerPointer<PropertyNotification>& propertyNotification)
980 // Message has ownership of PropertyNotification while in transit from event -> update
981 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyNotification>>;
983 // Reserve some memory inside the message queue
984 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
986 // Construct message in the message queue memory; note that delete should not be called on the return value
987 new(slot) LocalType(&manager, &UpdateManager::AddPropertyNotification, propertyNotification);
990 inline void RemovePropertyNotificationMessage(UpdateManager& manager, const PropertyNotification& constPropertyNotification)
992 // The scene-graph thread owns this object so it can safely edit it.
993 PropertyNotification& propertyNotification = const_cast<PropertyNotification&>(constPropertyNotification);
995 using LocalType = MessageValue1<UpdateManager, PropertyNotification*>;
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::RemovePropertyNotification, &propertyNotification);
1004 inline void PropertyNotificationSetNotifyModeMessage(UpdateManager& manager,
1005 const PropertyNotification* constPropertyNotification,
1006 PropertyNotification::NotifyMode notifyMode)
1008 // The scene-graph thread owns this object so it can safely edit it.
1009 PropertyNotification* propertyNotification = const_cast<PropertyNotification*>(constPropertyNotification);
1011 using LocalType = MessageValue2<UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode>;
1013 // Reserve some memory inside the message queue
1014 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1016 // Construct message in the message queue memory; note that delete should not be called on the return value
1017 new(slot) LocalType(&manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode);
1020 // The render thread can safely change the Shader
1021 inline void AddShaderMessage(UpdateManager& manager, OwnerPointer<Shader>& shader)
1023 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Shader>>;
1025 // Reserve some memory inside the message queue
1026 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1028 // Construct message in the message queue memory; note that delete should not be called on the return value
1029 new(slot) LocalType(&manager, &UpdateManager::AddShader, shader);
1032 // The render thread can safely change the Shader
1033 inline void RemoveShaderMessage(UpdateManager& manager, const Shader* shader)
1035 using LocalType = MessageValue1<UpdateManager, Shader*>;
1037 // Reserve some memory inside the message queue
1038 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1040 // Construct message in the message queue memory; note that delete should not be called on the return value
1041 new(slot) LocalType(&manager, &UpdateManager::RemoveShader, const_cast<Shader*>(shader));
1044 inline void SurfaceReplacedMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
1046 // The scene-graph thread owns this object so it can safely edit it.
1047 Scene& scene = const_cast<Scene&>(constScene);
1049 using LocalType = MessageValue1<UpdateManager, Scene*>;
1051 // Reserve some memory inside the message queue
1052 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1054 // Construct message in the message queue memory; note that delete should not be called on the return value
1055 new(slot) LocalType(&manager, &UpdateManager::SurfaceReplaced, &scene);
1058 inline void KeepRenderingMessage(UpdateManager& manager, float durationSeconds)
1060 using LocalType = MessageValue1<UpdateManager, float>;
1062 // Reserve some memory inside the message queue
1063 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1065 // Construct message in the message queue memory; note that delete should not be called on the return value
1066 new(slot) LocalType(&manager, &UpdateManager::KeepRendering, durationSeconds);
1069 inline void SetRenderingBehaviorMessage(UpdateManager& manager, DevelStage::Rendering renderingBehavior)
1071 using LocalType = MessageValue1<UpdateManager, DevelStage::Rendering>;
1073 // Reserve some memory inside the message queue
1074 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1076 // Construct message in the message queue memory; note that delete should not be called on the return value
1077 new(slot) LocalType(&manager, &UpdateManager::SetRenderingBehavior, renderingBehavior);
1080 inline void RequestRenderingMessage(UpdateManager& manager)
1082 using LocalType = Message<UpdateManager>;
1084 // Reserve some memory inside the message queue
1085 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1087 // Construct message in the message queue memory; note that delete should not be called on the return value
1088 new(slot) LocalType(&manager, &UpdateManager::RequestRendering);
1092 * Create a message for setting the depth of a layer
1093 * @param[in] manager The update manager
1094 * @param[in] layers list of layers
1095 * @param[in] rootLayer The rool layer
1097 inline void SetLayerDepthsMessage(UpdateManager& manager, const std::vector<Layer*>& layers, const Layer* rootLayer)
1099 using LocalType = MessageValue2<UpdateManager, std::vector<Layer*>, const Layer*>;
1101 // Reserve some memory inside the message queue
1102 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1104 // Construct message in the message queue memory; note that delete should not be called on the return value
1105 new(slot) LocalType(&manager, &UpdateManager::SetLayerDepths, layers, rootLayer);
1108 inline void AddRendererMessage(UpdateManager& manager, const RendererKey& rendererKey)
1110 using LocalType = MessageValue1<UpdateManager, RendererKey>;
1112 // Reserve some memory inside the message queue
1113 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::AddRenderer, rendererKey);
1118 inline void RemoveRendererMessage(UpdateManager& manager, const RendererKey& rendererKey)
1120 using LocalType = MessageValue1<UpdateManager, RendererKey>;
1122 // Reserve some memory inside the message queue
1123 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1124 // Construct message in the message queue memory; note that delete should not be called on the return value
1125 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderer, rendererKey);
1128 inline void AttachRendererMessage(UpdateManager& manager, const Node& node, const Renderer& renderer)
1130 using LocalType = MessageValue2<UpdateManager, Node*, Renderer*>;
1132 // Reserve some memory inside the message queue
1133 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1134 // Construct message in the message queue memory; note that delete should not be called on the return value
1135 new(slot) LocalType(&manager, &UpdateManager::AttachRenderer, const_cast<Node*>(&node), const_cast<Renderer*>(&renderer));
1138 // The render thread can safely change the Shader
1139 inline void AddTextureSetMessage(UpdateManager& manager, OwnerPointer<TextureSet>& textureSet)
1141 using LocalType = MessageValue1<UpdateManager, OwnerPointer<TextureSet>>;
1143 // Reserve some memory inside the message queue
1144 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1146 // Construct message in the message queue memory; note that delete should not be called on the return value
1147 new(slot) LocalType(&manager, &UpdateManager::AddTextureSet, textureSet);
1150 // The render thread can safely change the Shader
1151 inline void RemoveTextureSetMessage(UpdateManager& manager, TextureSet& textureSet)
1153 using LocalType = MessageValue1<UpdateManager, TextureSet*>;
1155 // Reserve some memory inside the message queue
1156 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1158 // Construct message in the message queue memory; note that delete should not be called on the return value
1159 new(slot) LocalType(&manager, &UpdateManager::RemoveTextureSet, &textureSet);
1162 inline void AddSamplerMessage(UpdateManager& manager, OwnerPointer<Render::Sampler>& sampler)
1164 // Message has ownership of Sampler while in transit from event -> update
1165 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Sampler>>;
1167 // Reserve some memory inside the message queue
1168 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1170 // Construct message in the message queue memory; note that delete should not be called on the return value
1171 new(slot) LocalType(&manager, &UpdateManager::AddSampler, sampler);
1174 inline void RemoveSamplerMessage(UpdateManager& manager, Render::Sampler& sampler)
1176 using LocalType = MessageValue1<UpdateManager, Render::Sampler*>;
1178 // Reserve some memory inside the message queue
1179 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1181 // Construct message in the message queue memory; note that delete should not be called on the return value
1182 new(slot) LocalType(&manager, &UpdateManager::RemoveSampler, &sampler);
1185 inline void SetFilterModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode)
1187 using LocalType = MessageValue3<UpdateManager, Render::Sampler*, uint32_t, uint32_t>;
1189 // Reserve some memory inside the message queue
1190 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1192 // Construct message in the message queue memory; note that delete should not be called on the return value
1193 new(slot) LocalType(&manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode);
1196 inline void SetWrapModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode)
1198 using LocalType = MessageValue4<UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t>;
1200 // Reserve some memory inside the message queue
1201 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1203 // Construct message in the message queue memory; note that delete should not be called on the return value
1204 new(slot) LocalType(&manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode);
1207 inline void AddVertexBuffer(UpdateManager& manager, OwnerPointer<Render::VertexBuffer>& vertexBuffer)
1209 // Message has ownership of vertexBuffer while in transit from event -> update
1210 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::VertexBuffer>>;
1212 // Reserve some memory inside the message queue
1213 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1215 // Construct message in the message queue memory; note that delete should not be called on the return value
1216 new(slot) LocalType(&manager, &UpdateManager::AddVertexBuffer, vertexBuffer);
1219 inline void RemoveVertexBuffer(UpdateManager& manager, Render::VertexBuffer& vertexBuffer)
1221 using LocalType = MessageValue1<UpdateManager, Render::VertexBuffer*>;
1223 // Reserve some memory inside the message queue
1224 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1226 // Construct message in the message queue memory; note that delete should not be called on the return value
1227 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &vertexBuffer);
1230 inline void SetVertexBufferFormat(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format)
1232 // Message has ownership of VertexBuffer::Format while in transit from event -> update
1233 using LocalType = MessageValue2<UpdateManager, Render::VertexBuffer*, OwnerPointer<Render::VertexBuffer::Format>>;
1235 // Reserve some memory inside the message queue
1236 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1238 // Construct message in the message queue memory; note that delete should not be called on the return value
1239 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferFormat, &vertexBuffer, format);
1242 inline void SetVertexBufferData(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size)
1244 // Message has ownership of VertexBuffer data while in transit from event -> update
1245 using LocalType = MessageValue3<UpdateManager, Render::VertexBuffer*, OwnerPointer<Vector<uint8_t>>, uint32_t>;
1247 // Reserve some memory inside the message queue
1248 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1250 // Construct message in the message queue memory; note that delete should not be called on the return value
1251 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferData, &vertexBuffer, data, size);
1254 inline void AddGeometry(UpdateManager& manager, OwnerPointer<Render::Geometry>& geometry)
1256 // Message has ownership of Geometry while in transit from event -> update
1257 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Geometry>>;
1259 // Reserve some memory inside the message queue
1260 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1262 // Construct message in the message queue memory; note that delete should not be called on the return value
1263 new(slot) LocalType(&manager, &UpdateManager::AddGeometry, geometry);
1266 inline void RemoveGeometry(UpdateManager& manager, Render::Geometry& geometry)
1268 using LocalType = MessageValue1<UpdateManager, Render::Geometry*>;
1270 // Reserve some memory inside the message queue
1271 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1273 // Construct message in the message queue memory; note that delete should not be called on the return value
1274 new(slot) LocalType(&manager, &UpdateManager::RemoveGeometry, &geometry);
1277 inline void AttachVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1279 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1281 // Reserve some memory inside the message queue
1282 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1284 // Construct message in the message queue memory; note that delete should not be called on the return value
1285 new(slot) LocalType(&manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1288 inline void RemoveVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1290 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1292 // Reserve some memory inside the message queue
1293 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1295 // Construct message in the message queue memory; note that delete should not be called on the return value
1296 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1299 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1300 template<typename T>
1301 class IndexBufferMessage : public MessageBase
1305 * Constructor which does a Vector::Swap()
1307 IndexBufferMessage(T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices)
1310 mRenderGeometry(geometry)
1312 mIndices.Swap(indices);
1316 * Virtual destructor
1318 ~IndexBufferMessage() override = default;
1321 * @copydoc MessageBase::Process
1323 void Process(BufferIndex /*bufferIndex*/) override
1325 DALI_ASSERT_DEBUG(mManager && "Message does not have an object");
1326 mManager->SetIndexBuffer(mRenderGeometry, mIndices);
1331 Render::Geometry* mRenderGeometry;
1332 Dali::Vector<uint16_t> mIndices;
1335 inline void SetIndexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices)
1337 using LocalType = IndexBufferMessage<UpdateManager>;
1339 // Reserve some memory inside the message queue
1340 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1342 // Construct message in the message queue memory; note that delete should not be called on the return value
1343 new(slot) LocalType(&manager, &geometry, indices);
1346 inline void SetGeometryTypeMessage(UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType)
1348 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, uint32_t>;
1350 // Reserve some memory inside the message queue
1351 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1353 // Construct message in the message queue memory; note that delete should not be called on the return value
1354 new(slot) LocalType(&manager, &UpdateManager::SetGeometryType, &geometry, geometryType);
1357 inline void AddTextureMessage(UpdateManager& manager, const Render::TextureKey& texture)
1359 using LocalType = MessageValue1<UpdateManager, Render::TextureKey>;
1361 // Reserve some memory inside the message queue
1362 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1364 // Construct message in the message queue memory; note that delete should not be called on the return value
1365 new(slot) LocalType(&manager, &UpdateManager::AddTexture, texture);
1368 inline void RemoveTextureMessage(UpdateManager& manager, const Render::TextureKey& texture)
1370 using LocalType = MessageValue1<UpdateManager, Render::TextureKey>;
1372 // Reserve some memory inside the message queue
1373 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1375 // Construct message in the message queue memory; note that delete should not be called on the return value
1376 new(slot) LocalType(&manager, &UpdateManager::RemoveTexture, texture);
1379 inline void UploadTextureMessage(UpdateManager& manager, Render::TextureKey texture, PixelDataPtr pixelData, const Texture::UploadParams& params)
1381 using LocalType = MessageValue3<UpdateManager, Render::TextureKey, PixelDataPtr, Texture::UploadParams>;
1383 // Reserve some memory inside the message queue
1384 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1386 // Construct message in the message queue memory; note that delete should not be called on the return value
1387 new(slot) LocalType(&manager, &UpdateManager::UploadTexture, texture, pixelData, params);
1390 inline void GenerateMipmapsMessage(UpdateManager& manager, Render::TextureKey texture)
1392 using LocalType = MessageValue1<UpdateManager, Render::TextureKey>;
1394 // Reserve some memory inside the message queue
1395 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1397 // Construct message in the message queue memory; note that delete should not be called on the return value
1398 new(slot) LocalType(&manager, &UpdateManager::GenerateMipmaps, texture);
1401 inline void AddFrameBuffer(UpdateManager& manager, OwnerPointer<Render::FrameBuffer>& frameBuffer)
1403 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::FrameBuffer>>;
1405 // Reserve some memory inside the message queue
1406 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1408 // Construct message in the message queue memory; note that delete should not be called on the return value
1409 new(slot) LocalType(&manager, &UpdateManager::AddFrameBuffer, frameBuffer);
1412 inline void RemoveFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer)
1414 using LocalType = MessageValue1<UpdateManager, Render::FrameBuffer*>;
1416 // Reserve some memory inside the message queue
1417 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1419 // Construct message in the message queue memory; note that delete should not be called on the return value
1420 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer);
1423 inline void AttachColorTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer)
1425 using LocalType = MessageValue4<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t>;
1427 // Reserve some memory inside the message queue
1428 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1430 // Construct message in the message queue memory; note that delete should not be called on the return value
1431 new(slot) LocalType(&manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer);
1434 inline void AttachDepthTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1436 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1438 // Reserve some memory inside the message queue
1439 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1441 // Construct message in the message queue memory; note that delete should not be called on the return value
1442 new(slot) LocalType(&manager, &UpdateManager::AttachDepthTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1445 inline void AttachDepthStencilTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1447 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1449 // Reserve some memory inside the message queue
1450 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1452 // Construct message in the message queue memory; note that delete should not be called on the return value
1453 new(slot) LocalType(&manager, &UpdateManager::AttachDepthStencilTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1456 inline void SetMultiSamplingLevelToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, uint8_t multiSamplingLevel)
1458 using LocalType = MessageValue2<UpdateManager, Render::FrameBuffer*, uint8_t>;
1460 // Reserve some memory inside the message queue
1461 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1463 // Construct message in the message queue memory; note that delete should not be called on the return value
1464 new(slot) LocalType(&manager, &UpdateManager::SetMultiSamplingLevelToFrameBuffer, &frameBuffer, multiSamplingLevel);
1467 inline void SetDepthIndicesMessage(UpdateManager& manager, OwnerPointer<NodeDepths>& nodeDepths)
1469 using LocalType = MessageValue1<UpdateManager, OwnerPointer<NodeDepths>>;
1471 // Reserve some memory inside the message queue
1472 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1474 // Construct message in the message queue memory; note that delete should not be called on the return value
1475 new(slot) LocalType(&manager, &UpdateManager::SetDepthIndices, nodeDepths);
1478 inline void AddResetterMessage(UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter)
1480 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyResetterBase>>;
1482 // Reserve some memory inside the message queue
1483 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1485 // Construct message in the message queue memory; note that delete should not be called on the return value
1486 new(slot) LocalType(&manager, &UpdateManager::AddPropertyResetter, resetter);
1489 inline void AddFrameCallbackMessage(UpdateManager& manager, OwnerPointer<FrameCallback>& frameCallback, const Node& rootNode)
1491 using LocalType = MessageValue2<UpdateManager, OwnerPointer<FrameCallback>, const Node*>;
1493 // Reserve some memory inside the message queue
1494 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1496 // Construct message in the message queue memory; note that delete should not be called on the return value
1497 new(slot) LocalType(&manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode);
1500 inline void RemoveFrameCallbackMessage(UpdateManager& manager, FrameCallbackInterface& frameCallback)
1502 using LocalType = MessageValue1<UpdateManager, FrameCallbackInterface*>;
1504 // Reserve some memory inside the message queue
1505 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1507 // Construct message in the message queue memory; note that delete should not be called on the return value
1508 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameCallback, &frameCallback);
1511 } // namespace SceneGraph
1513 } // namespace Internal
1517 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H