1 #ifndef DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
5 * Copyright (c) 2023 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/public-api/common/vector-wrapper.h>
25 #include <dali/devel-api/common/stage-devel.h>
27 #include <dali/internal/common/message.h>
28 #include <dali/internal/common/shader-saver.h>
29 #include <dali/internal/common/type-abstraction-enums.h>
30 #include <dali/internal/event/common/event-thread-services.h>
31 #include <dali/internal/event/rendering/texture-impl.h>
32 #include <dali/internal/render/renderers/render-texture-key.h> // For RenderTextureKey
33 #include <dali/internal/render/renderers/render-texture.h> // For OwnerPointer<Render::Texture>
34 #include <dali/internal/render/renderers/render-vertex-buffer.h>
35 #include <dali/internal/render/shaders/render-shader.h> // for OwnerPointer< Shader >
36 #include <dali/internal/update/animation/scene-graph-animation.h>
37 #include <dali/internal/update/common/node-resetter.h>
38 #include <dali/internal/update/common/property-resetter.h>
39 #include <dali/internal/update/common/scene-graph-buffers.h>
40 #include <dali/internal/update/common/scene-graph-property-notification.h>
41 #include <dali/internal/update/common/scene-graph-scene.h>
42 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
43 #include <dali/internal/update/manager/scene-graph-frame-callback.h> // for OwnerPointer< FrameCallback >
44 #include <dali/internal/update/nodes/node.h>
45 #include <dali/internal/update/nodes/scene-graph-layer.h>
46 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
47 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
48 #include <dali/internal/update/rendering/scene-graph-renderer.h> // for OwnerPointer< Renderer >
49 #include <dali/internal/update/rendering/scene-graph-texture-set.h> // for OwnerPointer< TextureSet >
56 class FrameCallbackInterface;
60 class RenderController;
62 } // namespace Integration
66 class PropertyNotifier;
67 class NotificationManager;
68 class CompleteNotificationInterface;
76 // value types used by messages
78 struct ParameterType<PropertyNotification::NotifyMode>
79 : public BasicType<PropertyNotification::NotifyMode>
88 class RenderTaskProcessor;
93 * UpdateManager maintains a scene graph i.e. a tree of nodes as well as
94 * other scene graph property owning objects.
95 * It controls the Update traversal, in which nodes are repositioned/animated,
96 * and organizes the the culling and rendering of the scene.
97 * It also maintains the lifecycle of nodes and other property owners that are
98 * disconnected from the scene graph.
100 class UpdateManager : public ShaderSaver
104 * Construct a new UpdateManager.
105 * @param[in] notificationManager This should be notified when animations have finished.
106 * @param[in] animationPlaylist The CompleteNotificationInterface that handles the animations
107 * @param[in] propertyNotifier The PropertyNotifier
108 * @param[in] controller After messages are flushed, we request a render from the RenderController.
109 * @param[in] renderManager This is responsible for rendering the results of each "update".
110 * @param[in] renderQueue Used to queue messages for the next render.
111 * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
113 UpdateManager(NotificationManager& notificationManager,
114 CompleteNotificationInterface& animationPlaylist,
115 PropertyNotifier& propertyNotifier,
116 Integration::RenderController& controller,
117 RenderManager& renderManager,
118 RenderQueue& renderQueue,
119 RenderTaskProcessor& renderTaskProcessor);
124 ~UpdateManager() override;
126 // Node connection methods
129 * Installs a new layer as the root node.
130 * @pre The layer is of derived Node type Layer.
131 * @pre The layer does not have a parent.
132 * @param[in] layer The new root node.
133 * @post The node is owned by UpdateManager.
135 void InstallRoot(OwnerPointer<Layer>& layer);
138 * Uninstalls the root node.
139 * @pre The layer is of derived Node type Layer.
140 * @pre The layer does not have a parent.
141 * @param[in] layer The root node.
142 * @post The node is owned by UpdateManager.
144 void UninstallRoot(Layer* layer);
147 * Add a Node; UpdateManager takes ownership.
148 * @pre The node does not have a parent.
149 * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
150 * @param[in] node The node to add.
152 void AddNode(OwnerPointer<Node>& node);
155 * Connect a Node to the scene-graph.
156 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
157 * @pre The node does not already have a parent.
158 * @param[in] parent The new parent node.
160 void ConnectNode(Node* parent, Node* node);
163 * Disconnect a Node from the scene-graph.
164 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
165 * @pre The node has a parent.
166 * @param[in] node The node to disconnect.
168 void DisconnectNode(Node* node);
171 * Destroy a Node owned by UpdateManager.
172 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
173 * In the following update, the previously queued Nodes may be deleted.
174 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
175 * @param[in] node The node to destroy.
177 void DestroyNode(Node* node);
180 * Add a newly created object.
181 * @param[in] object The object to add.
182 * @post The object is owned by UpdateManager.
184 void AddObject(OwnerPointer<PropertyOwner>& object);
188 * @param[in] object The object to remove.
190 void RemoveObject(PropertyOwner* object);
193 * Add a newly created render task list.
194 * @param[in] taskList The render task list to add.
195 * @post The render task list is owned by UpdateManager.
197 void AddRenderTaskList(OwnerPointer<RenderTaskList>& taskList);
200 * Remove a render task list.
201 * @param[in] taskList The render task list to remove.
203 void RemoveRenderTaskList(RenderTaskList* taskList);
206 * Add a newly created scene.
207 * @param[in] scene The scene to add.
208 * @post The scene is owned by UpdateManager.
210 void AddScene(OwnerPointer<Scene>& scene);
214 * @param[in] scene The scene to remove.
216 void RemoveScene(Scene* scene);
221 * Add a newly created animation.
222 * @param[in] animation The animation to add.
223 * @post The animation is owned by UpdateManager.
225 void AddAnimation(OwnerPointer<SceneGraph::Animation>& animation);
229 * @param[in] animation The animation to stop.
231 void StopAnimation(Animation* animation);
234 * Remove an animation.
235 * @param[in] animation The animation to remove.
237 void RemoveAnimation(Animation* animation);
240 * Query whether any animations are currently running.
241 * @return True if any animations are running.
243 bool IsAnimationRunning() const;
246 * Add a property resetter. UpdateManager takes ownership of the object.
247 * It will be killed by UpdateManager when the associated animator or
248 * constraint has finished; or the property owner of the property is destroyed.
250 void AddPropertyResetter(OwnerPointer<PropertyResetterBase>& propertyResetter);
253 * Add a node resetter. UpdateManager takes ownership of the object.
254 * It will be killed by UpdateManager when the node is disconnected from the scene graph;
255 * or when the node is destroyed.
257 void AddNodeResetter(const Node& node);
259 // Property Notification
262 * Add a newly created property notification
263 * @param[in] propertyNotification The notification to add
264 * @post The propertyNotification is owned by UpdateManager.
266 void AddPropertyNotification(OwnerPointer<PropertyNotification>& propertyNotification);
269 * Remove a property notification
270 * @param[in] propertyNotification The notification to remove
272 void RemovePropertyNotification(PropertyNotification* propertyNotification);
275 * Set Notify state for PropertyNotification
276 * @param[in] propertyNotification The notification to remove
277 * @param[in] notifyMode The notification mode.
279 void PropertyNotificationSetNotify(PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode);
284 * Add a newly created shader.
285 * @param[in] shader The shader to add.
286 * @post The shader is owned by the UpdateManager.
288 void AddShader(OwnerPointer<Shader>& shader);
292 * @pre The shader has been added to the UpdateManager.
293 * @param[in] shader The shader to remove.
294 * @post The shader is destroyed.
296 void RemoveShader(Shader* shader);
299 * Set the shader data for a Shader object
300 * @param[in] shader The shader to modify
301 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
303 void SetShaderData(Shader* shader, Internal::ShaderDataPtr shaderData);
306 * @brief Accept compiled shaders passed back on render thread for saving.
307 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
309 void SaveBinary(Internal::ShaderDataPtr shaderData) override;
312 * @brief Set the destination for compiled shader binaries to be passed on to.
313 * The dispatcher passed in will be called from the update thread.
314 * @param[in] upstream A sink for ShaderDatas to be passed into.
316 void SetShaderSaver(ShaderSaver& upstream);
321 * Add a new renderer to scene
322 * @param renderer to add
324 void AddRenderer(const RendererKey& renderer);
327 * Remove a renderer from scene
328 * @param renderer to remove
330 void RemoveRenderer(const RendererKey& renderer);
333 * Attach a renderer to node
334 * @param renderer to attach
336 void AttachRenderer(Node* node, Renderer* renderer);
341 * Set the pan gesture processor.
342 * Pan Gesture processor lives for the lifetime of UpdateManager
343 * @param[in] gesture The gesture processor.
344 * @post The gestureProcessor is owned by the UpdateManager.
346 void SetPanGestureProcessor(PanGesture* gestureProcessor);
351 * Add a newly created TextureSet.
352 * @param[in] textureSet The texture set to add.
353 * @post The TextureSet is owned by the UpdateManager.
355 void AddTextureSet(OwnerPointer<TextureSet>& textureSet);
358 * Remove a TextureSet.
359 * @pre The TextureSet has been added to the UpdateManager.
360 * @param[in] textureSet The TextureSet to remove.
361 * @post The TextureSet is destroyed.
363 void RemoveTextureSet(TextureSet* textureSet);
368 * Get the scene graph side list of RenderTasks.
369 * @param[in] systemLevel True if using the system-level overlay.
370 * @return The list of render tasks
372 RenderTaskList* GetRenderTaskList(bool systemLevel);
374 // Message queue handling
377 * Reserve space for another message in the queue; this must then be initialized by the caller.
378 * The message will be read from the update-thread after the next FlushMessages is called.
379 * @post Calling this method may invalidate any previously returned slots.
380 * @param[in] size The message size with respect to the size of type "char".
381 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
382 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
383 * @return A pointer to the first char allocated for the message.
385 uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene = true);
388 * @return the current event-buffer index.
390 BufferIndex GetEventBufferIndex() const
392 // inlined as its called often from event thread
393 return mSceneGraphBuffers.GetEventBufferIndex();
397 * Called by the event-thread to signal that FlushQueue will be called
398 * e.g. when it has finished event processing.
400 void EventProcessingStarted();
403 * Flush the set of messages, which were previously stored with QueueMessage().
404 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
406 * @return True if there are messages to process.
411 * Add a new sampler to RenderManager
412 * @param[in] sampler The sampler to add
413 * @post Sends a message to RenderManager to add the sampler.
414 * The sampler will be owned by RenderManager
416 void AddSampler(OwnerPointer<Render::Sampler>& sampler);
419 * Removes an existing sampler from RenderManager
420 * @param[in] sampler The sampler to remove
421 * @post The sampler will be destroyed in the render thread
423 void RemoveSampler(Render::Sampler* sampler);
426 * Sets the filter modes for an existing sampler
427 * @param[in] sampler The sampler
428 * @param[in] minFilterMode The filter to use under minification
429 * @param[in] magFilterMode The filter to use under magnification
431 void SetFilterMode(Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode);
434 * Sets the wrap mode for an existing sampler
435 * @param[in] sampler The sampler
436 * @param[in] rWrapMode Wrapping mode in z direction
437 * @param[in] sWrapMode Wrapping mode in x direction
438 * @param[in] tWrapMode Wrapping mode in y direction
440 void SetWrapMode(Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode);
443 * Add a new property buffer to RenderManager
444 * @param[in] propertryBuffer The property buffer to add
445 * @post Sends a message to RenderManager to add the property buffer.
446 * The property buffer will be owned by RenderManager
448 void AddVertexBuffer(OwnerPointer<Render::VertexBuffer>& propertryBuffer);
451 * Removes an existing VertexBuffer from RenderManager
452 * @param[in] propertryBuffer The property buffer to remove
453 * @post The property buffer will be destroyed in the render thread
455 void RemoveVertexBuffer(Render::VertexBuffer* propertryBuffer);
458 * Sets the format of an existing property buffer
459 * @param[in] vertexBuffer The property buffer.
460 * @param[in] format The new format of the buffer
461 * @post Sends a message to RenderManager to set the new format to the property buffer.
463 void SetVertexBufferFormat(Render::VertexBuffer* vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format);
466 * Sets the data of an existing property buffer
467 * @param[in] vertexBuffer The property buffer.
468 * @param[in] data The new data of the buffer
469 * @param[in] size The new size of the buffer
470 * @post Sends a message to RenderManager to set the new data to the property buffer.
472 void SetVertexBufferData(Render::VertexBuffer* vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size);
475 * Adds a geometry to the RenderManager
476 * @param[in] geometry The geometry to add
477 * @post Sends a message to RenderManager to add the Geometry
478 * The geometry will be owned by RenderManager
480 void AddGeometry(OwnerPointer<Render::Geometry>& geometry);
483 * Removes an existing Geometry from RenderManager
484 * @param[in] geometry The geometry to remove
485 * @post The geometry will be destroyed in the render thread
487 void RemoveGeometry(Render::Geometry* geometry);
490 * Sets the geometry type of an existing Geometry
491 * @param[in] geometry The geometry
492 * @param[in] geometryType The type of the geometry
494 void SetGeometryType(Render::Geometry* geometry, uint32_t geometryType);
497 * Sets the index buffer to be used by a geometry
498 * @param[in] geometry The geometry
499 * @param[in] indices A vector containing the indices for the geometry
501 void SetIndexBuffer(Render::Geometry* geometry, Render::Geometry::Uint16ContainerType& indices);
504 * Sets the index buffer to be used by a geometry
505 * @param[in] geometry The geometry
506 * @param[in] indices A vector containing the indices for the geometry
508 void SetIndexBuffer(Render::Geometry* geometry, Render::Geometry::Uint32ContainerType& indices);
511 * Adds a vertex buffer to a geometry
512 * @param[in] geometry The geometry
513 * @param[in] vertexBuffer The property buffer
515 void AttachVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
518 * Removes a vertex buffer from a geometry
519 * @param[in] geometry The geometry
520 * @param[in] vertexBuffer The property buffer
522 void RemoveVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
525 * Adds a texture to the render manager
526 * @param[in] texture The texture to add
527 * The texture will be owned by RenderManager
529 void AddTexture(const Render::TextureKey& texture);
532 * Removes a texture from the render manager
533 * @param[in] texture The texture to remove
534 * @post The texture will be destroyed in the render thread
536 void RemoveTexture(const Render::TextureKey& texture);
539 * Uploads data to a texture owned by the RenderManager
540 * @param[in] texture The texture
541 * @param[in] pixelData The pixel data object
542 * @param[in] params The parameters for the upload
544 void UploadTexture(const Render::TextureKey& texture, PixelDataPtr pixelData, const Texture::UploadParams& params);
547 * Generates mipmaps for a texture owned by the RenderManager
548 * @param[in] texture The texture
550 void GenerateMipmaps(const Render::TextureKey& texture);
553 * Adds a framebuffer to the render manager
554 * @param[in] frameBuffer The framebuffer to add
555 * The framebuffer will be owned by RenderManager
557 void AddFrameBuffer(OwnerPointer<Render::FrameBuffer>& frameBuffer);
560 * Removes a FrameBuffer from the render manager
561 * @param[in] frameBuffer The FrameBuffer to remove
562 * @post The FrameBuffer will be destroyed in the render thread
564 void RemoveFrameBuffer(Render::FrameBuffer* frameBuffer);
567 * Attach a texture as color output to an existing FrameBuffer
568 * @param[in] frameBuffer The FrameBuffer
569 * @param[in] texture The texture that will be used as output when rendering
570 * @param[in] mipmapLevel The mipmap of the texture to be attached
571 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
573 void AttachColorTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face);
576 * Attach a texture as depth output to an existing FrameBuffer
577 * @param[in] frameBuffer The FrameBuffer
578 * @param[in] texture The texture that will be used as output when rendering
579 * @param[in] mipmapLevel The mipmap of the texture to be attached
581 void AttachDepthTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
584 * Attach a texture as depth/stencil output to an existing FrameBuffer
585 * @param[in] frameBuffer The FrameBuffer
586 * @param[in] texture The texture that will be used as output when rendering
587 * @param[in] mipmapLevel The mipmap of the texture to be attached
589 void AttachDepthStencilTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
592 * Set a multisampling level value as texture output to the existing FrameBuffer
593 * @param[in] frameBuffer The FrameBuffer
594 * @param[in] multiSamplingLevel The level of multisampling
596 void SetMultiSamplingLevelToFrameBuffer(Render::FrameBuffer* frameBuffer, uint8_t multiSamplingLevel);
599 * This is called when the surface of the scene has been replaced.
600 * @param[in] scene The scene.
602 void SurfaceReplaced(Scene* scene);
606 * Performs an Update traversal on the scene-graph.
607 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
608 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
609 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
610 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
611 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
612 * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
613 * @return True if further updates are required e.g. during animations.
615 uint32_t Update(float elapsedSeconds,
616 uint32_t lastVSyncTimeMilliseconds,
617 uint32_t nextVSyncTimeMilliseconds,
618 bool renderToFboEnabled,
619 bool isRenderingToFbo,
623 * This is called after rendering all the scenes in the next frame.
628 * @copydoc Dali::Stage::KeepRendering()
630 void KeepRendering(float durationSeconds);
633 * @copydoc Dali::DevelStage::SetRenderingBehavior()
635 void SetRenderingBehavior(DevelStage::Rendering renderingBehavior);
638 * Request to render the current frame
639 * @note This is a temporary workaround (to be removed in the future) to request the rendering of
640 * the current frame if the color or visibility of any actor is updated. It MUST NOT be used
641 * for any other purposes.
643 void RequestRendering();
646 * Sets the depths of all layers.
647 * @param layers The layers in depth order.
648 * @param[in] rootLayer The root layer of the sorted layers.
650 void SetLayerDepths(const std::vector<Layer*>& layers, const Layer* rootLayer);
653 * Set the depth indices of all nodes (in LayerUI's)
654 * @param[in] nodeDepths A vector of nodes and associated depth indices
656 void SetDepthIndices(OwnerPointer<NodeDepths>& nodeDepths);
659 * Adds an implementation of the FrameCallbackInterface.
660 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
661 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
663 void AddFrameCallback(OwnerPointer<FrameCallback>& frameCallback, const Node* rootNode);
666 * Removes the specified implementation of FrameCallbackInterface.
667 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
669 void RemoveFrameCallback(FrameCallbackInterface* frameCallback);
672 * Get the update message queue capacity (mutex locked)
674 std::size_t GetUpdateMessageQueueCapacity() const;
677 * Get the render message queue capacity
679 std::size_t GetRenderMessageQueueCapacity() const;
682 * Get the render instruction capacity
684 std::size_t GetRenderInstructionCapacity() const;
688 UpdateManager(const UpdateManager&);
691 UpdateManager& operator=(const UpdateManager& rhs);
694 * Add a camera on scene
695 * @param[in] camera The camera to add
697 void AddCamera(Camera* camera);
700 * Remove a camera from scene
701 * @param[in] camera to remove
703 void RemoveCamera(Camera* camera);
706 * Helper to check whether the update-thread should keep going.
707 * @param[in] elapsedSeconds The time in seconds since the previous update.
708 * @return True if the update-thread should keep going.
710 uint32_t KeepUpdatingCheck(float elapsedSeconds) const;
713 * Helper to reset all Node properties
714 * @param[in] bufferIndex to use
716 void ResetProperties(BufferIndex bufferIndex);
719 * Perform gesture updates.
720 * @param[in] bufferIndex to use
721 * @param[in] lastVSyncTime The last VSync time in milliseconds.
722 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
723 * @return true, if any properties were updated.
725 bool ProcessGestures(BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds);
728 * Perform animation updates
729 * @param[in] bufferIndex to use
730 * @param[in] elapsedSeconds time since last frame
731 * @return true if at least one animations is currently active or false otherwise
733 bool Animate(BufferIndex bufferIndex, float elapsedSeconds);
736 * Applies constraints to CustomObjects
737 * @param[in] bufferIndex to use
739 void ConstrainCustomObjects(BufferIndex bufferIndex);
742 * Applies constraints to RenderTasks
743 * @param[in] bufferIndex to use
745 void ConstrainRenderTasks(BufferIndex bufferIndex);
748 * Applies constraints to Shaders
749 * @param[in] bufferIndex to use
751 void ConstrainShaders(BufferIndex bufferIndex);
754 * Perform property notification updates
755 * @param[in] bufferIndex to use
757 void ProcessPropertyNotifications(BufferIndex bufferIndex);
760 * Pass shader binaries queued here on to event thread.
762 void ForwardCompiledShadersToEventThread();
765 * Update node shaders, opacity, geometry etc.
766 * @param[in] bufferIndex to use
768 void UpdateNodes(BufferIndex bufferIndex);
771 * initialize layer renderables
772 * @param[in] bufferIndex
774 void UpdateLayers(BufferIndex bufferIndex);
778 * @param[in] bufferIndex to use
780 void UpdateRenderers(BufferIndex bufferIndex);
783 // needs to be direct member so that getter for event buffer can be inlined
784 SceneGraphBuffers mSceneGraphBuffers;
790 // Messages for UpdateManager
792 inline void InstallRootMessage(UpdateManager& manager, OwnerPointer<Layer>& root)
794 // Message has ownership of Layer while in transit from event -> update
795 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Layer>>;
797 // Reserve some memory inside the message queue
798 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
800 // Construct message in the message queue memory; note that delete should not be called on the return value
801 new(slot) LocalType(&manager, &UpdateManager::InstallRoot, root);
804 inline void UninstallRootMessage(UpdateManager& manager, const Layer* constRoot)
806 // Scene graph thread can destroy this object.
807 Layer* root = const_cast<Layer*>(constRoot);
809 using LocalType = MessageValue1<UpdateManager, Layer*>;
811 // Reserve some memory inside the message queue
812 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
814 // Construct message in the message queue memory; note that delete should not be called on the return value
815 new(slot) LocalType(&manager, &UpdateManager::UninstallRoot, root);
818 inline void AddNodeMessage(UpdateManager& manager, OwnerPointer<Node>& node)
820 // Message has ownership of Node while in transit from event -> update
821 using LocalType = MessageValue1<UpdateManager, OwnerPointer<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::AddNode, node);
830 inline void ConnectNodeMessage(UpdateManager& manager, const Node& constParent, const Node& constChild)
832 // Update thread can edit the object
833 Node& parent = const_cast<Node&>(constParent);
834 Node& child = const_cast<Node&>(constChild);
836 using LocalType = MessageValue2<UpdateManager, Node*, Node*>;
838 // Reserve some memory inside the message queue
839 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
841 // Construct message in the message queue memory; note that delete should not be called on the return value
842 new(slot) LocalType(&manager, &UpdateManager::ConnectNode, &parent, &child);
845 inline void DisconnectNodeMessage(UpdateManager& manager, const Node& constNode)
847 // Scene graph thread can modify this object.
848 Node& node = const_cast<Node&>(constNode);
850 using LocalType = MessageValue1<UpdateManager, Node*>;
852 // Reserve some memory inside the message queue
853 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
855 // Construct message in the message queue memory; note that delete should not be called on the return value
856 new(slot) LocalType(&manager, &UpdateManager::DisconnectNode, &node);
859 inline void DestroyNodeMessage(UpdateManager& manager, const Node& constNode)
861 // Scene graph thread can destroy this object.
862 Node& node = const_cast<Node&>(constNode);
864 using LocalType = MessageValue1<UpdateManager, Node*>;
866 // Reserve some memory inside the message queue
867 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
869 // Construct message in the message queue memory; note that delete should not be called on the return value
870 new(slot) LocalType(&manager, &UpdateManager::DestroyNode, &node);
873 inline void AddObjectMessage(UpdateManager& manager, OwnerPointer<PropertyOwner>& object)
875 // Message has ownership of object while in transit from event -> update
876 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyOwner>>;
878 // Reserve some memory inside the message queue
879 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
881 // Construct message in the message queue memory; note that delete should not be called on the return value
882 new(slot) LocalType(&manager, &UpdateManager::AddObject, object);
885 inline void RemoveObjectMessage(UpdateManager& manager, const PropertyOwner* object)
887 using LocalType = MessageValue1<UpdateManager, PropertyOwner*>;
889 // Reserve some memory inside the message queue
890 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
892 // Construct message in the message queue memory; note that delete should not be called on the return value
893 new(slot) LocalType(&manager, &UpdateManager::RemoveObject, const_cast<PropertyOwner*>(object));
896 inline void AddAnimationMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Animation>& animation)
898 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Animation>>;
900 // Reserve some memory inside the message queue
901 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
903 // Construct message in the message queue memory; note that delete should not be called on the return value
904 new(slot) LocalType(&manager, &UpdateManager::AddAnimation, animation);
907 inline void StopAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
909 // The scene-graph thread owns this object so it can safely edit it.
910 Animation& animation = const_cast<Animation&>(constAnimation);
912 using LocalType = MessageValue1<UpdateManager, Animation*>;
914 // Reserve some memory inside the message queue
915 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
917 // Construct message in the message queue memory; note that delete should not be called on the return value
918 new(slot) LocalType(&manager, &UpdateManager::StopAnimation, &animation);
921 inline void RemoveAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
923 // The scene-graph thread owns this object so it can safely edit it.
924 Animation& animation = const_cast<Animation&>(constAnimation);
926 using LocalType = MessageValue1<UpdateManager, Animation*>;
928 // Reserve some memory inside the message queue
929 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
931 // Construct message in the message queue memory; note that delete should not be called on the return value
932 new(slot) LocalType(&manager, &UpdateManager::RemoveAnimation, &animation);
935 inline void AddRenderTaskListMessage(UpdateManager& manager, OwnerPointer<SceneGraph::RenderTaskList>& taskList)
937 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::RenderTaskList>>;
939 // Reserve some memory inside the message queue
940 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
942 // Construct message in the message queue memory; note that delete should not be called on the return value
943 new(slot) LocalType(&manager, &UpdateManager::AddRenderTaskList, taskList);
946 inline void RemoveRenderTaskListMessage(UpdateManager& manager, const RenderTaskList& constTaskList)
948 // The scene-graph thread owns this object so it can safely edit it.
949 RenderTaskList& taskList = const_cast<RenderTaskList&>(constTaskList);
951 using LocalType = MessageValue1<UpdateManager, RenderTaskList*>;
953 // Reserve some memory inside the message queue
954 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
956 // Construct message in the message queue memory; note that delete should not be called on the return value
957 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderTaskList, &taskList);
960 inline void AddSceneMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Scene>& scene)
962 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Scene>>;
964 // Reserve some memory inside the message queue
965 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
967 // Construct message in the message queue memory; note that delete should not be called on the return value
968 new(slot) LocalType(&manager, &UpdateManager::AddScene, scene);
971 inline void RemoveSceneMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
973 // The scene-graph thread owns this object so it can safely edit it.
974 Scene& scene = const_cast<Scene&>(constScene);
976 using LocalType = MessageValue1<UpdateManager, Scene*>;
978 // Reserve some memory inside the message queue
979 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
981 // Construct message in the message queue memory; note that delete should not be called on the return value
982 new(slot) LocalType(&manager, &UpdateManager::RemoveScene, &scene);
985 inline void AddPropertyNotificationMessage(UpdateManager& manager, OwnerPointer<PropertyNotification>& propertyNotification)
987 // Message has ownership of PropertyNotification while in transit from event -> update
988 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyNotification>>;
990 // Reserve some memory inside the message queue
991 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
993 // Construct message in the message queue memory; note that delete should not be called on the return value
994 new(slot) LocalType(&manager, &UpdateManager::AddPropertyNotification, propertyNotification);
997 inline void RemovePropertyNotificationMessage(UpdateManager& manager, const PropertyNotification& constPropertyNotification)
999 // The scene-graph thread owns this object so it can safely edit it.
1000 PropertyNotification& propertyNotification = const_cast<PropertyNotification&>(constPropertyNotification);
1002 using LocalType = MessageValue1<UpdateManager, PropertyNotification*>;
1004 // Reserve some memory inside the message queue
1005 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1007 // Construct message in the message queue memory; note that delete should not be called on the return value
1008 new(slot) LocalType(&manager, &UpdateManager::RemovePropertyNotification, &propertyNotification);
1011 inline void PropertyNotificationSetNotifyModeMessage(UpdateManager& manager,
1012 const PropertyNotification* constPropertyNotification,
1013 PropertyNotification::NotifyMode notifyMode)
1015 // The scene-graph thread owns this object so it can safely edit it.
1016 PropertyNotification* propertyNotification = const_cast<PropertyNotification*>(constPropertyNotification);
1018 using LocalType = MessageValue2<UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode>;
1020 // Reserve some memory inside the message queue
1021 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1023 // Construct message in the message queue memory; note that delete should not be called on the return value
1024 new(slot) LocalType(&manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode);
1027 // The render thread can safely change the Shader
1028 inline void AddShaderMessage(UpdateManager& manager, OwnerPointer<Shader>& shader)
1030 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Shader>>;
1032 // Reserve some memory inside the message queue
1033 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1035 // Construct message in the message queue memory; note that delete should not be called on the return value
1036 new(slot) LocalType(&manager, &UpdateManager::AddShader, shader);
1039 // The render thread can safely change the Shader
1040 inline void RemoveShaderMessage(UpdateManager& manager, const Shader* shader)
1042 using LocalType = MessageValue1<UpdateManager, Shader*>;
1044 // Reserve some memory inside the message queue
1045 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1047 // Construct message in the message queue memory; note that delete should not be called on the return value
1048 new(slot) LocalType(&manager, &UpdateManager::RemoveShader, const_cast<Shader*>(shader));
1051 inline void SurfaceReplacedMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
1053 // The scene-graph thread owns this object so it can safely edit it.
1054 Scene& scene = const_cast<Scene&>(constScene);
1056 using LocalType = MessageValue1<UpdateManager, Scene*>;
1058 // Reserve some memory inside the message queue
1059 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1061 // Construct message in the message queue memory; note that delete should not be called on the return value
1062 new(slot) LocalType(&manager, &UpdateManager::SurfaceReplaced, &scene);
1065 inline void KeepRenderingMessage(UpdateManager& manager, float durationSeconds)
1067 using LocalType = MessageValue1<UpdateManager, float>;
1069 // Reserve some memory inside the message queue
1070 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1072 // Construct message in the message queue memory; note that delete should not be called on the return value
1073 new(slot) LocalType(&manager, &UpdateManager::KeepRendering, durationSeconds);
1076 inline void SetRenderingBehaviorMessage(UpdateManager& manager, DevelStage::Rendering renderingBehavior)
1078 using LocalType = MessageValue1<UpdateManager, DevelStage::Rendering>;
1080 // Reserve some memory inside the message queue
1081 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1083 // Construct message in the message queue memory; note that delete should not be called on the return value
1084 new(slot) LocalType(&manager, &UpdateManager::SetRenderingBehavior, renderingBehavior);
1087 inline void RequestRenderingMessage(UpdateManager& manager)
1089 using LocalType = Message<UpdateManager>;
1091 // Reserve some memory inside the message queue
1092 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1094 // Construct message in the message queue memory; note that delete should not be called on the return value
1095 new(slot) LocalType(&manager, &UpdateManager::RequestRendering);
1099 * Create a message for setting the depth of a layer
1100 * @param[in] manager The update manager
1101 * @param[in] layers list of layers
1102 * @param[in] rootLayer The rool layer
1104 inline void SetLayerDepthsMessage(UpdateManager& manager, const std::vector<Layer*>& layers, const Layer* rootLayer)
1106 using LocalType = MessageValue2<UpdateManager, std::vector<Layer*>, const Layer*>;
1108 // Reserve some memory inside the message queue
1109 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::SetLayerDepths, layers, rootLayer);
1115 inline void AddRendererMessage(UpdateManager& manager, const RendererKey& rendererKey)
1117 using LocalType = MessageValue1<UpdateManager, RendererKey>;
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::AddRenderer, rendererKey);
1125 inline void RemoveRendererMessage(UpdateManager& manager, const RendererKey& rendererKey)
1127 using LocalType = MessageValue1<UpdateManager, RendererKey>;
1129 // Reserve some memory inside the message queue
1130 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1131 // Construct message in the message queue memory; note that delete should not be called on the return value
1132 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderer, rendererKey);
1135 inline void AttachRendererMessage(UpdateManager& manager, const Node& node, const Renderer& renderer)
1137 using LocalType = MessageValue2<UpdateManager, Node*, Renderer*>;
1139 // Reserve some memory inside the message queue
1140 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1141 // Construct message in the message queue memory; note that delete should not be called on the return value
1142 new(slot) LocalType(&manager, &UpdateManager::AttachRenderer, const_cast<Node*>(&node), const_cast<Renderer*>(&renderer));
1145 // The render thread can safely change the Shader
1146 inline void AddTextureSetMessage(UpdateManager& manager, OwnerPointer<TextureSet>& textureSet)
1148 using LocalType = MessageValue1<UpdateManager, OwnerPointer<TextureSet>>;
1150 // Reserve some memory inside the message queue
1151 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1153 // Construct message in the message queue memory; note that delete should not be called on the return value
1154 new(slot) LocalType(&manager, &UpdateManager::AddTextureSet, textureSet);
1157 // The render thread can safely change the Shader
1158 inline void RemoveTextureSetMessage(UpdateManager& manager, TextureSet& textureSet)
1160 using LocalType = MessageValue1<UpdateManager, TextureSet*>;
1162 // Reserve some memory inside the message queue
1163 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1165 // Construct message in the message queue memory; note that delete should not be called on the return value
1166 new(slot) LocalType(&manager, &UpdateManager::RemoveTextureSet, &textureSet);
1169 inline void AddSamplerMessage(UpdateManager& manager, OwnerPointer<Render::Sampler>& sampler)
1171 // Message has ownership of Sampler while in transit from event -> update
1172 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Sampler>>;
1174 // Reserve some memory inside the message queue
1175 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1177 // Construct message in the message queue memory; note that delete should not be called on the return value
1178 new(slot) LocalType(&manager, &UpdateManager::AddSampler, sampler);
1181 inline void RemoveSamplerMessage(UpdateManager& manager, Render::Sampler& sampler)
1183 using LocalType = MessageValue1<UpdateManager, Render::Sampler*>;
1185 // Reserve some memory inside the message queue
1186 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1188 // Construct message in the message queue memory; note that delete should not be called on the return value
1189 new(slot) LocalType(&manager, &UpdateManager::RemoveSampler, &sampler);
1192 inline void SetFilterModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode)
1194 using LocalType = MessageValue3<UpdateManager, Render::Sampler*, uint32_t, uint32_t>;
1196 // Reserve some memory inside the message queue
1197 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1199 // Construct message in the message queue memory; note that delete should not be called on the return value
1200 new(slot) LocalType(&manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode);
1203 inline void SetWrapModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode)
1205 using LocalType = MessageValue4<UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t>;
1207 // Reserve some memory inside the message queue
1208 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1210 // Construct message in the message queue memory; note that delete should not be called on the return value
1211 new(slot) LocalType(&manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode);
1214 inline void AddVertexBuffer(UpdateManager& manager, OwnerPointer<Render::VertexBuffer>& vertexBuffer)
1216 // Message has ownership of vertexBuffer while in transit from event -> update
1217 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::VertexBuffer>>;
1219 // Reserve some memory inside the message queue
1220 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1222 // Construct message in the message queue memory; note that delete should not be called on the return value
1223 new(slot) LocalType(&manager, &UpdateManager::AddVertexBuffer, vertexBuffer);
1226 inline void RemoveVertexBuffer(UpdateManager& manager, Render::VertexBuffer& vertexBuffer)
1228 using LocalType = MessageValue1<UpdateManager, Render::VertexBuffer*>;
1230 // Reserve some memory inside the message queue
1231 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1233 // Construct message in the message queue memory; note that delete should not be called on the return value
1234 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &vertexBuffer);
1237 inline void SetVertexBufferFormat(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format)
1239 // Message has ownership of VertexBuffer::Format while in transit from event -> update
1240 using LocalType = MessageValue2<UpdateManager, Render::VertexBuffer*, OwnerPointer<Render::VertexBuffer::Format>>;
1242 // Reserve some memory inside the message queue
1243 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1245 // Construct message in the message queue memory; note that delete should not be called on the return value
1246 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferFormat, &vertexBuffer, format);
1249 inline void SetVertexBufferData(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size)
1251 // Message has ownership of VertexBuffer data while in transit from event -> update
1252 using LocalType = MessageValue3<UpdateManager, Render::VertexBuffer*, OwnerPointer<Vector<uint8_t>>, uint32_t>;
1254 // Reserve some memory inside the message queue
1255 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1257 // Construct message in the message queue memory; note that delete should not be called on the return value
1258 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferData, &vertexBuffer, data, size);
1261 inline void AddGeometry(UpdateManager& manager, OwnerPointer<Render::Geometry>& geometry)
1263 // Message has ownership of Geometry while in transit from event -> update
1264 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Geometry>>;
1266 // Reserve some memory inside the message queue
1267 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1269 // Construct message in the message queue memory; note that delete should not be called on the return value
1270 new(slot) LocalType(&manager, &UpdateManager::AddGeometry, geometry);
1273 inline void RemoveGeometry(UpdateManager& manager, Render::Geometry& geometry)
1275 using LocalType = MessageValue1<UpdateManager, Render::Geometry*>;
1277 // Reserve some memory inside the message queue
1278 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1280 // Construct message in the message queue memory; note that delete should not be called on the return value
1281 new(slot) LocalType(&manager, &UpdateManager::RemoveGeometry, &geometry);
1284 inline void AttachVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1286 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1288 // Reserve some memory inside the message queue
1289 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1291 // Construct message in the message queue memory; note that delete should not be called on the return value
1292 new(slot) LocalType(&manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1295 inline void RemoveVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1297 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1299 // Reserve some memory inside the message queue
1300 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1302 // Construct message in the message queue memory; note that delete should not be called on the return value
1303 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1306 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1307 template<typename T, typename IndexContainerType>
1308 class IndexBufferMessage : public MessageBase
1312 * Constructor which does a Vector::Swap()
1314 IndexBufferMessage(T* manager, Render::Geometry* geometry, IndexContainerType& indices)
1317 mRenderGeometry(geometry)
1319 mIndices.Swap(indices);
1323 * Virtual destructor
1325 ~IndexBufferMessage() override = default;
1328 * @copydoc MessageBase::Process
1330 void Process(BufferIndex /*bufferIndex*/) override
1332 DALI_ASSERT_DEBUG(mManager && "Message does not have an object");
1333 mManager->SetIndexBuffer(mRenderGeometry, mIndices);
1338 Render::Geometry* mRenderGeometry;
1339 IndexContainerType mIndices;
1342 inline void SetIndexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, Render::Geometry::Uint16ContainerType& indices)
1344 using LocalType = IndexBufferMessage<UpdateManager, Render::Geometry::Uint16ContainerType>;
1346 // Reserve some memory inside the message queue
1347 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1349 // Construct message in the message queue memory; note that delete should not be called on the return value
1350 new(slot) LocalType(&manager, &geometry, indices);
1353 inline void SetIndexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, Render::Geometry::Uint32ContainerType& indices)
1355 using LocalType = IndexBufferMessage<UpdateManager, Render::Geometry::Uint32ContainerType>;
1357 // Reserve some memory inside the message queue
1358 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1360 // Construct message in the message queue memory; note that delete should not be called on the return value
1361 new(slot) LocalType(&manager, &geometry, indices);
1364 inline void SetGeometryTypeMessage(UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType)
1366 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, uint32_t>;
1368 // Reserve some memory inside the message queue
1369 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1371 // Construct message in the message queue memory; note that delete should not be called on the return value
1372 new(slot) LocalType(&manager, &UpdateManager::SetGeometryType, &geometry, geometryType);
1375 inline void AddTextureMessage(UpdateManager& manager, const Render::TextureKey& texture)
1377 using LocalType = MessageValue1<UpdateManager, Render::TextureKey>;
1379 // Reserve some memory inside the message queue
1380 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1382 // Construct message in the message queue memory; note that delete should not be called on the return value
1383 new(slot) LocalType(&manager, &UpdateManager::AddTexture, texture);
1386 inline void RemoveTextureMessage(UpdateManager& manager, const Render::TextureKey& texture)
1388 using LocalType = MessageValue1<UpdateManager, Render::TextureKey>;
1390 // Reserve some memory inside the message queue
1391 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1393 // Construct message in the message queue memory; note that delete should not be called on the return value
1394 new(slot) LocalType(&manager, &UpdateManager::RemoveTexture, texture);
1397 inline void UploadTextureMessage(UpdateManager& manager, Render::TextureKey texture, PixelDataPtr pixelData, const Texture::UploadParams& params)
1399 using LocalType = MessageValue3<UpdateManager, Render::TextureKey, PixelDataPtr, Texture::UploadParams>;
1401 // Reserve some memory inside the message queue
1402 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1404 // Construct message in the message queue memory; note that delete should not be called on the return value
1405 new(slot) LocalType(&manager, &UpdateManager::UploadTexture, texture, pixelData, params);
1408 inline void GenerateMipmapsMessage(UpdateManager& manager, Render::TextureKey texture)
1410 using LocalType = MessageValue1<UpdateManager, Render::TextureKey>;
1412 // Reserve some memory inside the message queue
1413 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1415 // Construct message in the message queue memory; note that delete should not be called on the return value
1416 new(slot) LocalType(&manager, &UpdateManager::GenerateMipmaps, texture);
1419 inline void AddFrameBuffer(UpdateManager& manager, OwnerPointer<Render::FrameBuffer>& frameBuffer)
1421 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::FrameBuffer>>;
1423 // Reserve some memory inside the message queue
1424 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1426 // Construct message in the message queue memory; note that delete should not be called on the return value
1427 new(slot) LocalType(&manager, &UpdateManager::AddFrameBuffer, frameBuffer);
1430 inline void RemoveFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer)
1432 using LocalType = MessageValue1<UpdateManager, Render::FrameBuffer*>;
1434 // Reserve some memory inside the message queue
1435 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1437 // Construct message in the message queue memory; note that delete should not be called on the return value
1438 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer);
1441 inline void AttachColorTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer)
1443 using LocalType = MessageValue4<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t>;
1445 // Reserve some memory inside the message queue
1446 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1448 // Construct message in the message queue memory; note that delete should not be called on the return value
1449 new(slot) LocalType(&manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer);
1452 inline void AttachDepthTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1454 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1456 // Reserve some memory inside the message queue
1457 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1459 // Construct message in the message queue memory; note that delete should not be called on the return value
1460 new(slot) LocalType(&manager, &UpdateManager::AttachDepthTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1463 inline void AttachDepthStencilTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1465 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1467 // Reserve some memory inside the message queue
1468 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1470 // Construct message in the message queue memory; note that delete should not be called on the return value
1471 new(slot) LocalType(&manager, &UpdateManager::AttachDepthStencilTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1474 inline void SetMultiSamplingLevelToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, uint8_t multiSamplingLevel)
1476 using LocalType = MessageValue2<UpdateManager, Render::FrameBuffer*, uint8_t>;
1478 // Reserve some memory inside the message queue
1479 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1481 // Construct message in the message queue memory; note that delete should not be called on the return value
1482 new(slot) LocalType(&manager, &UpdateManager::SetMultiSamplingLevelToFrameBuffer, &frameBuffer, multiSamplingLevel);
1485 inline void SetDepthIndicesMessage(UpdateManager& manager, OwnerPointer<NodeDepths>& nodeDepths)
1487 using LocalType = MessageValue1<UpdateManager, OwnerPointer<NodeDepths>>;
1489 // Reserve some memory inside the message queue
1490 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1492 // Construct message in the message queue memory; note that delete should not be called on the return value
1493 new(slot) LocalType(&manager, &UpdateManager::SetDepthIndices, nodeDepths);
1496 inline void AddResetterMessage(UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter)
1498 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyResetterBase>>;
1500 // Reserve some memory inside the message queue
1501 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1503 // Construct message in the message queue memory; note that delete should not be called on the return value
1504 new(slot) LocalType(&manager, &UpdateManager::AddPropertyResetter, resetter);
1507 inline void AddFrameCallbackMessage(UpdateManager& manager, OwnerPointer<FrameCallback>& frameCallback, const Node& rootNode)
1509 using LocalType = MessageValue2<UpdateManager, OwnerPointer<FrameCallback>, const Node*>;
1511 // Reserve some memory inside the message queue
1512 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1514 // Construct message in the message queue memory; note that delete should not be called on the return value
1515 new(slot) LocalType(&manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode);
1518 inline void RemoveFrameCallbackMessage(UpdateManager& manager, FrameCallbackInterface& frameCallback)
1520 using LocalType = MessageValue1<UpdateManager, FrameCallbackInterface*>;
1522 // Reserve some memory inside the message queue
1523 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1525 // Construct message in the message queue memory; note that delete should not be called on the return value
1526 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameCallback, &frameCallback);
1529 } // namespace SceneGraph
1531 } // namespace Internal
1535 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H