1 #ifndef DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/public-api/common/vector-wrapper.h>
25 #include <dali/devel-api/common/stage-devel.h>
27 #include <dali/internal/common/message.h>
28 #include <dali/internal/common/shader-saver.h>
29 #include <dali/internal/common/type-abstraction-enums.h>
30 #include <dali/internal/event/common/event-thread-services.h>
31 #include <dali/internal/event/rendering/texture-impl.h>
32 #include <dali/internal/render/renderers/render-texture.h> // For OwnerPointer<Render::Texture>
33 #include <dali/internal/render/renderers/render-vertex-buffer.h>
34 #include <dali/internal/render/shaders/render-shader.h> // for OwnerPointer< Shader >
35 #include <dali/internal/update/animation/scene-graph-animation.h>
36 #include <dali/internal/update/common/node-resetter.h>
37 #include <dali/internal/update/common/property-resetter.h>
38 #include <dali/internal/update/common/scene-graph-buffers.h>
39 #include <dali/internal/update/common/scene-graph-property-notification.h>
40 #include <dali/internal/update/common/scene-graph-scene.h>
41 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
42 #include <dali/internal/update/manager/scene-graph-frame-callback.h> // for OwnerPointer< FrameCallback >
43 #include <dali/internal/update/nodes/node.h>
44 #include <dali/internal/update/nodes/scene-graph-layer.h>
45 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
46 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
47 #include <dali/internal/update/rendering/scene-graph-renderer.h> // for OwnerPointer< Renderer >
48 #include <dali/internal/update/rendering/scene-graph-texture-set.h> // for OwnerPointer< TextureSet >
55 class FrameCallbackInterface;
59 class RenderController;
61 } // namespace Integration
65 class PropertyNotifier;
66 class NotificationManager;
67 class CompleteNotificationInterface;
75 // value types used by messages
77 struct ParameterType<PropertyNotification::NotifyMode>
78 : 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] discardQueue Nodes are added here when disconnected from the scene-graph.
109 * @param[in] controller After messages are flushed, we request a render from the RenderController.
110 * @param[in] renderManager This is responsible for rendering the results of each "update".
111 * @param[in] renderQueue Used to queue messages for the next render.
112 * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
114 UpdateManager(NotificationManager& notificationManager,
115 CompleteNotificationInterface& animationPlaylist,
116 PropertyNotifier& propertyNotifier,
117 DiscardQueue& discardQueue,
118 Integration::RenderController& controller,
119 RenderManager& renderManager,
120 RenderQueue& renderQueue,
121 RenderTaskProcessor& renderTaskProcessor);
126 ~UpdateManager() override;
128 // Node connection methods
131 * Installs a new layer as the root node.
132 * @pre The layer is of derived Node type Layer.
133 * @pre The layer does not have a parent.
134 * @param[in] layer The new root node.
135 * @post The node is owned by UpdateManager.
137 void InstallRoot(OwnerPointer<Layer>& layer);
140 * Uninstalls the root node.
141 * @pre The layer is of derived Node type Layer.
142 * @pre The layer does not have a parent.
143 * @param[in] layer The root node.
144 * @post The node is owned by UpdateManager.
146 void UninstallRoot(Layer* layer);
149 * Add a Node; UpdateManager takes ownership.
150 * @pre The node does not have a parent.
151 * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
152 * @param[in] node The node to add.
154 void AddNode(OwnerPointer<Node>& node);
157 * Connect a Node to the scene-graph.
158 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
159 * @pre The node does not already have a parent.
160 * @param[in] parent The new parent node.
162 void ConnectNode(Node* parent, Node* node);
165 * Disconnect a Node from the scene-graph.
166 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
167 * @pre The node has a parent.
168 * @param[in] node The node to disconnect.
170 void DisconnectNode(Node* node);
173 * Destroy a Node owned by UpdateManager.
174 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
175 * In the following update, the previously queued Nodes may be deleted.
176 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
177 * @param[in] node The node to destroy.
179 void DestroyNode(Node* node);
182 * Add a newly created object.
183 * @param[in] object The object to add.
184 * @post The object is owned by UpdateManager.
186 void AddObject(OwnerPointer<PropertyOwner>& object);
190 * @param[in] object The object to remove.
192 void RemoveObject(PropertyOwner* object);
195 * Add a newly created render task list.
196 * @param[in] taskList The render task list to add.
197 * @post The render task list is owned by UpdateManager.
199 void AddRenderTaskList(OwnerPointer<RenderTaskList>& taskList);
202 * Remove a render task list.
203 * @param[in] taskList The render task list to remove.
205 void RemoveRenderTaskList(RenderTaskList* taskList);
208 * Add a newly created scene.
209 * @param[in] scene The scene to add.
210 * @post The scene is owned by UpdateManager.
212 void AddScene(OwnerPointer<Scene>& scene);
216 * @param[in] scene The scene to remove.
218 void RemoveScene(Scene* scene);
223 * Add a newly created animation.
224 * @param[in] animation The animation to add.
225 * @post The animation is owned by UpdateManager.
227 void AddAnimation(OwnerPointer<SceneGraph::Animation>& animation);
231 * @param[in] animation The animation to stop.
233 void StopAnimation(Animation* animation);
236 * Remove an animation.
237 * @param[in] animation The animation to remove.
239 void RemoveAnimation(Animation* animation);
242 * Query whether any animations are currently running.
243 * @return True if any animations are running.
245 bool IsAnimationRunning() const;
248 * Add a property resetter. UpdateManager takes ownership of the object.
249 * It will be killed by UpdateManager when the associated animator or
250 * constraint has finished; or the property owner of the property is destroyed.
252 void AddPropertyResetter(OwnerPointer<PropertyResetterBase>& propertyResetter);
255 * Add a node resetter. UpdateManager takes ownership of the object.
256 * It will be killed by UpdateManager when the node is disconnected from the scene graph;
257 * or when the node is destroyed.
259 void AddNodeResetter(const Node& node);
261 // Property Notification
264 * Add a newly created property notification
265 * @param[in] propertyNotification The notification to add
266 * @post The propertyNotification is owned by UpdateManager.
268 void AddPropertyNotification(OwnerPointer<PropertyNotification>& propertyNotification);
271 * Remove a property notification
272 * @param[in] propertyNotification The notification to remove
274 void RemovePropertyNotification(PropertyNotification* propertyNotification);
277 * Set Notify state for PropertyNotification
278 * @param[in] propertyNotification The notification to remove
279 * @param[in] notifyMode The notification mode.
281 void PropertyNotificationSetNotify(PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode);
286 * Add a newly created shader.
287 * @param[in] shader The shader to add.
288 * @post The shader is owned by the UpdateManager.
290 void AddShader(OwnerPointer<Shader>& shader);
294 * @pre The shader has been added to the UpdateManager.
295 * @param[in] shader The shader to remove.
296 * @post The shader is destroyed.
298 void RemoveShader(Shader* shader);
301 * Set the shader data for a Shader object
302 * @param[in] shader The shader to modify
303 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
305 void SetShaderData(Shader* shader, Internal::ShaderDataPtr shaderData);
308 * @brief Accept compiled shaders passed back on render thread for saving.
309 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
311 void SaveBinary(Internal::ShaderDataPtr shaderData) override;
314 * @brief Set the destination for compiled shader binaries to be passed on to.
315 * The dispatcher passed in will be called from the update thread.
316 * @param[in] upstream A sink for ShaderDatas to be passed into.
318 void SetShaderSaver(ShaderSaver& upstream);
323 * Add a new renderer to scene
324 * @param renderer to add
326 void AddRenderer(OwnerPointer<Renderer>& renderer);
329 * Add a renderer from scene
330 * @param renderer to remove
332 void RemoveRenderer(Renderer* renderer);
335 * Attach a renderer to node
336 * @param renderer to attach
338 void AttachRenderer(Node* node, Renderer* renderer);
343 * Set the pan gesture processor.
344 * Pan Gesture processor lives for the lifetime of UpdateManager
345 * @param[in] gesture The gesture processor.
346 * @post The gestureProcessor is owned by the UpdateManager.
348 void SetPanGestureProcessor(PanGesture* gestureProcessor);
353 * Add a newly created TextureSet.
354 * @param[in] textureSet The texture set to add.
355 * @post The TextureSet is owned by the UpdateManager.
357 void AddTextureSet(OwnerPointer<TextureSet>& textureSet);
360 * Remove a TextureSet.
361 * @pre The TextureSet has been added to the UpdateManager.
362 * @param[in] textureSet The TextureSet to remove.
363 * @post The TextureSet is destroyed.
365 void RemoveTextureSet(TextureSet* textureSet);
370 * Get the scene graph side list of RenderTasks.
371 * @param[in] systemLevel True if using the system-level overlay.
372 * @return The list of render tasks
374 RenderTaskList* GetRenderTaskList(bool systemLevel);
376 // Message queue handling
379 * Reserve space for another message in the queue; this must then be initialized by the caller.
380 * The message will be read from the update-thread after the next FlushMessages is called.
381 * @post Calling this method may invalidate any previously returned slots.
382 * @param[in] size The message size with respect to the size of type "char".
383 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
384 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
385 * @return A pointer to the first char allocated for the message.
387 uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene = true);
390 * @return the current event-buffer index.
392 BufferIndex GetEventBufferIndex() const
394 // inlined as its called often from event thread
395 return mSceneGraphBuffers.GetEventBufferIndex();
399 * Called by the event-thread to signal that FlushQueue will be called
400 * e.g. when it has finished event processing.
402 void EventProcessingStarted();
405 * Flush the set of messages, which were previously stored with QueueMessage().
406 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
408 * @return True if there are messages to process.
413 * Add a new sampler to RenderManager
414 * @param[in] sampler The sampler to add
415 * @post Sends a message to RenderManager to add the sampler.
416 * The sampler will be owned by RenderManager
418 void AddSampler(OwnerPointer<Render::Sampler>& sampler);
421 * Removes an existing sampler from RenderManager
422 * @param[in] sampler The sampler to remove
423 * @post The sampler will be destroyed in the render thread
425 void RemoveSampler(Render::Sampler* sampler);
428 * Sets the filter modes for an existing sampler
429 * @param[in] sampler The sampler
430 * @param[in] minFilterMode The filter to use under minification
431 * @param[in] magFilterMode The filter to use under magnification
433 void SetFilterMode(Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode);
436 * Sets the wrap mode for an existing sampler
437 * @param[in] sampler The sampler
438 * @param[in] rWrapMode Wrapping mode in z direction
439 * @param[in] sWrapMode Wrapping mode in x direction
440 * @param[in] tWrapMode Wrapping mode in y direction
442 void SetWrapMode(Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode);
445 * Add a new property buffer to RenderManager
446 * @param[in] propertryBuffer The property buffer to add
447 * @post Sends a message to RenderManager to add the property buffer.
448 * The property buffer will be owned by RenderManager
450 void AddVertexBuffer(OwnerPointer<Render::VertexBuffer>& propertryBuffer);
453 * Removes an existing VertexBuffer from RenderManager
454 * @param[in] propertryBuffer The property buffer to remove
455 * @post The property buffer will be destroyed in the render thread
457 void RemoveVertexBuffer(Render::VertexBuffer* propertryBuffer);
460 * Sets the format of an existing property buffer
461 * @param[in] vertexBuffer The property buffer.
462 * @param[in] format The new format of the buffer
463 * @post Sends a message to RenderManager to set the new format to the property buffer.
465 void SetVertexBufferFormat(Render::VertexBuffer* vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format);
468 * Sets the data of an existing property buffer
469 * @param[in] vertexBuffer The property buffer.
470 * @param[in] data The new data of the buffer
471 * @param[in] size The new size of the buffer
472 * @post Sends a message to RenderManager to set the new data to the property buffer.
474 void SetVertexBufferData(Render::VertexBuffer* vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size);
477 * Adds a geometry to the RenderManager
478 * @param[in] geometry The geometry to add
479 * @post Sends a message to RenderManager to add the Geometry
480 * The geometry will be owned by RenderManager
482 void AddGeometry(OwnerPointer<Render::Geometry>& geometry);
485 * Removes an existing Geometry from RenderManager
486 * @param[in] geometry The geometry to remove
487 * @post The geometry will be destroyed in the render thread
489 void RemoveGeometry(Render::Geometry* geometry);
492 * Sets the geometry type of an existing Geometry
493 * @param[in] geometry The geometry
494 * @param[in] geometryType The type of the geometry
496 void SetGeometryType(Render::Geometry* geometry, uint32_t geometryType);
499 * Sets the index buffer to be used by a geometry
500 * @param[in] geometry The geometry
501 * @param[in] indices A vector containing the indices for the geometry
503 void SetIndexBuffer(Render::Geometry* geometry, Dali::Vector<uint16_t>& indices);
506 * Adds a vertex buffer to a geometry
507 * @param[in] geometry The geometry
508 * @param[in] vertexBuffer The property buffer
510 void AttachVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
513 * Removes a vertex buffer from a geometry
514 * @param[in] geometry The geometry
515 * @param[in] vertexBuffer The property buffer
517 void RemoveVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
520 * Adds a texture to the render manager
521 * @param[in] texture The texture to add
522 * The texture will be owned by RenderManager
524 void AddTexture(OwnerPointer<Render::Texture>& texture);
527 * Removes a texture from the render manager
528 * @param[in] texture The texture to remove
529 * @post The texture will be destroyed in the render thread
531 void RemoveTexture(Render::Texture* texture);
534 * Uploads data to a texture owned by the RenderManager
535 * @param[in] texture The texture
536 * @param[in] pixelData The pixel data object
537 * @param[in] params The parameters for the upload
539 void UploadTexture(Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params);
542 * Generates mipmaps for a texture owned by the RenderManager
543 * @param[in] texture The texture
545 void GenerateMipmaps(Render::Texture* texture);
548 * Adds a framebuffer to the render manager
549 * @param[in] frameBuffer The framebuffer to add
550 * The framebuffer will be owned by RenderManager
552 void AddFrameBuffer(OwnerPointer<Render::FrameBuffer>& frameBuffer);
555 * Removes a FrameBuffer from the render manager
556 * @param[in] frameBuffer The FrameBuffer to remove
557 * @post The FrameBuffer will be destroyed in the render thread
559 void RemoveFrameBuffer(Render::FrameBuffer* frameBuffer);
562 * Attach a texture as color output to an existing FrameBuffer
563 * @param[in] frameBuffer The FrameBuffer
564 * @param[in] texture The texture that will be used as output when rendering
565 * @param[in] mipmapLevel The mipmap of the texture to be attached
566 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
568 void AttachColorTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face);
571 * Attach a texture as depth 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
576 void AttachDepthTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
579 * Attach a texture as depth/stencil output to an existing FrameBuffer
580 * @param[in] frameBuffer The FrameBuffer
581 * @param[in] texture The texture that will be used as output when rendering
582 * @param[in] mipmapLevel The mipmap of the texture to be attached
584 void AttachDepthStencilTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
587 * Set a multisampling level value as texture output to the existing FrameBuffer
588 * @param[in] frameBuffer The FrameBuffer
589 * @param[in] multiSamplingLevel The level of multisampling
591 void SetMultiSamplingLevelToFrameBuffer(Render::FrameBuffer* frameBuffer, uint8_t multiSamplingLevel);
594 * This is called when the surface of the scene has been replaced.
595 * @param[in] scene The scene.
597 void SurfaceReplaced(Scene* scene);
601 * Performs an Update traversal on the scene-graph.
602 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
603 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
604 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
605 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
606 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
607 * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
608 * @return True if further updates are required e.g. during animations.
610 uint32_t Update(float elapsedSeconds,
611 uint32_t lastVSyncTimeMilliseconds,
612 uint32_t nextVSyncTimeMilliseconds,
613 bool renderToFboEnabled,
614 bool isRenderingToFbo,
618 * This is called after rendering all the scenes in the next frame.
623 * @copydoc Dali::Stage::KeepRendering()
625 void KeepRendering(float durationSeconds);
628 * @copydoc Dali::DevelStage::SetRenderingBehavior()
630 void SetRenderingBehavior(DevelStage::Rendering renderingBehavior);
633 * Request to render the current frame
634 * @note This is a temporary workaround (to be removed in the future) to request the rendering of
635 * the current frame if the color or visibility of any actor is updated. It MUST NOT be used
636 * for any other purposes.
638 void RequestRendering();
641 * Sets the depths of all layers.
642 * @param layers The layers in depth order.
643 * @param[in] rootLayer The root layer of the sorted layers.
645 void SetLayerDepths(const std::vector<Layer*>& layers, const Layer* rootLayer);
648 * Set the depth indices of all nodes (in LayerUI's)
649 * @param[in] nodeDepths A vector of nodes and associated depth indices
651 void SetDepthIndices(OwnerPointer<NodeDepths>& nodeDepths);
654 * Adds an implementation of the FrameCallbackInterface.
655 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
656 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
658 void AddFrameCallback(OwnerPointer<FrameCallback>& frameCallback, const Node* rootNode);
661 * Removes the specified implementation of FrameCallbackInterface.
662 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
664 void RemoveFrameCallback(FrameCallbackInterface* frameCallback);
667 * Get the update message queue capacity (mutex locked)
669 std::size_t GetUpdateMessageQueueCapacity() const;
672 * Get the render message queue capacity
674 std::size_t GetRenderMessageQueueCapacity() const;
677 * Get the render instruction capacity
679 std::size_t GetRenderInstructionCapacity() const;
683 UpdateManager(const UpdateManager&);
686 UpdateManager& operator=(const UpdateManager& rhs);
689 * Add a camera on scene
690 * @param[in] camera The camera to add
692 void AddCamera(Camera* camera);
695 * Remove a camera from scene
696 * @param[in] camera to remove
698 void RemoveCamera(Camera* camera);
701 * Helper to check whether the update-thread should keep going.
702 * @param[in] elapsedSeconds The time in seconds since the previous update.
703 * @return True if the update-thread should keep going.
705 uint32_t KeepUpdatingCheck(float elapsedSeconds) const;
708 * Helper to reset all Node properties
709 * @param[in] bufferIndex to use
711 void ResetProperties(BufferIndex bufferIndex);
714 * Perform gesture updates.
715 * @param[in] bufferIndex to use
716 * @param[in] lastVSyncTime The last VSync time in milliseconds.
717 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
718 * @return true, if any properties were updated.
720 bool ProcessGestures(BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds);
723 * Perform animation updates
724 * @param[in] bufferIndex to use
725 * @param[in] elapsedSeconds time since last frame
726 * @return true if at least one animations is currently active or false otherwise
728 bool Animate(BufferIndex bufferIndex, float elapsedSeconds);
731 * Applies constraints to CustomObjects
732 * @param[in] bufferIndex to use
734 void ConstrainCustomObjects(BufferIndex bufferIndex);
737 * Applies constraints to RenderTasks
738 * @param[in] bufferIndex to use
740 void ConstrainRenderTasks(BufferIndex bufferIndex);
743 * Applies constraints to Shaders
744 * @param[in] bufferIndex to use
746 void ConstrainShaders(BufferIndex bufferIndex);
749 * Perform property notification updates
750 * @param[in] bufferIndex to use
752 void ProcessPropertyNotifications(BufferIndex bufferIndex);
755 * Pass shader binaries queued here on to event thread.
757 void ForwardCompiledShadersToEventThread();
760 * Update node shaders, opacity, geometry etc.
761 * @param[in] bufferIndex to use
763 void UpdateNodes(BufferIndex bufferIndex);
766 * initialize layer renderables
767 * @param[in] bufferIndex
769 void UpdateLayers(BufferIndex bufferIndex);
773 * @param[in] bufferIndex to use
775 void UpdateRenderers(BufferIndex bufferIndex);
778 // needs to be direct member so that getter for event buffer can be inlined
779 SceneGraphBuffers mSceneGraphBuffers;
785 // Messages for UpdateManager
787 inline void InstallRootMessage(UpdateManager& manager, OwnerPointer<Layer>& root)
789 // Message has ownership of Layer while in transit from event -> update
790 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Layer>>;
792 // Reserve some memory inside the message queue
793 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
795 // Construct message in the message queue memory; note that delete should not be called on the return value
796 new(slot) LocalType(&manager, &UpdateManager::InstallRoot, root);
799 inline void UninstallRootMessage(UpdateManager& manager, const Layer* constRoot)
801 // Scene graph thread can destroy this object.
802 Layer* root = const_cast<Layer*>(constRoot);
804 using LocalType = MessageValue1<UpdateManager, Layer*>;
806 // Reserve some memory inside the message queue
807 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
809 // Construct message in the message queue memory; note that delete should not be called on the return value
810 new(slot) LocalType(&manager, &UpdateManager::UninstallRoot, root);
813 inline void AddNodeMessage(UpdateManager& manager, OwnerPointer<Node>& node)
815 // Message has ownership of Node while in transit from event -> update
816 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Node>>;
818 // Reserve some memory inside the message queue
819 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
821 // Construct message in the message queue memory; note that delete should not be called on the return value
822 new(slot) LocalType(&manager, &UpdateManager::AddNode, node);
825 inline void ConnectNodeMessage(UpdateManager& manager, const Node& constParent, const Node& constChild)
827 // Update thread can edit the object
828 Node& parent = const_cast<Node&>(constParent);
829 Node& child = const_cast<Node&>(constChild);
831 using LocalType = MessageValue2<UpdateManager, Node*, Node*>;
833 // Reserve some memory inside the message queue
834 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
836 // Construct message in the message queue memory; note that delete should not be called on the return value
837 new(slot) LocalType(&manager, &UpdateManager::ConnectNode, &parent, &child);
840 inline void DisconnectNodeMessage(UpdateManager& manager, const Node& constNode)
842 // Scene graph thread can modify this object.
843 Node& node = const_cast<Node&>(constNode);
845 using LocalType = MessageValue1<UpdateManager, Node*>;
847 // Reserve some memory inside the message queue
848 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
850 // Construct message in the message queue memory; note that delete should not be called on the return value
851 new(slot) LocalType(&manager, &UpdateManager::DisconnectNode, &node);
854 inline void DestroyNodeMessage(UpdateManager& manager, const Node& constNode)
856 // Scene graph thread can destroy this object.
857 Node& node = const_cast<Node&>(constNode);
859 using LocalType = MessageValue1<UpdateManager, Node*>;
861 // Reserve some memory inside the message queue
862 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
864 // Construct message in the message queue memory; note that delete should not be called on the return value
865 new(slot) LocalType(&manager, &UpdateManager::DestroyNode, &node);
868 inline void AddObjectMessage(UpdateManager& manager, OwnerPointer<PropertyOwner>& object)
870 // Message has ownership of object while in transit from event -> update
871 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyOwner>>;
873 // Reserve some memory inside the message queue
874 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
876 // Construct message in the message queue memory; note that delete should not be called on the return value
877 new(slot) LocalType(&manager, &UpdateManager::AddObject, object);
880 inline void RemoveObjectMessage(UpdateManager& manager, const PropertyOwner* object)
882 using LocalType = MessageValue1<UpdateManager, PropertyOwner*>;
884 // Reserve some memory inside the message queue
885 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
887 // Construct message in the message queue memory; note that delete should not be called on the return value
888 new(slot) LocalType(&manager, &UpdateManager::RemoveObject, const_cast<PropertyOwner*>(object));
891 inline void AddAnimationMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Animation>& animation)
893 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Animation>>;
895 // Reserve some memory inside the message queue
896 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
898 // Construct message in the message queue memory; note that delete should not be called on the return value
899 new(slot) LocalType(&manager, &UpdateManager::AddAnimation, animation);
902 inline void StopAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
904 // The scene-graph thread owns this object so it can safely edit it.
905 Animation& animation = const_cast<Animation&>(constAnimation);
907 using LocalType = MessageValue1<UpdateManager, Animation*>;
909 // Reserve some memory inside the message queue
910 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
912 // Construct message in the message queue memory; note that delete should not be called on the return value
913 new(slot) LocalType(&manager, &UpdateManager::StopAnimation, &animation);
916 inline void RemoveAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
918 // The scene-graph thread owns this object so it can safely edit it.
919 Animation& animation = const_cast<Animation&>(constAnimation);
921 using LocalType = MessageValue1<UpdateManager, Animation*>;
923 // Reserve some memory inside the message queue
924 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
926 // Construct message in the message queue memory; note that delete should not be called on the return value
927 new(slot) LocalType(&manager, &UpdateManager::RemoveAnimation, &animation);
930 inline void AddRenderTaskListMessage(UpdateManager& manager, OwnerPointer<SceneGraph::RenderTaskList>& taskList)
932 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::RenderTaskList>>;
934 // Reserve some memory inside the message queue
935 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
937 // Construct message in the message queue memory; note that delete should not be called on the return value
938 new(slot) LocalType(&manager, &UpdateManager::AddRenderTaskList, taskList);
941 inline void RemoveRenderTaskListMessage(UpdateManager& manager, const RenderTaskList& constTaskList)
943 // The scene-graph thread owns this object so it can safely edit it.
944 RenderTaskList& taskList = const_cast<RenderTaskList&>(constTaskList);
946 using LocalType = MessageValue1<UpdateManager, RenderTaskList*>;
948 // Reserve some memory inside the message queue
949 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
951 // Construct message in the message queue memory; note that delete should not be called on the return value
952 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderTaskList, &taskList);
955 inline void AddSceneMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Scene>& scene)
957 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Scene>>;
959 // Reserve some memory inside the message queue
960 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
962 // Construct message in the message queue memory; note that delete should not be called on the return value
963 new(slot) LocalType(&manager, &UpdateManager::AddScene, scene);
966 inline void RemoveSceneMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
968 // The scene-graph thread owns this object so it can safely edit it.
969 Scene& scene = const_cast<Scene&>(constScene);
971 using LocalType = MessageValue1<UpdateManager, Scene*>;
973 // Reserve some memory inside the message queue
974 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
976 // Construct message in the message queue memory; note that delete should not be called on the return value
977 new(slot) LocalType(&manager, &UpdateManager::RemoveScene, &scene);
980 inline void AddPropertyNotificationMessage(UpdateManager& manager, OwnerPointer<PropertyNotification>& propertyNotification)
982 // Message has ownership of PropertyNotification while in transit from event -> update
983 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyNotification>>;
985 // Reserve some memory inside the message queue
986 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
988 // Construct message in the message queue memory; note that delete should not be called on the return value
989 new(slot) LocalType(&manager, &UpdateManager::AddPropertyNotification, propertyNotification);
992 inline void RemovePropertyNotificationMessage(UpdateManager& manager, const PropertyNotification& constPropertyNotification)
994 // The scene-graph thread owns this object so it can safely edit it.
995 PropertyNotification& propertyNotification = const_cast<PropertyNotification&>(constPropertyNotification);
997 using LocalType = MessageValue1<UpdateManager, PropertyNotification*>;
999 // Reserve some memory inside the message queue
1000 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1002 // Construct message in the message queue memory; note that delete should not be called on the return value
1003 new(slot) LocalType(&manager, &UpdateManager::RemovePropertyNotification, &propertyNotification);
1006 inline void PropertyNotificationSetNotifyModeMessage(UpdateManager& manager,
1007 const PropertyNotification* constPropertyNotification,
1008 PropertyNotification::NotifyMode notifyMode)
1010 // The scene-graph thread owns this object so it can safely edit it.
1011 PropertyNotification* propertyNotification = const_cast<PropertyNotification*>(constPropertyNotification);
1013 using LocalType = MessageValue2<UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode>;
1015 // Reserve some memory inside the message queue
1016 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1018 // Construct message in the message queue memory; note that delete should not be called on the return value
1019 new(slot) LocalType(&manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode);
1022 // The render thread can safely change the Shader
1023 inline void AddShaderMessage(UpdateManager& manager, OwnerPointer<Shader>& shader)
1025 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Shader>>;
1027 // Reserve some memory inside the message queue
1028 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1030 // Construct message in the message queue memory; note that delete should not be called on the return value
1031 new(slot) LocalType(&manager, &UpdateManager::AddShader, shader);
1034 // The render thread can safely change the Shader
1035 inline void RemoveShaderMessage(UpdateManager& manager, const Shader* shader)
1037 using LocalType = MessageValue1<UpdateManager, Shader*>;
1039 // Reserve some memory inside the message queue
1040 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1042 // Construct message in the message queue memory; note that delete should not be called on the return value
1043 new(slot) LocalType(&manager, &UpdateManager::RemoveShader, const_cast<Shader*>(shader));
1046 inline void SurfaceReplacedMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
1048 // The scene-graph thread owns this object so it can safely edit it.
1049 Scene& scene = const_cast<Scene&>(constScene);
1051 using LocalType = MessageValue1<UpdateManager, Scene*>;
1053 // Reserve some memory inside the message queue
1054 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1056 // Construct message in the message queue memory; note that delete should not be called on the return value
1057 new(slot) LocalType(&manager, &UpdateManager::SurfaceReplaced, &scene);
1060 inline void KeepRenderingMessage(UpdateManager& manager, float durationSeconds)
1062 using LocalType = MessageValue1<UpdateManager, float>;
1064 // Reserve some memory inside the message queue
1065 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1067 // Construct message in the message queue memory; note that delete should not be called on the return value
1068 new(slot) LocalType(&manager, &UpdateManager::KeepRendering, durationSeconds);
1071 inline void SetRenderingBehaviorMessage(UpdateManager& manager, DevelStage::Rendering renderingBehavior)
1073 using LocalType = MessageValue1<UpdateManager, DevelStage::Rendering>;
1075 // Reserve some memory inside the message queue
1076 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1078 // Construct message in the message queue memory; note that delete should not be called on the return value
1079 new(slot) LocalType(&manager, &UpdateManager::SetRenderingBehavior, renderingBehavior);
1082 inline void RequestRenderingMessage(UpdateManager& manager)
1084 using LocalType = Message<UpdateManager>;
1086 // Reserve some memory inside the message queue
1087 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1089 // Construct message in the message queue memory; note that delete should not be called on the return value
1090 new(slot) LocalType(&manager, &UpdateManager::RequestRendering);
1094 * Create a message for setting the depth of a layer
1095 * @param[in] manager The update manager
1096 * @param[in] layers list of layers
1097 * @param[in] rootLayer The rool layer
1099 inline void SetLayerDepthsMessage(UpdateManager& manager, const std::vector<Layer*>& layers, const Layer* rootLayer)
1101 using LocalType = MessageValue2<UpdateManager, std::vector<Layer*>, const Layer*>;
1103 // Reserve some memory inside the message queue
1104 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1106 // Construct message in the message queue memory; note that delete should not be called on the return value
1107 new(slot) LocalType(&manager, &UpdateManager::SetLayerDepths, layers, rootLayer);
1110 inline void AddRendererMessage(UpdateManager& manager, OwnerPointer<Renderer>& object)
1112 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Renderer>>;
1114 // Reserve some memory inside the message queue
1115 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1116 // Construct message in the message queue memory; note that delete should not be called on the return value
1117 new(slot) LocalType(&manager, &UpdateManager::AddRenderer, object);
1120 inline void RemoveRendererMessage(UpdateManager& manager, const Renderer& object)
1122 using LocalType = MessageValue1<UpdateManager, Renderer*>;
1124 // Reserve some memory inside the message queue
1125 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1126 // Construct message in the message queue memory; note that delete should not be called on the return value
1127 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderer, const_cast<Renderer*>(&object));
1130 inline void AttachRendererMessage(UpdateManager& manager, const Node& node, const Renderer& renderer)
1132 using LocalType = MessageValue2<UpdateManager, Node*, Renderer*>;
1134 // Reserve some memory inside the message queue
1135 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1136 // Construct message in the message queue memory; note that delete should not be called on the return value
1137 new(slot) LocalType(&manager, &UpdateManager::AttachRenderer, const_cast<Node*>(&node), const_cast<Renderer*>(&renderer));
1140 // The render thread can safely change the Shader
1141 inline void AddTextureSetMessage(UpdateManager& manager, OwnerPointer<TextureSet>& textureSet)
1143 using LocalType = MessageValue1<UpdateManager, OwnerPointer<TextureSet>>;
1145 // Reserve some memory inside the message queue
1146 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1148 // Construct message in the message queue memory; note that delete should not be called on the return value
1149 new(slot) LocalType(&manager, &UpdateManager::AddTextureSet, textureSet);
1152 // The render thread can safely change the Shader
1153 inline void RemoveTextureSetMessage(UpdateManager& manager, TextureSet& textureSet)
1155 using LocalType = MessageValue1<UpdateManager, TextureSet*>;
1157 // Reserve some memory inside the message queue
1158 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1160 // Construct message in the message queue memory; note that delete should not be called on the return value
1161 new(slot) LocalType(&manager, &UpdateManager::RemoveTextureSet, &textureSet);
1164 inline void AddSamplerMessage(UpdateManager& manager, OwnerPointer<Render::Sampler>& sampler)
1166 // Message has ownership of Sampler while in transit from event -> update
1167 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Sampler>>;
1169 // Reserve some memory inside the message queue
1170 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1172 // Construct message in the message queue memory; note that delete should not be called on the return value
1173 new(slot) LocalType(&manager, &UpdateManager::AddSampler, sampler);
1176 inline void RemoveSamplerMessage(UpdateManager& manager, Render::Sampler& sampler)
1178 using LocalType = MessageValue1<UpdateManager, Render::Sampler*>;
1180 // Reserve some memory inside the message queue
1181 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1183 // Construct message in the message queue memory; note that delete should not be called on the return value
1184 new(slot) LocalType(&manager, &UpdateManager::RemoveSampler, &sampler);
1187 inline void SetFilterModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode)
1189 using LocalType = MessageValue3<UpdateManager, Render::Sampler*, uint32_t, uint32_t>;
1191 // Reserve some memory inside the message queue
1192 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1194 // Construct message in the message queue memory; note that delete should not be called on the return value
1195 new(slot) LocalType(&manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode);
1198 inline void SetWrapModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode)
1200 using LocalType = MessageValue4<UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t>;
1202 // Reserve some memory inside the message queue
1203 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1205 // Construct message in the message queue memory; note that delete should not be called on the return value
1206 new(slot) LocalType(&manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode);
1209 inline void AddVertexBuffer(UpdateManager& manager, OwnerPointer<Render::VertexBuffer>& vertexBuffer)
1211 // Message has ownership of vertexBuffer while in transit from event -> update
1212 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::VertexBuffer>>;
1214 // Reserve some memory inside the message queue
1215 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1217 // Construct message in the message queue memory; note that delete should not be called on the return value
1218 new(slot) LocalType(&manager, &UpdateManager::AddVertexBuffer, vertexBuffer);
1221 inline void RemoveVertexBuffer(UpdateManager& manager, Render::VertexBuffer& vertexBuffer)
1223 using LocalType = MessageValue1<UpdateManager, Render::VertexBuffer*>;
1225 // Reserve some memory inside the message queue
1226 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1228 // Construct message in the message queue memory; note that delete should not be called on the return value
1229 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &vertexBuffer);
1232 inline void SetVertexBufferFormat(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format)
1234 // Message has ownership of VertexBuffer::Format while in transit from event -> update
1235 using LocalType = MessageValue2<UpdateManager, Render::VertexBuffer*, OwnerPointer<Render::VertexBuffer::Format>>;
1237 // Reserve some memory inside the message queue
1238 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1240 // Construct message in the message queue memory; note that delete should not be called on the return value
1241 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferFormat, &vertexBuffer, format);
1244 inline void SetVertexBufferData(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size)
1246 // Message has ownership of VertexBuffer data while in transit from event -> update
1247 using LocalType = MessageValue3<UpdateManager, Render::VertexBuffer*, OwnerPointer<Vector<uint8_t>>, uint32_t>;
1249 // Reserve some memory inside the message queue
1250 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1252 // Construct message in the message queue memory; note that delete should not be called on the return value
1253 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferData, &vertexBuffer, data, size);
1256 inline void AddGeometry(UpdateManager& manager, OwnerPointer<Render::Geometry>& geometry)
1258 // Message has ownership of Geometry while in transit from event -> update
1259 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Geometry>>;
1261 // Reserve some memory inside the message queue
1262 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1264 // Construct message in the message queue memory; note that delete should not be called on the return value
1265 new(slot) LocalType(&manager, &UpdateManager::AddGeometry, geometry);
1268 inline void RemoveGeometry(UpdateManager& manager, Render::Geometry& geometry)
1270 using LocalType = MessageValue1<UpdateManager, Render::Geometry*>;
1272 // Reserve some memory inside the message queue
1273 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1275 // Construct message in the message queue memory; note that delete should not be called on the return value
1276 new(slot) LocalType(&manager, &UpdateManager::RemoveGeometry, &geometry);
1279 inline void AttachVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1281 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1283 // Reserve some memory inside the message queue
1284 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1286 // Construct message in the message queue memory; note that delete should not be called on the return value
1287 new(slot) LocalType(&manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1290 inline void RemoveVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1292 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1294 // Reserve some memory inside the message queue
1295 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1297 // Construct message in the message queue memory; note that delete should not be called on the return value
1298 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1301 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1302 template<typename T>
1303 class IndexBufferMessage : public MessageBase
1307 * Constructor which does a Vector::Swap()
1309 IndexBufferMessage(T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices)
1312 mRenderGeometry(geometry)
1314 mIndices.Swap(indices);
1318 * Virtual destructor
1320 ~IndexBufferMessage() override = default;
1323 * @copydoc MessageBase::Process
1325 void Process(BufferIndex /*bufferIndex*/) override
1327 DALI_ASSERT_DEBUG(mManager && "Message does not have an object");
1328 mManager->SetIndexBuffer(mRenderGeometry, mIndices);
1333 Render::Geometry* mRenderGeometry;
1334 Dali::Vector<uint16_t> mIndices;
1337 inline void SetIndexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices)
1339 using LocalType = IndexBufferMessage<UpdateManager>;
1341 // Reserve some memory inside the message queue
1342 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1344 // Construct message in the message queue memory; note that delete should not be called on the return value
1345 new(slot) LocalType(&manager, &geometry, indices);
1348 inline void SetGeometryTypeMessage(UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType)
1350 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, uint32_t>;
1352 // Reserve some memory inside the message queue
1353 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1355 // Construct message in the message queue memory; note that delete should not be called on the return value
1356 new(slot) LocalType(&manager, &UpdateManager::SetGeometryType, &geometry, geometryType);
1359 inline void AddTexture(UpdateManager& manager, OwnerPointer<Render::Texture>& texture)
1361 // Message has ownership of Texture while in transit from event -> update
1362 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Texture>>;
1364 // Reserve some memory inside the message queue
1365 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1367 // Construct message in the message queue memory; note that delete should not be called on the return value
1368 new(slot) LocalType(&manager, &UpdateManager::AddTexture, texture);
1371 inline void RemoveTexture(UpdateManager& manager, Render::Texture& texture)
1373 using LocalType = MessageValue1<UpdateManager, Render::Texture*>;
1375 // Reserve some memory inside the message queue
1376 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1378 // Construct message in the message queue memory; note that delete should not be called on the return value
1379 new(slot) LocalType(&manager, &UpdateManager::RemoveTexture, &texture);
1382 inline void UploadTextureMessage(UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params)
1384 using LocalType = MessageValue3<UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams>;
1386 // Reserve some memory inside the message queue
1387 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1389 // Construct message in the message queue memory; note that delete should not be called on the return value
1390 new(slot) LocalType(&manager, &UpdateManager::UploadTexture, &texture, pixelData, params);
1393 inline void GenerateMipmapsMessage(UpdateManager& manager, Render::Texture& texture)
1395 using LocalType = MessageValue1<UpdateManager, Render::Texture*>;
1397 // Reserve some memory inside the message queue
1398 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1400 // Construct message in the message queue memory; note that delete should not be called on the return value
1401 new(slot) LocalType(&manager, &UpdateManager::GenerateMipmaps, &texture);
1404 inline void AddFrameBuffer(UpdateManager& manager, OwnerPointer<Render::FrameBuffer>& frameBuffer)
1406 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::FrameBuffer>>;
1408 // Reserve some memory inside the message queue
1409 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1411 // Construct message in the message queue memory; note that delete should not be called on the return value
1412 new(slot) LocalType(&manager, &UpdateManager::AddFrameBuffer, frameBuffer);
1415 inline void RemoveFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer)
1417 using LocalType = MessageValue1<UpdateManager, Render::FrameBuffer*>;
1419 // Reserve some memory inside the message queue
1420 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1422 // Construct message in the message queue memory; note that delete should not be called on the return value
1423 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer);
1426 inline void AttachColorTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer)
1428 using LocalType = MessageValue4<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t>;
1430 // Reserve some memory inside the message queue
1431 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1433 // Construct message in the message queue memory; note that delete should not be called on the return value
1434 new(slot) LocalType(&manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer);
1437 inline void AttachDepthTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1439 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1441 // Reserve some memory inside the message queue
1442 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1444 // Construct message in the message queue memory; note that delete should not be called on the return value
1445 new(slot) LocalType(&manager, &UpdateManager::AttachDepthTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1448 inline void AttachDepthStencilTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1450 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1452 // Reserve some memory inside the message queue
1453 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1455 // Construct message in the message queue memory; note that delete should not be called on the return value
1456 new(slot) LocalType(&manager, &UpdateManager::AttachDepthStencilTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1459 inline void SetMultiSamplingLevelToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, uint8_t multiSamplingLevel)
1461 using LocalType = MessageValue2<UpdateManager, Render::FrameBuffer*, uint8_t>;
1463 // Reserve some memory inside the message queue
1464 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1466 // Construct message in the message queue memory; note that delete should not be called on the return value
1467 new(slot) LocalType(&manager, &UpdateManager::SetMultiSamplingLevelToFrameBuffer, &frameBuffer, multiSamplingLevel);
1470 inline void SetDepthIndicesMessage(UpdateManager& manager, OwnerPointer<NodeDepths>& nodeDepths)
1472 using LocalType = MessageValue1<UpdateManager, OwnerPointer<NodeDepths>>;
1474 // Reserve some memory inside the message queue
1475 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1477 // Construct message in the message queue memory; note that delete should not be called on the return value
1478 new(slot) LocalType(&manager, &UpdateManager::SetDepthIndices, nodeDepths);
1481 inline void AddResetterMessage(UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter)
1483 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyResetterBase>>;
1485 // Reserve some memory inside the message queue
1486 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1488 // Construct message in the message queue memory; note that delete should not be called on the return value
1489 new(slot) LocalType(&manager, &UpdateManager::AddPropertyResetter, resetter);
1492 inline void AddFrameCallbackMessage(UpdateManager& manager, OwnerPointer<FrameCallback>& frameCallback, const Node& rootNode)
1494 using LocalType = MessageValue2<UpdateManager, OwnerPointer<FrameCallback>, const Node*>;
1496 // Reserve some memory inside the message queue
1497 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1499 // Construct message in the message queue memory; note that delete should not be called on the return value
1500 new(slot) LocalType(&manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode);
1503 inline void RemoveFrameCallbackMessage(UpdateManager& manager, FrameCallbackInterface& frameCallback)
1505 using LocalType = MessageValue1<UpdateManager, FrameCallbackInterface*>;
1507 // Reserve some memory inside the message queue
1508 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1510 // Construct message in the message queue memory; note that delete should not be called on the return value
1511 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameCallback, &frameCallback);
1514 } // namespace SceneGraph
1516 } // namespace Internal
1520 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H