1 #ifndef DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
5 * Copyright (c) 2021 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 camera on scene
180 * @param[in] camera The camera to add
182 void AddCamera(OwnerPointer<Camera>& camera);
185 * Remove a camera from scene
186 * @param[in] camera to remove
188 void RemoveCamera(Camera* camera);
191 * Add a newly created object.
192 * @param[in] object The object to add.
193 * @post The object is owned by UpdateManager.
195 void AddObject(OwnerPointer<PropertyOwner>& object);
199 * @param[in] object The object to remove.
201 void RemoveObject(PropertyOwner* object);
204 * Add a newly created render task list.
205 * @param[in] taskList The render task list to add.
206 * @post The render task list is owned by UpdateManager.
208 void AddRenderTaskList(OwnerPointer<RenderTaskList>& taskList);
211 * Remove a render task list.
212 * @param[in] taskList The render task list to remove.
214 void RemoveRenderTaskList(RenderTaskList* taskList);
217 * Add a newly created scene.
218 * @param[in] scene The scene to add.
219 * @post The scene is owned by UpdateManager.
221 void AddScene(OwnerPointer<Scene>& scene);
225 * @param[in] scene The scene to remove.
227 void RemoveScene(Scene* scene);
232 * Add a newly created animation.
233 * @param[in] animation The animation to add.
234 * @post The animation is owned by UpdateManager.
236 void AddAnimation(OwnerPointer<SceneGraph::Animation>& animation);
240 * @param[in] animation The animation to stop.
242 void StopAnimation(Animation* animation);
245 * Remove an animation.
246 * @param[in] animation The animation to remove.
248 void RemoveAnimation(Animation* animation);
251 * Query whether any animations are currently running.
252 * @return True if any animations are running.
254 bool IsAnimationRunning() const;
257 * Add a property resetter. UpdateManager takes ownership of the object.
258 * It will be killed by UpdateManager when the associated animator or
259 * constraint has finished; or the property owner of the property is destroyed.
261 void AddPropertyResetter(OwnerPointer<PropertyResetterBase>& propertyResetter);
264 * Add a node resetter. UpdateManager takes ownership of the object.
265 * It will be killed by UpdateManager when the node is disconnected from the scene graph;
266 * or when the node is destroyed.
268 void AddNodeResetter(OwnerPointer<NodeResetter>& nodeResetter);
270 // Property Notification
273 * Add a newly created property notification
274 * @param[in] propertyNotification The notification to add
275 * @post The propertyNotification is owned by UpdateManager.
277 void AddPropertyNotification(OwnerPointer<PropertyNotification>& propertyNotification);
280 * Remove a property notification
281 * @param[in] propertyNotification The notification to remove
283 void RemovePropertyNotification(PropertyNotification* propertyNotification);
286 * Set Notify state for PropertyNotification
287 * @param[in] propertyNotification The notification to remove
288 * @param[in] notifyMode The notification mode.
290 void PropertyNotificationSetNotify(PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode);
295 * Add a newly created shader.
296 * @param[in] shader The shader to add.
297 * @post The shader is owned by the UpdateManager.
299 void AddShader(OwnerPointer<Shader>& shader);
303 * @pre The shader has been added to the UpdateManager.
304 * @param[in] shader The shader to remove.
305 * @post The shader is destroyed.
307 void RemoveShader(Shader* shader);
310 * Set the shader data for a Shader object
311 * @param[in] shader The shader to modify
312 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
314 void SetShaderData(Shader* shader, Internal::ShaderDataPtr shaderData);
317 * @brief Accept compiled shaders passed back on render thread for saving.
318 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
320 void SaveBinary(Internal::ShaderDataPtr shaderData) override;
323 * @brief Set the destination for compiled shader binaries to be passed on to.
324 * The dispatcher passed in will be called from the update thread.
325 * @param[in] upstream A sink for ShaderDatas to be passed into.
327 void SetShaderSaver(ShaderSaver& upstream);
332 * Add a new renderer to scene
333 * @param renderer to add
335 void AddRenderer(OwnerPointer<Renderer>& renderer);
338 * Add a renderer from scene
339 * @param renderer to remove
341 void RemoveRenderer(Renderer* renderer);
344 * Attach a renderer to node
345 * @param renderer to attach
347 void AttachRenderer(Node* node, Renderer* renderer);
352 * Set the pan gesture processor.
353 * Pan Gesture processor lives for the lifetime of UpdateManager
354 * @param[in] gesture The gesture processor.
355 * @post The gestureProcessor is owned by the UpdateManager.
357 void SetPanGestureProcessor(PanGesture* gestureProcessor);
362 * Add a newly created TextureSet.
363 * @param[in] textureSet The texture set to add.
364 * @post The TextureSet is owned by the UpdateManager.
366 void AddTextureSet(OwnerPointer<TextureSet>& textureSet);
369 * Remove a TextureSet.
370 * @pre The TextureSet has been added to the UpdateManager.
371 * @param[in] textureSet The TextureSet to remove.
372 * @post The TextureSet is destroyed.
374 void RemoveTextureSet(TextureSet* textureSet);
379 * Get the scene graph side list of RenderTasks.
380 * @param[in] systemLevel True if using the system-level overlay.
381 * @return The list of render tasks
383 RenderTaskList* GetRenderTaskList(bool systemLevel);
385 // Message queue handling
388 * Reserve space for another message in the queue; this must then be initialized by the caller.
389 * The message will be read from the update-thread after the next FlushMessages is called.
390 * @post Calling this method may invalidate any previously returned slots.
391 * @param[in] size The message size with respect to the size of type "char".
392 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
393 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
394 * @return A pointer to the first char allocated for the message.
396 uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene = true);
399 * @return the current event-buffer index.
401 BufferIndex GetEventBufferIndex() const
403 // inlined as its called often from event thread
404 return mSceneGraphBuffers.GetEventBufferIndex();
408 * Called by the event-thread to signal that FlushQueue will be called
409 * e.g. when it has finished event processing.
411 void EventProcessingStarted();
414 * Flush the set of messages, which were previously stored with QueueMessage().
415 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
417 * @return True if there are messages to process.
422 * Add a new sampler to RenderManager
423 * @param[in] sampler The sampler to add
424 * @post Sends a message to RenderManager to add the sampler.
425 * The sampler will be owned by RenderManager
427 void AddSampler(OwnerPointer<Render::Sampler>& sampler);
430 * Removes an existing sampler from RenderManager
431 * @param[in] sampler The sampler to remove
432 * @post The sampler will be destroyed in the render thread
434 void RemoveSampler(Render::Sampler* sampler);
437 * Sets the filter modes for an existing sampler
438 * @param[in] sampler The sampler
439 * @param[in] minFilterMode The filter to use under minification
440 * @param[in] magFilterMode The filter to use under magnification
442 void SetFilterMode(Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode);
445 * Sets the wrap mode for an existing sampler
446 * @param[in] sampler The sampler
447 * @param[in] rWrapMode Wrapping mode in z direction
448 * @param[in] sWrapMode Wrapping mode in x direction
449 * @param[in] tWrapMode Wrapping mode in y direction
451 void SetWrapMode(Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode);
454 * Add a new property buffer to RenderManager
455 * @param[in] propertryBuffer The property buffer to add
456 * @post Sends a message to RenderManager to add the property buffer.
457 * The property buffer will be owned by RenderManager
459 void AddVertexBuffer(OwnerPointer<Render::VertexBuffer>& propertryBuffer);
462 * Removes an existing VertexBuffer from RenderManager
463 * @param[in] propertryBuffer The property buffer to remove
464 * @post The property buffer will be destroyed in the render thread
466 void RemoveVertexBuffer(Render::VertexBuffer* propertryBuffer);
469 * Sets the format of an existing property buffer
470 * @param[in] vertexBuffer The property buffer.
471 * @param[in] format The new format of the buffer
472 * @post Sends a message to RenderManager to set the new format to the property buffer.
474 void SetVertexBufferFormat(Render::VertexBuffer* vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format);
477 * Sets the data of an existing property buffer
478 * @param[in] vertexBuffer The property buffer.
479 * @param[in] data The new data of the buffer
480 * @param[in] size The new size of the buffer
481 * @post Sends a message to RenderManager to set the new data to the property buffer.
483 void SetVertexBufferData(Render::VertexBuffer* vertexBuffer, OwnerPointer<Vector<uint8_t> >& data, uint32_t size);
486 * Adds a geometry to the RenderManager
487 * @param[in] geometry The geometry to add
488 * @post Sends a message to RenderManager to add the Geometry
489 * The geometry will be owned by RenderManager
491 void AddGeometry(OwnerPointer<Render::Geometry>& geometry);
494 * Removes an existing Geometry from RenderManager
495 * @param[in] geometry The geometry to remove
496 * @post The geometry will be destroyed in the render thread
498 void RemoveGeometry(Render::Geometry* geometry);
501 * Sets the geometry type of an existing Geometry
502 * @param[in] geometry The geometry
503 * @param[in] geometryType The type of the geometry
505 void SetGeometryType(Render::Geometry* geometry, uint32_t geometryType);
508 * Sets the index buffer to be used by a geometry
509 * @param[in] geometry The geometry
510 * @param[in] indices A vector containing the indices for the geometry
512 void SetIndexBuffer(Render::Geometry* geometry, Dali::Vector<uint16_t>& indices);
515 * Adds a vertex buffer to a geometry
516 * @param[in] geometry The geometry
517 * @param[in] vertexBuffer The property buffer
519 void AttachVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
522 * Removes a vertex buffer from a geometry
523 * @param[in] geometry The geometry
524 * @param[in] vertexBuffer The property buffer
526 void RemoveVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
529 * Adds a texture to the render manager
530 * @param[in] texture The texture to add
531 * The texture will be owned by RenderManager
533 void AddTexture(OwnerPointer<Render::Texture>& texture);
536 * Removes a texture from the render manager
537 * @param[in] texture The texture to remove
538 * @post The texture will be destroyed in the render thread
540 void RemoveTexture(Render::Texture* texture);
543 * Uploads data to a texture owned by the RenderManager
544 * @param[in] texture The texture
545 * @param[in] pixelData The pixel data object
546 * @param[in] params The parameters for the upload
548 void UploadTexture(Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params);
551 * Generates mipmaps for a texture owned by the RenderManager
552 * @param[in] texture The texture
554 void GenerateMipmaps(Render::Texture* texture);
557 * Adds a framebuffer to the render manager
558 * @param[in] frameBuffer The framebuffer to add
559 * The framebuffer will be owned by RenderManager
561 void AddFrameBuffer(OwnerPointer<Render::FrameBuffer>& frameBuffer);
564 * Removes a FrameBuffer from the render manager
565 * @param[in] frameBuffer The FrameBuffer to remove
566 * @post The FrameBuffer will be destroyed in the render thread
568 void RemoveFrameBuffer(Render::FrameBuffer* frameBuffer);
571 * Attach a texture as color output to an existing FrameBuffer
572 * @param[in] frameBuffer The FrameBuffer
573 * @param[in] texture The texture that will be used as output when rendering
574 * @param[in] mipmapLevel The mipmap of the texture to be attached
575 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
577 void AttachColorTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face);
580 * Attach a texture as depth output to an existing FrameBuffer
581 * @param[in] frameBuffer The FrameBuffer
582 * @param[in] texture The texture that will be used as output when rendering
583 * @param[in] mipmapLevel The mipmap of the texture to be attached
585 void AttachDepthTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
588 * Attach a texture as depth/stencil output to an existing FrameBuffer
589 * @param[in] frameBuffer The FrameBuffer
590 * @param[in] texture The texture that will be used as output when rendering
591 * @param[in] mipmapLevel The mipmap of the texture to be attached
593 void AttachDepthStencilTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
596 * This is called when the surface of the scene has been replaced.
597 * @param[in] scene The scene.
599 void SurfaceReplaced(Scene* scene);
603 * Performs an Update traversal on the scene-graph.
604 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
605 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
606 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
607 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
608 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
609 * @return True if further updates are required e.g. during animations.
611 uint32_t Update(float elapsedSeconds,
612 uint32_t lastVSyncTimeMilliseconds,
613 uint32_t nextVSyncTimeMilliseconds,
614 bool renderToFboEnabled,
615 bool isRenderingToFbo);
618 * @copydoc Dali::Stage::KeepRendering()
620 void KeepRendering(float durationSeconds);
623 * @copydoc Dali::DevelStage::SetRenderingBehavior()
625 void SetRenderingBehavior(DevelStage::Rendering renderingBehavior);
628 * Request to render the current frame
629 * @note This is a temporary workaround (to be removed in the future) to request the rendering of
630 * the current frame if the color or visibility of any actor is updated. It MUST NOT be used
631 * for any other purposes.
633 void RequestRendering();
636 * Sets the depths of all layers.
637 * @param layers The layers in depth order.
638 * @param[in] rootLayer The root layer of the sorted layers.
640 void SetLayerDepths(const std::vector<Layer*>& layers, const Layer* rootLayer);
643 * Set the depth indices of all nodes (in LayerUI's)
644 * @param[in] nodeDepths A vector of nodes and associated depth indices
646 void SetDepthIndices(OwnerPointer<NodeDepths>& nodeDepths);
649 * Adds an implementation of the FrameCallbackInterface.
650 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
651 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
653 void AddFrameCallback(OwnerPointer<FrameCallback>& frameCallback, const Node* rootNode);
656 * Removes the specified implementation of FrameCallbackInterface.
657 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
659 void RemoveFrameCallback(FrameCallbackInterface* frameCallback);
663 UpdateManager(const UpdateManager&);
666 UpdateManager& operator=(const UpdateManager& rhs);
669 * Helper to check whether the update-thread should keep going.
670 * @param[in] elapsedSeconds The time in seconds since the previous update.
671 * @return True if the update-thread should keep going.
673 uint32_t KeepUpdatingCheck(float elapsedSeconds) const;
676 * Helper to reset all Node properties
677 * @param[in] bufferIndex to use
679 void ResetProperties(BufferIndex bufferIndex);
682 * Perform gesture updates.
683 * @param[in] bufferIndex to use
684 * @param[in] lastVSyncTime The last VSync time in milliseconds.
685 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
686 * @return true, if any properties were updated.
688 bool ProcessGestures(BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds);
691 * Perform animation updates
692 * @param[in] bufferIndex to use
693 * @param[in] elapsedSeconds time since last frame
694 * @return true if at least one animations is currently active or false otherwise
696 bool Animate(BufferIndex bufferIndex, float elapsedSeconds);
699 * Applies constraints to CustomObjects
700 * @param[in] bufferIndex to use
702 void ConstrainCustomObjects(BufferIndex bufferIndex);
705 * Applies constraints to RenderTasks
706 * @param[in] bufferIndex to use
708 void ConstrainRenderTasks(BufferIndex bufferIndex);
711 * Applies constraints to Shaders
712 * @param[in] bufferIndex to use
714 void ConstrainShaders(BufferIndex bufferIndex);
717 * Perform property notification updates
718 * @param[in] bufferIndex to use
720 void ProcessPropertyNotifications(BufferIndex bufferIndex);
723 * Pass shader binaries queued here on to event thread.
725 void ForwardCompiledShadersToEventThread();
728 * Update node shaders, opacity, geometry etc.
729 * @param[in] bufferIndex to use
731 void UpdateNodes(BufferIndex bufferIndex);
735 * @param[in] bufferIndex to use
737 void UpdateRenderers(BufferIndex bufferIndex);
740 // needs to be direct member so that getter for event buffer can be inlined
741 SceneGraphBuffers mSceneGraphBuffers;
747 // Messages for UpdateManager
749 inline void InstallRootMessage(UpdateManager& manager, OwnerPointer<Layer>& root)
751 // Message has ownership of Layer while in transit from event -> update
752 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Layer> >;
754 // Reserve some memory inside the message queue
755 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
757 // Construct message in the message queue memory; note that delete should not be called on the return value
758 new(slot) LocalType(&manager, &UpdateManager::InstallRoot, root);
761 inline void UninstallRootMessage(UpdateManager& manager, const Layer* constRoot)
763 // Scene graph thread can destroy this object.
764 Layer* root = const_cast<Layer*>(constRoot);
766 using LocalType = MessageValue1<UpdateManager, Layer*>;
768 // Reserve some memory inside the message queue
769 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
771 // Construct message in the message queue memory; note that delete should not be called on the return value
772 new(slot) LocalType(&manager, &UpdateManager::UninstallRoot, root);
775 inline void AddNodeMessage(UpdateManager& manager, OwnerPointer<Node>& node)
777 // Message has ownership of Node while in transit from event -> update
778 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Node> >;
780 // Reserve some memory inside the message queue
781 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
783 // Construct message in the message queue memory; note that delete should not be called on the return value
784 new(slot) LocalType(&manager, &UpdateManager::AddNode, node);
787 inline void ConnectNodeMessage(UpdateManager& manager, const Node& constParent, const Node& constChild)
789 // Update thread can edit the object
790 Node& parent = const_cast<Node&>(constParent);
791 Node& child = const_cast<Node&>(constChild);
793 using LocalType = MessageValue2<UpdateManager, Node*, Node*>;
795 // Reserve some memory inside the message queue
796 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
798 // Construct message in the message queue memory; note that delete should not be called on the return value
799 new(slot) LocalType(&manager, &UpdateManager::ConnectNode, &parent, &child);
802 inline void DisconnectNodeMessage(UpdateManager& manager, const Node& constNode)
804 // Scene graph thread can modify this object.
805 Node& node = const_cast<Node&>(constNode);
807 using LocalType = MessageValue1<UpdateManager, Node*>;
809 // Reserve some memory inside the message queue
810 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
812 // Construct message in the message queue memory; note that delete should not be called on the return value
813 new(slot) LocalType(&manager, &UpdateManager::DisconnectNode, &node);
816 inline void DestroyNodeMessage(UpdateManager& manager, const Node& constNode)
818 // Scene graph thread can destroy this object.
819 Node& node = const_cast<Node&>(constNode);
821 using LocalType = MessageValue1<UpdateManager, Node*>;
823 // Reserve some memory inside the message queue
824 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
826 // Construct message in the message queue memory; note that delete should not be called on the return value
827 new(slot) LocalType(&manager, &UpdateManager::DestroyNode, &node);
830 inline void AddCameraMessage(UpdateManager& manager, OwnerPointer<Camera>& camera)
832 // Message has ownership of Camera while in transit from event -> update
833 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Camera> >;
835 // Reserve some memory inside the message queue
836 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
838 // Construct message in the message queue memory; note that delete should not be called on the return value
839 new(slot) LocalType(&manager, &UpdateManager::AddCamera, camera);
842 inline void RemoveCameraMessage(UpdateManager& manager, const Camera* camera)
844 using LocalType = MessageValue1<UpdateManager, Camera*>;
846 // Reserve some memory inside the message queue
847 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
849 // Construct message in the message queue memory; note that delete should not be called on the return value
850 new(slot) LocalType(&manager, &UpdateManager::RemoveCamera, const_cast<Camera*>(camera));
853 inline void AddObjectMessage(UpdateManager& manager, OwnerPointer<PropertyOwner>& object)
855 // Message has ownership of object while in transit from event -> update
856 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyOwner> >;
858 // Reserve some memory inside the message queue
859 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
861 // Construct message in the message queue memory; note that delete should not be called on the return value
862 new(slot) LocalType(&manager, &UpdateManager::AddObject, object);
865 inline void RemoveObjectMessage(UpdateManager& manager, const PropertyOwner* object)
867 using LocalType = MessageValue1<UpdateManager, PropertyOwner*>;
869 // Reserve some memory inside the message queue
870 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
872 // Construct message in the message queue memory; note that delete should not be called on the return value
873 new(slot) LocalType(&manager, &UpdateManager::RemoveObject, const_cast<PropertyOwner*>(object));
876 inline void AddAnimationMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Animation>& animation)
878 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Animation> >;
880 // Reserve some memory inside the message queue
881 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
883 // Construct message in the message queue memory; note that delete should not be called on the return value
884 new(slot) LocalType(&manager, &UpdateManager::AddAnimation, animation);
887 inline void StopAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
889 // The scene-graph thread owns this object so it can safely edit it.
890 Animation& animation = const_cast<Animation&>(constAnimation);
892 using LocalType = MessageValue1<UpdateManager, Animation*>;
894 // Reserve some memory inside the message queue
895 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
897 // Construct message in the message queue memory; note that delete should not be called on the return value
898 new(slot) LocalType(&manager, &UpdateManager::StopAnimation, &animation);
901 inline void RemoveAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
903 // The scene-graph thread owns this object so it can safely edit it.
904 Animation& animation = const_cast<Animation&>(constAnimation);
906 using LocalType = MessageValue1<UpdateManager, Animation*>;
908 // Reserve some memory inside the message queue
909 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
911 // Construct message in the message queue memory; note that delete should not be called on the return value
912 new(slot) LocalType(&manager, &UpdateManager::RemoveAnimation, &animation);
915 inline void AddRenderTaskListMessage(UpdateManager& manager, OwnerPointer<SceneGraph::RenderTaskList>& taskList)
917 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::RenderTaskList> >;
919 // Reserve some memory inside the message queue
920 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
922 // Construct message in the message queue memory; note that delete should not be called on the return value
923 new(slot) LocalType(&manager, &UpdateManager::AddRenderTaskList, taskList);
926 inline void RemoveRenderTaskListMessage(UpdateManager& manager, const RenderTaskList& constTaskList)
928 // The scene-graph thread owns this object so it can safely edit it.
929 RenderTaskList& taskList = const_cast<RenderTaskList&>(constTaskList);
931 using LocalType = MessageValue1<UpdateManager, RenderTaskList*>;
933 // Reserve some memory inside the message queue
934 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
936 // Construct message in the message queue memory; note that delete should not be called on the return value
937 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderTaskList, &taskList);
940 inline void AddSceneMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Scene>& scene)
942 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Scene> >;
944 // Reserve some memory inside the message queue
945 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
947 // Construct message in the message queue memory; note that delete should not be called on the return value
948 new(slot) LocalType(&manager, &UpdateManager::AddScene, scene);
951 inline void RemoveSceneMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
953 // The scene-graph thread owns this object so it can safely edit it.
954 Scene& scene = const_cast<Scene&>(constScene);
956 using LocalType = MessageValue1<UpdateManager, Scene*>;
958 // Reserve some memory inside the message queue
959 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
961 // Construct message in the message queue memory; note that delete should not be called on the return value
962 new(slot) LocalType(&manager, &UpdateManager::RemoveScene, &scene);
965 inline void AddPropertyNotificationMessage(UpdateManager& manager, OwnerPointer<PropertyNotification>& propertyNotification)
967 // Message has ownership of PropertyNotification while in transit from event -> update
968 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyNotification> >;
970 // Reserve some memory inside the message queue
971 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
973 // Construct message in the message queue memory; note that delete should not be called on the return value
974 new(slot) LocalType(&manager, &UpdateManager::AddPropertyNotification, propertyNotification);
977 inline void RemovePropertyNotificationMessage(UpdateManager& manager, const PropertyNotification& constPropertyNotification)
979 // The scene-graph thread owns this object so it can safely edit it.
980 PropertyNotification& propertyNotification = const_cast<PropertyNotification&>(constPropertyNotification);
982 using LocalType = MessageValue1<UpdateManager, PropertyNotification*>;
984 // Reserve some memory inside the message queue
985 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
987 // Construct message in the message queue memory; note that delete should not be called on the return value
988 new(slot) LocalType(&manager, &UpdateManager::RemovePropertyNotification, &propertyNotification);
991 inline void PropertyNotificationSetNotifyModeMessage(UpdateManager& manager,
992 const PropertyNotification* constPropertyNotification,
993 PropertyNotification::NotifyMode notifyMode)
995 // The scene-graph thread owns this object so it can safely edit it.
996 PropertyNotification* propertyNotification = const_cast<PropertyNotification*>(constPropertyNotification);
998 using LocalType = MessageValue2<UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode>;
1000 // Reserve some memory inside the message queue
1001 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1003 // Construct message in the message queue memory; note that delete should not be called on the return value
1004 new(slot) LocalType(&manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode);
1007 // The render thread can safely change the Shader
1008 inline void AddShaderMessage(UpdateManager& manager, OwnerPointer<Shader>& shader)
1010 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Shader> >;
1012 // Reserve some memory inside the message queue
1013 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1015 // Construct message in the message queue memory; note that delete should not be called on the return value
1016 new(slot) LocalType(&manager, &UpdateManager::AddShader, shader);
1019 // The render thread can safely change the Shader
1020 inline void RemoveShaderMessage(UpdateManager& manager, const Shader* shader)
1022 using LocalType = MessageValue1<UpdateManager, Shader*>;
1024 // Reserve some memory inside the message queue
1025 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1027 // Construct message in the message queue memory; note that delete should not be called on the return value
1028 new(slot) LocalType(&manager, &UpdateManager::RemoveShader, const_cast<Shader*>(shader));
1031 inline void SurfaceReplacedMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
1033 // The scene-graph thread owns this object so it can safely edit it.
1034 Scene& scene = const_cast<Scene&>(constScene);
1036 using LocalType = MessageValue1<UpdateManager, Scene*>;
1038 // Reserve some memory inside the message queue
1039 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1041 // Construct message in the message queue memory; note that delete should not be called on the return value
1042 new(slot) LocalType(&manager, &UpdateManager::SurfaceReplaced, &scene);
1045 inline void KeepRenderingMessage(UpdateManager& manager, float durationSeconds)
1047 using LocalType = MessageValue1<UpdateManager, float>;
1049 // Reserve some memory inside the message queue
1050 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1052 // Construct message in the message queue memory; note that delete should not be called on the return value
1053 new(slot) LocalType(&manager, &UpdateManager::KeepRendering, durationSeconds);
1056 inline void SetRenderingBehaviorMessage(UpdateManager& manager, DevelStage::Rendering renderingBehavior)
1058 using LocalType = MessageValue1<UpdateManager, DevelStage::Rendering>;
1060 // Reserve some memory inside the message queue
1061 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1063 // Construct message in the message queue memory; note that delete should not be called on the return value
1064 new(slot) LocalType(&manager, &UpdateManager::SetRenderingBehavior, renderingBehavior);
1067 inline void RequestRenderingMessage(UpdateManager& manager)
1069 using LocalType = Message<UpdateManager>;
1071 // Reserve some memory inside the message queue
1072 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1074 // Construct message in the message queue memory; note that delete should not be called on the return value
1075 new(slot) LocalType(&manager, &UpdateManager::RequestRendering);
1079 * Create a message for setting the depth of a layer
1080 * @param[in] manager The update manager
1081 * @param[in] layers list of layers
1082 * @param[in] rootLayer The rool layer
1084 inline void SetLayerDepthsMessage(UpdateManager& manager, const std::vector<Layer*>& layers, const Layer* rootLayer)
1086 using LocalType = MessageValue2<UpdateManager, std::vector<Layer*>, const Layer*>;
1088 // Reserve some memory inside the message queue
1089 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1091 // Construct message in the message queue memory; note that delete should not be called on the return value
1092 new(slot) LocalType(&manager, &UpdateManager::SetLayerDepths, layers, rootLayer);
1095 inline void AddRendererMessage(UpdateManager& manager, OwnerPointer<Renderer>& object)
1097 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Renderer> >;
1099 // Reserve some memory inside the message queue
1100 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1101 // Construct message in the message queue memory; note that delete should not be called on the return value
1102 new(slot) LocalType(&manager, &UpdateManager::AddRenderer, object);
1105 inline void RemoveRendererMessage(UpdateManager& manager, const Renderer& object)
1107 using LocalType = MessageValue1<UpdateManager, Renderer*>;
1109 // Reserve some memory inside the message queue
1110 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1111 // Construct message in the message queue memory; note that delete should not be called on the return value
1112 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderer, const_cast<Renderer*>(&object));
1115 inline void AttachRendererMessage(UpdateManager& manager, const Node& node, const Renderer& renderer)
1117 using LocalType = MessageValue2<UpdateManager, Node*, Renderer*>;
1119 // Reserve some memory inside the message queue
1120 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1121 // Construct message in the message queue memory; note that delete should not be called on the return value
1122 new(slot) LocalType(&manager, &UpdateManager::AttachRenderer, const_cast<Node*>(&node), const_cast<Renderer*>(&renderer));
1125 // The render thread can safely change the Shader
1126 inline void AddTextureSetMessage(UpdateManager& manager, OwnerPointer<TextureSet>& textureSet)
1128 using LocalType = MessageValue1<UpdateManager, OwnerPointer<TextureSet> >;
1130 // Reserve some memory inside the message queue
1131 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1133 // Construct message in the message queue memory; note that delete should not be called on the return value
1134 new(slot) LocalType(&manager, &UpdateManager::AddTextureSet, textureSet);
1137 // The render thread can safely change the Shader
1138 inline void RemoveTextureSetMessage(UpdateManager& manager, TextureSet& textureSet)
1140 using LocalType = MessageValue1<UpdateManager, TextureSet*>;
1142 // Reserve some memory inside the message queue
1143 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1145 // Construct message in the message queue memory; note that delete should not be called on the return value
1146 new(slot) LocalType(&manager, &UpdateManager::RemoveTextureSet, &textureSet);
1149 inline void AddSamplerMessage(UpdateManager& manager, OwnerPointer<Render::Sampler>& sampler)
1151 // Message has ownership of Sampler while in transit from event -> update
1152 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Sampler> >;
1154 // Reserve some memory inside the message queue
1155 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1157 // Construct message in the message queue memory; note that delete should not be called on the return value
1158 new(slot) LocalType(&manager, &UpdateManager::AddSampler, sampler);
1161 inline void RemoveSamplerMessage(UpdateManager& manager, Render::Sampler& sampler)
1163 using LocalType = MessageValue1<UpdateManager, Render::Sampler*>;
1165 // Reserve some memory inside the message queue
1166 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1168 // Construct message in the message queue memory; note that delete should not be called on the return value
1169 new(slot) LocalType(&manager, &UpdateManager::RemoveSampler, &sampler);
1172 inline void SetFilterModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode)
1174 using LocalType = MessageValue3<UpdateManager, Render::Sampler*, uint32_t, uint32_t>;
1176 // Reserve some memory inside the message queue
1177 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1179 // Construct message in the message queue memory; note that delete should not be called on the return value
1180 new(slot) LocalType(&manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode);
1183 inline void SetWrapModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode)
1185 using LocalType = MessageValue4<UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t>;
1187 // Reserve some memory inside the message queue
1188 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1190 // Construct message in the message queue memory; note that delete should not be called on the return value
1191 new(slot) LocalType(&manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode);
1194 inline void AddVertexBuffer(UpdateManager& manager, OwnerPointer<Render::VertexBuffer>& vertexBuffer)
1196 // Message has ownership of vertexBuffer while in transit from event -> update
1197 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::VertexBuffer> >;
1199 // Reserve some memory inside the message queue
1200 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1202 // Construct message in the message queue memory; note that delete should not be called on the return value
1203 new(slot) LocalType(&manager, &UpdateManager::AddVertexBuffer, vertexBuffer);
1206 inline void RemoveVertexBuffer(UpdateManager& manager, Render::VertexBuffer& vertexBuffer)
1208 using LocalType = MessageValue1<UpdateManager, Render::VertexBuffer*>;
1210 // Reserve some memory inside the message queue
1211 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1213 // Construct message in the message queue memory; note that delete should not be called on the return value
1214 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &vertexBuffer);
1217 inline void SetVertexBufferFormat(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format)
1219 // Message has ownership of VertexBuffer::Format while in transit from event -> update
1220 using LocalType = MessageValue2<UpdateManager, Render::VertexBuffer*, OwnerPointer<Render::VertexBuffer::Format> >;
1222 // Reserve some memory inside the message queue
1223 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1225 // Construct message in the message queue memory; note that delete should not be called on the return value
1226 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferFormat, &vertexBuffer, format);
1229 inline void SetVertexBufferData(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Vector<uint8_t> >& data, uint32_t size)
1231 // Message has ownership of VertexBuffer data while in transit from event -> update
1232 using LocalType = MessageValue3<UpdateManager, Render::VertexBuffer*, OwnerPointer<Vector<uint8_t> >, uint32_t>;
1234 // Reserve some memory inside the message queue
1235 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1237 // Construct message in the message queue memory; note that delete should not be called on the return value
1238 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferData, &vertexBuffer, data, size);
1241 inline void AddGeometry(UpdateManager& manager, OwnerPointer<Render::Geometry>& geometry)
1243 // Message has ownership of Geometry while in transit from event -> update
1244 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Geometry> >;
1246 // Reserve some memory inside the message queue
1247 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1249 // Construct message in the message queue memory; note that delete should not be called on the return value
1250 new(slot) LocalType(&manager, &UpdateManager::AddGeometry, geometry);
1253 inline void RemoveGeometry(UpdateManager& manager, Render::Geometry& geometry)
1255 using LocalType = MessageValue1<UpdateManager, Render::Geometry*>;
1257 // Reserve some memory inside the message queue
1258 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1260 // Construct message in the message queue memory; note that delete should not be called on the return value
1261 new(slot) LocalType(&manager, &UpdateManager::RemoveGeometry, &geometry);
1264 inline void AttachVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1266 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1268 // Reserve some memory inside the message queue
1269 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1271 // Construct message in the message queue memory; note that delete should not be called on the return value
1272 new(slot) LocalType(&manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1275 inline void RemoveVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1277 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1279 // Reserve some memory inside the message queue
1280 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1282 // Construct message in the message queue memory; note that delete should not be called on the return value
1283 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1286 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1287 template<typename T>
1288 class IndexBufferMessage : public MessageBase
1292 * Constructor which does a Vector::Swap()
1294 IndexBufferMessage(T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices)
1297 mRenderGeometry(geometry)
1299 mIndices.Swap(indices);
1303 * Virtual destructor
1305 ~IndexBufferMessage() override = default;
1308 * @copydoc MessageBase::Process
1310 void Process(BufferIndex /*bufferIndex*/) override
1312 DALI_ASSERT_DEBUG(mManager && "Message does not have an object");
1313 mManager->SetIndexBuffer(mRenderGeometry, mIndices);
1318 Render::Geometry* mRenderGeometry;
1319 Dali::Vector<uint16_t> mIndices;
1322 inline void SetIndexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices)
1324 using LocalType = IndexBufferMessage<UpdateManager>;
1326 // Reserve some memory inside the message queue
1327 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1329 // Construct message in the message queue memory; note that delete should not be called on the return value
1330 new(slot) LocalType(&manager, &geometry, indices);
1333 inline void SetGeometryTypeMessage(UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType)
1335 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, uint32_t>;
1337 // Reserve some memory inside the message queue
1338 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1340 // Construct message in the message queue memory; note that delete should not be called on the return value
1341 new(slot) LocalType(&manager, &UpdateManager::SetGeometryType, &geometry, geometryType);
1344 inline void AddTexture(UpdateManager& manager, OwnerPointer<Render::Texture>& texture)
1346 // Message has ownership of Texture while in transit from event -> update
1347 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Texture> >;
1349 // Reserve some memory inside the message queue
1350 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1352 // Construct message in the message queue memory; note that delete should not be called on the return value
1353 new(slot) LocalType(&manager, &UpdateManager::AddTexture, texture);
1356 inline void RemoveTexture(UpdateManager& manager, Render::Texture& texture)
1358 using LocalType = MessageValue1<UpdateManager, Render::Texture*>;
1360 // Reserve some memory inside the message queue
1361 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1363 // Construct message in the message queue memory; note that delete should not be called on the return value
1364 new(slot) LocalType(&manager, &UpdateManager::RemoveTexture, &texture);
1367 inline void UploadTextureMessage(UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params)
1369 using LocalType = MessageValue3<UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams>;
1371 // Reserve some memory inside the message queue
1372 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1374 // Construct message in the message queue memory; note that delete should not be called on the return value
1375 new(slot) LocalType(&manager, &UpdateManager::UploadTexture, &texture, pixelData, params);
1378 inline void GenerateMipmapsMessage(UpdateManager& manager, Render::Texture& texture)
1380 using LocalType = MessageValue1<UpdateManager, Render::Texture*>;
1382 // Reserve some memory inside the message queue
1383 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1385 // Construct message in the message queue memory; note that delete should not be called on the return value
1386 new(slot) LocalType(&manager, &UpdateManager::GenerateMipmaps, &texture);
1389 inline void AddFrameBuffer(UpdateManager& manager, OwnerPointer<Render::FrameBuffer>& frameBuffer)
1391 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::FrameBuffer> >;
1393 // Reserve some memory inside the message queue
1394 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1396 // Construct message in the message queue memory; note that delete should not be called on the return value
1397 new(slot) LocalType(&manager, &UpdateManager::AddFrameBuffer, frameBuffer);
1400 inline void RemoveFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer)
1402 using LocalType = MessageValue1<UpdateManager, Render::FrameBuffer*>;
1404 // Reserve some memory inside the message queue
1405 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1407 // Construct message in the message queue memory; note that delete should not be called on the return value
1408 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer);
1411 inline void AttachColorTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer)
1413 using LocalType = MessageValue4<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t>;
1415 // Reserve some memory inside the message queue
1416 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1418 // Construct message in the message queue memory; note that delete should not be called on the return value
1419 new(slot) LocalType(&manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer);
1422 inline void AttachDepthTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1424 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1426 // Reserve some memory inside the message queue
1427 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1429 // Construct message in the message queue memory; note that delete should not be called on the return value
1430 new(slot) LocalType(&manager, &UpdateManager::AttachDepthTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1433 inline void AttachDepthStencilTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1435 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1437 // Reserve some memory inside the message queue
1438 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1440 // Construct message in the message queue memory; note that delete should not be called on the return value
1441 new(slot) LocalType(&manager, &UpdateManager::AttachDepthStencilTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1444 inline void SetDepthIndicesMessage(UpdateManager& manager, OwnerPointer<NodeDepths>& nodeDepths)
1446 using LocalType = MessageValue1<UpdateManager, OwnerPointer<NodeDepths> >;
1448 // Reserve some memory inside the message queue
1449 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1451 // Construct message in the message queue memory; note that delete should not be called on the return value
1452 new(slot) LocalType(&manager, &UpdateManager::SetDepthIndices, nodeDepths);
1455 inline void AddResetterMessage(UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter)
1457 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyResetterBase> >;
1459 // Reserve some memory inside the message queue
1460 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1462 // Construct message in the message queue memory; note that delete should not be called on the return value
1463 new(slot) LocalType(&manager, &UpdateManager::AddPropertyResetter, resetter);
1466 inline void AddFrameCallbackMessage(UpdateManager& manager, OwnerPointer<FrameCallback>& frameCallback, const Node& rootNode)
1468 using LocalType = MessageValue2<UpdateManager, OwnerPointer<FrameCallback>, const Node*>;
1470 // Reserve some memory inside the message queue
1471 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1473 // Construct message in the message queue memory; note that delete should not be called on the return value
1474 new(slot) LocalType(&manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode);
1477 inline void RemoveFrameCallbackMessage(UpdateManager& manager, FrameCallbackInterface& frameCallback)
1479 using LocalType = MessageValue1<UpdateManager, FrameCallbackInterface*>;
1481 // Reserve some memory inside the message queue
1482 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1484 // Construct message in the message queue memory; note that delete should not be called on the return value
1485 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameCallback, &frameCallback);
1488 } // namespace SceneGraph
1490 } // namespace Internal
1494 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H