1 #ifndef DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/common/dali-common.h>
23 #include <dali/public-api/common/vector-wrapper.h>
25 #include <dali/devel-api/common/stage-devel.h>
27 #include <dali/internal/common/message.h>
28 #include <dali/internal/common/shader-saver.h>
29 #include <dali/internal/common/type-abstraction-enums.h>
30 #include <dali/internal/event/common/event-thread-services.h>
31 #include <dali/internal/event/rendering/texture-impl.h>
32 #include <dali/internal/render/renderers/render-texture.h> // For OwnerPointer<Render::Texture>
33 #include <dali/internal/render/renderers/render-vertex-buffer.h>
34 #include <dali/internal/render/shaders/scene-graph-shader.h> // for OwnerPointer< Shader >
35 #include <dali/internal/update/animation/scene-graph-animation.h>
36 #include <dali/internal/update/common/property-resetter.h>
37 #include <dali/internal/update/common/scene-graph-buffers.h>
38 #include <dali/internal/update/common/scene-graph-property-notification.h>
39 #include <dali/internal/update/common/scene-graph-scene.h>
40 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
41 #include <dali/internal/update/manager/scene-graph-frame-callback.h> // for OwnerPointer< FrameCallback >
42 #include <dali/internal/update/nodes/node.h>
43 #include <dali/internal/update/nodes/scene-graph-layer.h>
44 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
45 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
46 #include <dali/internal/update/rendering/scene-graph-renderer.h> // for OwnerPointer< Renderer >
47 #include <dali/internal/update/rendering/scene-graph-texture-set.h> // for OwnerPointer< TextureSet >
51 class FrameCallbackInterface;
55 class GlSyncAbstraction;
56 class RenderController;
58 } // namespace Integration
62 class PropertyNotifier;
63 class NotificationManager;
64 class CompleteNotificationInterface;
72 // value types used by messages
74 struct ParameterType<PropertyNotification::NotifyMode>
75 : public BasicType<PropertyNotification::NotifyMode>
85 class RenderTaskProcessor;
90 * UpdateManager maintains a scene graph i.e. a tree of nodes as well as
91 * other scene graph property owning objects.
92 * It controls the Update traversal, in which nodes are repositioned/animated,
93 * and organizes the the culling and rendering of the scene.
94 * It also maintains the lifecycle of nodes and other property owners that are
95 * disconnected from the scene graph.
97 class UpdateManager : public ShaderSaver
101 * Construct a new UpdateManager.
102 * @param[in] notificationManager This should be notified when animations have finished.
103 * @param[in] animationPlaylist The CompleteNotificationInterface that handles the animations
104 * @param[in] propertyNotifier The PropertyNotifier
105 * @param[in] discardQueue Nodes are added here when disconnected from the scene-graph.
106 * @param[in] controller After messages are flushed, we request a render from the RenderController.
107 * @param[in] renderManager This is responsible for rendering the results of each "update".
108 * @param[in] renderQueue Used to queue messages for the next render.
109 * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
111 UpdateManager(NotificationManager& notificationManager,
112 CompleteNotificationInterface& animationPlaylist,
113 PropertyNotifier& propertyNotifier,
114 DiscardQueue& discardQueue,
115 Integration::RenderController& controller,
116 RenderManager& renderManager,
117 RenderQueue& renderQueue,
118 RenderTaskProcessor& renderTaskProcessor);
123 ~UpdateManager() override;
125 // Node connection methods
128 * Installs a new layer as the root node.
129 * @pre The layer is of derived Node type Layer.
130 * @pre The layer does not have a parent.
131 * @param[in] layer The new root node.
132 * @post The node is owned by UpdateManager.
134 void InstallRoot(OwnerPointer<Layer>& layer);
137 * Uninstalls the root node.
138 * @pre The layer is of derived Node type Layer.
139 * @pre The layer does not have a parent.
140 * @param[in] layer The root node.
141 * @post The node is owned by UpdateManager.
143 void UninstallRoot(Layer* layer);
146 * Add a Node; UpdateManager takes ownership.
147 * @pre The node does not have a parent.
148 * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
149 * @param[in] node The node to add.
151 void AddNode(OwnerPointer<Node>& node);
154 * Connect a Node to the scene-graph.
155 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
156 * @pre The node does not already have a parent.
157 * @param[in] parent The new parent node.
159 void ConnectNode(Node* parent, Node* node);
162 * Disconnect a Node from the scene-graph.
163 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
164 * @pre The node has a parent.
165 * @param[in] node The node to disconnect.
167 void DisconnectNode(Node* node);
170 * Destroy a Node owned by UpdateManager.
171 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
172 * In the following update, the previously queued Nodes may be deleted.
173 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
174 * @param[in] node The node to destroy.
176 void DestroyNode(Node* node);
179 * Add a camera on scene
180 * @param[in] camera The camera to add
182 void AddCamera(OwnerPointer<Camera>& camera);
185 * Remove a camera from scene
186 * @param[in] camera to remove
188 void RemoveCamera(Camera* camera);
191 * Add a newly created object.
192 * @param[in] object The object to add.
193 * @post The object is owned by UpdateManager.
195 void AddObject(OwnerPointer<PropertyOwner>& object);
199 * @param[in] object The object to remove.
201 void RemoveObject(PropertyOwner* object);
204 * Add a newly created render task list.
205 * @param[in] taskList The render task list to add.
206 * @post The render task list is owned by UpdateManager.
208 void AddRenderTaskList(OwnerPointer<RenderTaskList>& taskList);
211 * Remove a render task list.
212 * @param[in] taskList The render task list to remove.
214 void RemoveRenderTaskList(RenderTaskList* taskList);
217 * Add a newly created scene.
218 * @param[in] scene The scene to add.
219 * @post The scene is owned by UpdateManager.
221 void AddScene(OwnerPointer<Scene>& scene);
225 * @param[in] scene The scene to remove.
227 void RemoveScene(Scene* scene);
232 * Add a newly created animation.
233 * @param[in] animation The animation to add.
234 * @post The animation is owned by UpdateManager.
236 void AddAnimation(OwnerPointer<SceneGraph::Animation>& animation);
240 * @param[in] animation The animation to stop.
242 void StopAnimation(Animation* animation);
245 * Remove an animation.
246 * @param[in] animation The animation to remove.
248 void RemoveAnimation(Animation* animation);
251 * Query whether any animations are currently running.
252 * @return True if any animations are running.
254 bool IsAnimationRunning() const;
257 * Add a property resetter. UpdateManager takes ownership of the object.
258 * It will be killed by UpdateManager when the associated animator or
259 * constraint has finished; or the property owner of the property is destroyed.
261 void AddPropertyResetter(OwnerPointer<PropertyResetterBase>& propertyResetter);
263 // Property Notification
266 * Add a newly created property notification
267 * @param[in] propertyNotification The notification to add
268 * @post The propertyNotification is owned by UpdateManager.
270 void AddPropertyNotification(OwnerPointer<PropertyNotification>& propertyNotification);
273 * Remove a property notification
274 * @param[in] propertyNotification The notification to remove
276 void RemovePropertyNotification(PropertyNotification* propertyNotification);
279 * Set Notify state for PropertyNotification
280 * @param[in] propertyNotification The notification to remove
281 * @param[in] notifyMode The notification mode.
283 void PropertyNotificationSetNotify(PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode);
288 * Add a newly created shader.
289 * @param[in] shader The shader to add.
290 * @post The shader is owned by the UpdateManager.
292 void AddShader(OwnerPointer<Shader>& shader);
296 * @pre The shader has been added to the UpdateManager.
297 * @param[in] shader The shader to remove.
298 * @post The shader is destroyed.
300 void RemoveShader(Shader* shader);
303 * Set the shader data for a Shader object
304 * @param[in] shader The shader to modify
305 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
307 void SetShaderData(Shader* shader, Internal::ShaderDataPtr shaderData);
310 * @brief Accept compiled shaders passed back on render thread for saving.
311 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
313 void SaveBinary(Internal::ShaderDataPtr shaderData) override;
316 * @brief Set the destination for compiled shader binaries to be passed on to.
317 * The dispatcher passed in will be called from the update thread.
318 * @param[in] upstream A sink for ShaderDatas to be passed into.
320 void SetShaderSaver(ShaderSaver& upstream);
325 * Add a new renderer to scene
326 * @param renderer to add
328 void AddRenderer(OwnerPointer<Renderer>& renderer);
331 * Add a renderer from scene
332 * @param renderer to remove
334 void RemoveRenderer(Renderer* renderer);
339 * Set the pan gesture processor.
340 * Pan Gesture processor lives for the lifetime of UpdateManager
341 * @param[in] gesture The gesture processor.
342 * @post The gestureProcessor is owned by the UpdateManager.
344 void SetPanGestureProcessor(PanGesture* gestureProcessor);
349 * Add a newly created TextureSet.
350 * @param[in] textureSet The texture set to add.
351 * @post The TextureSet is owned by the UpdateManager.
353 void AddTextureSet(OwnerPointer<TextureSet>& textureSet);
356 * Remove a TextureSet.
357 * @pre The TextureSet has been added to the UpdateManager.
358 * @param[in] textureSet The TextureSet to remove.
359 * @post The TextureSet is destroyed.
361 void RemoveTextureSet(TextureSet* textureSet);
366 * Get the scene graph side list of RenderTasks.
367 * @param[in] systemLevel True if using the system-level overlay.
368 * @return The list of render tasks
370 RenderTaskList* GetRenderTaskList(bool systemLevel);
372 // Message queue handling
375 * Reserve space for another message in the queue; this must then be initialized by the caller.
376 * The message will be read from the update-thread after the next FlushMessages is called.
377 * @post Calling this method may invalidate any previously returned slots.
378 * @param[in] size The message size with respect to the size of type "char".
379 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
380 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
381 * @return A pointer to the first char allocated for the message.
383 uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene = true);
386 * @return the current event-buffer index.
388 BufferIndex GetEventBufferIndex() const
390 // inlined as its called often from event thread
391 return mSceneGraphBuffers.GetEventBufferIndex();
395 * Called by the event-thread to signal that FlushQueue will be called
396 * e.g. when it has finished event processing.
398 void EventProcessingStarted();
401 * Flush the set of messages, which were previously stored with QueueMessage().
402 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
404 * @return True if there are messages to process.
409 * Add a new sampler to RenderManager
410 * @param[in] sampler The sampler to add
411 * @post Sends a message to RenderManager to add the sampler.
412 * The sampler will be owned by RenderManager
414 void AddSampler(OwnerPointer<Render::Sampler>& sampler);
417 * Removes an existing sampler from RenderManager
418 * @param[in] sampler The sampler to remove
419 * @post The sampler will be destroyed in the render thread
421 void RemoveSampler(Render::Sampler* sampler);
424 * Sets the filter modes for an existing sampler
425 * @param[in] sampler The sampler
426 * @param[in] minFilterMode The filter to use under minification
427 * @param[in] magFilterMode The filter to use under magnification
429 void SetFilterMode(Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode);
432 * Sets the wrap mode for an existing sampler
433 * @param[in] sampler The sampler
434 * @param[in] rWrapMode Wrapping mode in z direction
435 * @param[in] sWrapMode Wrapping mode in x direction
436 * @param[in] tWrapMode Wrapping mode in y direction
438 void SetWrapMode(Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode);
441 * Add a new property buffer to RenderManager
442 * @param[in] propertryBuffer The property buffer to add
443 * @post Sends a message to RenderManager to add the property buffer.
444 * The property buffer will be owned by RenderManager
446 void AddVertexBuffer(OwnerPointer<Render::VertexBuffer>& propertryBuffer);
449 * Removes an existing VertexBuffer from RenderManager
450 * @param[in] propertryBuffer The property buffer to remove
451 * @post The property buffer will be destroyed in the render thread
453 void RemoveVertexBuffer(Render::VertexBuffer* propertryBuffer);
456 * Sets the format of an existing property buffer
457 * @param[in] vertexBuffer The property buffer.
458 * @param[in] format The new format of the buffer
459 * @post Sends a message to RenderManager to set the new format to the property buffer.
461 void SetVertexBufferFormat(Render::VertexBuffer* vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format);
464 * Sets the data of an existing property buffer
465 * @param[in] vertexBuffer The property buffer.
466 * @param[in] data The new data of the buffer
467 * @param[in] size The new size of the buffer
468 * @post Sends a message to RenderManager to set the new data to the property buffer.
470 void SetVertexBufferData(Render::VertexBuffer* vertexBuffer, OwnerPointer<Vector<uint8_t> >& data, uint32_t size);
473 * Adds a geometry to the RenderManager
474 * @param[in] geometry The geometry to add
475 * @post Sends a message to RenderManager to add the Geometry
476 * The geometry will be owned by RenderManager
478 void AddGeometry(OwnerPointer<Render::Geometry>& geometry);
481 * Removes an existing Geometry from RenderManager
482 * @param[in] geometry The geometry to remove
483 * @post The geometry will be destroyed in the render thread
485 void RemoveGeometry(Render::Geometry* geometry);
488 * Sets the geometry type of an existing Geometry
489 * @param[in] geometry The geometry
490 * @param[in] geometryType The type of the geometry
492 void SetGeometryType(Render::Geometry* geometry, uint32_t geometryType);
495 * Sets the index buffer to be used by a geometry
496 * @param[in] geometry The geometry
497 * @param[in] indices A vector containing the indices for the geometry
499 void SetIndexBuffer(Render::Geometry* geometry, Dali::Vector<uint16_t>& indices);
502 * Adds a vertex buffer to a geometry
503 * @param[in] geometry The geometry
504 * @param[in] vertexBuffer The property buffer
506 void AttachVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
509 * Removes a vertex buffer from a geometry
510 * @param[in] geometry The geometry
511 * @param[in] vertexBuffer The property buffer
513 void RemoveVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
516 * Adds a texture to the render manager
517 * @param[in] texture The texture to add
518 * The texture will be owned by RenderManager
520 void AddTexture(OwnerPointer<Render::Texture>& texture);
523 * Removes a texture from the render manager
524 * @param[in] texture The texture to remove
525 * @post The texture will be destroyed in the render thread
527 void RemoveTexture(Render::Texture* texture);
530 * Uploads data to a texture owned by the RenderManager
531 * @param[in] texture The texture
532 * @param[in] pixelData The pixel data object
533 * @param[in] params The parameters for the upload
535 void UploadTexture(Render::Texture* texture, PixelDataPtr pixelData, const Texture::UploadParams& params);
538 * Generates mipmaps for a texture owned by the RenderManager
539 * @param[in] texture The texture
541 void GenerateMipmaps(Render::Texture* texture);
544 * Adds a framebuffer to the render manager
545 * @param[in] frameBuffer The framebuffer to add
546 * The framebuffer will be owned by RenderManager
548 void AddFrameBuffer(OwnerPointer<Render::FrameBuffer>& frameBuffer);
551 * Removes a FrameBuffer from the render manager
552 * @param[in] frameBuffer The FrameBuffer to remove
553 * @post The FrameBuffer will be destroyed in the render thread
555 void RemoveFrameBuffer(Render::FrameBuffer* frameBuffer);
558 * Attach a texture as color output to an existing FrameBuffer
559 * @param[in] frameBuffer The FrameBuffer
560 * @param[in] texture The texture that will be used as output when rendering
561 * @param[in] mipmapLevel The mipmap of the texture to be attached
562 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
564 void AttachColorTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face);
567 * Attach a texture as depth 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
572 void AttachDepthTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
575 * Attach a texture as depth/stencil output to an existing FrameBuffer
576 * @param[in] frameBuffer The FrameBuffer
577 * @param[in] texture The texture that will be used as output when rendering
578 * @param[in] mipmapLevel The mipmap of the texture to be attached
580 void AttachDepthStencilTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
583 * This is called when the surface of the scene has been replaced.
584 * @param[in] scene The scene.
586 void SurfaceReplaced(Scene* scene);
590 * Performs an Update traversal on the scene-graph.
591 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
592 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
593 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
594 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
595 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
596 * @return True if further updates are required e.g. during animations.
598 uint32_t Update(float elapsedSeconds,
599 uint32_t lastVSyncTimeMilliseconds,
600 uint32_t nextVSyncTimeMilliseconds,
601 bool renderToFboEnabled,
602 bool isRenderingToFbo);
605 * @copydoc Dali::Stage::KeepRendering()
607 void KeepRendering(float durationSeconds);
610 * @copydoc Dali::DevelStage::SetRenderingBehavior()
612 void SetRenderingBehavior(DevelStage::Rendering renderingBehavior);
615 * Request to render the current frame
616 * @note This is a temporary workaround (to be removed in the future) to request the rendering of
617 * the current frame if the color or visibility of any actor is updated. It MUST NOT be used
618 * for any other purposes.
620 void RequestRendering();
623 * Sets the depths of all layers.
624 * @param layers The layers in depth order.
625 * @param[in] rootLayer The root layer of the sorted layers.
627 void SetLayerDepths(const std::vector<Layer*>& layers, const Layer* rootLayer);
630 * Set the depth indices of all nodes (in LayerUI's)
631 * @param[in] nodeDepths A vector of nodes and associated depth indices
633 void SetDepthIndices(OwnerPointer<NodeDepths>& nodeDepths);
636 * Adds an implementation of the FrameCallbackInterface.
637 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
638 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
640 void AddFrameCallback(OwnerPointer<FrameCallback>& frameCallback, const Node* rootNode);
643 * Removes the specified implementation of FrameCallbackInterface.
644 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
646 void RemoveFrameCallback(FrameCallbackInterface* frameCallback);
650 UpdateManager(const UpdateManager&);
653 UpdateManager& operator=(const UpdateManager& rhs);
656 * Helper to check whether the update-thread should keep going.
657 * @param[in] elapsedSeconds The time in seconds since the previous update.
658 * @return True if the update-thread should keep going.
660 uint32_t KeepUpdatingCheck(float elapsedSeconds) const;
663 * Helper to reset all Node properties
664 * @param[in] bufferIndex to use
666 void ResetProperties(BufferIndex bufferIndex);
669 * Perform gesture updates.
670 * @param[in] bufferIndex to use
671 * @param[in] lastVSyncTime The last VSync time in milliseconds.
672 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
673 * @return true, if any properties were updated.
675 bool ProcessGestures(BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds);
678 * Perform animation updates
679 * @param[in] bufferIndex to use
680 * @param[in] elapsedSeconds time since last frame
681 * @return true if at least one animations is currently active or false otherwise
683 bool Animate(BufferIndex bufferIndex, float elapsedSeconds);
686 * Applies constraints to CustomObjects
687 * @param[in] bufferIndex to use
689 void ConstrainCustomObjects(BufferIndex bufferIndex);
692 * Applies constraints to RenderTasks
693 * @param[in] bufferIndex to use
695 void ConstrainRenderTasks(BufferIndex bufferIndex);
698 * Applies constraints to Shaders
699 * @param[in] bufferIndex to use
701 void ConstrainShaders(BufferIndex bufferIndex);
704 * Perform property notification updates
705 * @param[in] bufferIndex to use
707 void ProcessPropertyNotifications(BufferIndex bufferIndex);
710 * Pass shader binaries queued here on to event thread.
712 void ForwardCompiledShadersToEventThread();
715 * Update node shaders, opacity, geometry etc.
716 * @param[in] bufferIndex to use
718 void UpdateNodes(BufferIndex bufferIndex);
722 * @param[in] bufferIndex to use
724 void UpdateRenderers(BufferIndex bufferIndex);
727 // needs to be direct member so that getter for event buffer can be inlined
728 SceneGraphBuffers mSceneGraphBuffers;
734 // Messages for UpdateManager
736 inline void InstallRootMessage(UpdateManager& manager, OwnerPointer<Layer>& root)
738 // Message has ownership of Layer while in transit from event -> update
739 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Layer> >;
741 // Reserve some memory inside the message queue
742 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
744 // Construct message in the message queue memory; note that delete should not be called on the return value
745 new(slot) LocalType(&manager, &UpdateManager::InstallRoot, root);
748 inline void UninstallRootMessage(UpdateManager& manager, const Layer* constRoot)
750 // Scene graph thread can destroy this object.
751 Layer* root = const_cast<Layer*>(constRoot);
753 using LocalType = MessageValue1<UpdateManager, Layer*>;
755 // Reserve some memory inside the message queue
756 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
758 // Construct message in the message queue memory; note that delete should not be called on the return value
759 new(slot) LocalType(&manager, &UpdateManager::UninstallRoot, root);
762 inline void AddNodeMessage(UpdateManager& manager, OwnerPointer<Node>& node)
764 // Message has ownership of Node while in transit from event -> update
765 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Node> >;
767 // Reserve some memory inside the message queue
768 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
770 // Construct message in the message queue memory; note that delete should not be called on the return value
771 new(slot) LocalType(&manager, &UpdateManager::AddNode, node);
774 inline void ConnectNodeMessage(UpdateManager& manager, const Node& constParent, const Node& constChild)
776 // Update thread can edit the object
777 Node& parent = const_cast<Node&>(constParent);
778 Node& child = const_cast<Node&>(constChild);
780 using LocalType = MessageValue2<UpdateManager, Node*, Node*>;
782 // Reserve some memory inside the message queue
783 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
785 // Construct message in the message queue memory; note that delete should not be called on the return value
786 new(slot) LocalType(&manager, &UpdateManager::ConnectNode, &parent, &child);
789 inline void DisconnectNodeMessage(UpdateManager& manager, const Node& constNode)
791 // Scene graph thread can modify this object.
792 Node& node = const_cast<Node&>(constNode);
794 using LocalType = MessageValue1<UpdateManager, Node*>;
796 // Reserve some memory inside the message queue
797 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
799 // Construct message in the message queue memory; note that delete should not be called on the return value
800 new(slot) LocalType(&manager, &UpdateManager::DisconnectNode, &node);
803 inline void DestroyNodeMessage(UpdateManager& manager, const Node& constNode)
805 // Scene graph thread can destroy this object.
806 Node& node = const_cast<Node&>(constNode);
808 using LocalType = MessageValue1<UpdateManager, Node*>;
810 // Reserve some memory inside the message queue
811 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
813 // Construct message in the message queue memory; note that delete should not be called on the return value
814 new(slot) LocalType(&manager, &UpdateManager::DestroyNode, &node);
817 inline void AddCameraMessage(UpdateManager& manager, OwnerPointer<Camera>& camera)
819 // Message has ownership of Camera while in transit from event -> update
820 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Camera> >;
822 // Reserve some memory inside the message queue
823 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
825 // Construct message in the message queue memory; note that delete should not be called on the return value
826 new(slot) LocalType(&manager, &UpdateManager::AddCamera, camera);
829 inline void RemoveCameraMessage(UpdateManager& manager, const Camera* camera)
831 using LocalType = MessageValue1<UpdateManager, Camera*>;
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::RemoveCamera, const_cast<Camera*>(camera));
840 inline void AddObjectMessage(UpdateManager& manager, OwnerPointer<PropertyOwner>& object)
842 // Message has ownership of object while in transit from event -> update
843 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyOwner> >;
845 // Reserve some memory inside the message queue
846 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
848 // Construct message in the message queue memory; note that delete should not be called on the return value
849 new(slot) LocalType(&manager, &UpdateManager::AddObject, object);
852 inline void RemoveObjectMessage(UpdateManager& manager, const PropertyOwner* object)
854 using LocalType = MessageValue1<UpdateManager, PropertyOwner*>;
856 // Reserve some memory inside the message queue
857 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
859 // Construct message in the message queue memory; note that delete should not be called on the return value
860 new(slot) LocalType(&manager, &UpdateManager::RemoveObject, const_cast<PropertyOwner*>(object));
863 inline void AddAnimationMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Animation>& animation)
865 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Animation> >;
867 // Reserve some memory inside the message queue
868 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
870 // Construct message in the message queue memory; note that delete should not be called on the return value
871 new(slot) LocalType(&manager, &UpdateManager::AddAnimation, animation);
874 inline void StopAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
876 // The scene-graph thread owns this object so it can safely edit it.
877 Animation& animation = const_cast<Animation&>(constAnimation);
879 using LocalType = MessageValue1<UpdateManager, Animation*>;
881 // Reserve some memory inside the message queue
882 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
884 // Construct message in the message queue memory; note that delete should not be called on the return value
885 new(slot) LocalType(&manager, &UpdateManager::StopAnimation, &animation);
888 inline void RemoveAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
890 // The scene-graph thread owns this object so it can safely edit it.
891 Animation& animation = const_cast<Animation&>(constAnimation);
893 using LocalType = MessageValue1<UpdateManager, 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::RemoveAnimation, &animation);
902 inline void AddRenderTaskListMessage(UpdateManager& manager, OwnerPointer<SceneGraph::RenderTaskList>& taskList)
904 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::RenderTaskList> >;
906 // Reserve some memory inside the message queue
907 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
909 // Construct message in the message queue memory; note that delete should not be called on the return value
910 new(slot) LocalType(&manager, &UpdateManager::AddRenderTaskList, taskList);
913 inline void RemoveRenderTaskListMessage(UpdateManager& manager, const RenderTaskList& constTaskList)
915 // The scene-graph thread owns this object so it can safely edit it.
916 RenderTaskList& taskList = const_cast<RenderTaskList&>(constTaskList);
918 using LocalType = MessageValue1<UpdateManager, RenderTaskList*>;
920 // Reserve some memory inside the message queue
921 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
923 // Construct message in the message queue memory; note that delete should not be called on the return value
924 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderTaskList, &taskList);
927 inline void AddSceneMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Scene>& scene)
929 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Scene> >;
931 // Reserve some memory inside the message queue
932 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
934 // Construct message in the message queue memory; note that delete should not be called on the return value
935 new(slot) LocalType(&manager, &UpdateManager::AddScene, scene);
938 inline void RemoveSceneMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
940 // The scene-graph thread owns this object so it can safely edit it.
941 Scene& scene = const_cast<Scene&>(constScene);
943 using LocalType = MessageValue1<UpdateManager, Scene*>;
945 // Reserve some memory inside the message queue
946 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
948 // Construct message in the message queue memory; note that delete should not be called on the return value
949 new(slot) LocalType(&manager, &UpdateManager::RemoveScene, &scene);
952 inline void AddPropertyNotificationMessage(UpdateManager& manager, OwnerPointer<PropertyNotification>& propertyNotification)
954 // Message has ownership of PropertyNotification while in transit from event -> update
955 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyNotification> >;
957 // Reserve some memory inside the message queue
958 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
960 // Construct message in the message queue memory; note that delete should not be called on the return value
961 new(slot) LocalType(&manager, &UpdateManager::AddPropertyNotification, propertyNotification);
964 inline void RemovePropertyNotificationMessage(UpdateManager& manager, const PropertyNotification& constPropertyNotification)
966 // The scene-graph thread owns this object so it can safely edit it.
967 PropertyNotification& propertyNotification = const_cast<PropertyNotification&>(constPropertyNotification);
969 using LocalType = MessageValue1<UpdateManager, PropertyNotification*>;
971 // Reserve some memory inside the message queue
972 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
974 // Construct message in the message queue memory; note that delete should not be called on the return value
975 new(slot) LocalType(&manager, &UpdateManager::RemovePropertyNotification, &propertyNotification);
978 inline void PropertyNotificationSetNotifyModeMessage(UpdateManager& manager,
979 const PropertyNotification* constPropertyNotification,
980 PropertyNotification::NotifyMode notifyMode)
982 // The scene-graph thread owns this object so it can safely edit it.
983 PropertyNotification* propertyNotification = const_cast<PropertyNotification*>(constPropertyNotification);
985 using LocalType = MessageValue2<UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode>;
987 // Reserve some memory inside the message queue
988 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
990 // Construct message in the message queue memory; note that delete should not be called on the return value
991 new(slot) LocalType(&manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode);
994 // The render thread can safely change the Shader
995 inline void AddShaderMessage(UpdateManager& manager, OwnerPointer<Shader>& shader)
997 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Shader> >;
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::AddShader, shader);
1006 // The render thread can safely change the Shader
1007 inline void RemoveShaderMessage(UpdateManager& manager, const Shader* shader)
1009 using LocalType = MessageValue1<UpdateManager, Shader*>;
1011 // Reserve some memory inside the message queue
1012 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1014 // Construct message in the message queue memory; note that delete should not be called on the return value
1015 new(slot) LocalType(&manager, &UpdateManager::RemoveShader, const_cast<Shader*>(shader));
1018 inline void SurfaceReplacedMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
1020 // The scene-graph thread owns this object so it can safely edit it.
1021 Scene& scene = const_cast<Scene&>(constScene);
1023 using LocalType = MessageValue1<UpdateManager, Scene*>;
1025 // Reserve some memory inside the message queue
1026 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1028 // Construct message in the message queue memory; note that delete should not be called on the return value
1029 new(slot) LocalType(&manager, &UpdateManager::SurfaceReplaced, &scene);
1032 inline void KeepRenderingMessage(UpdateManager& manager, float durationSeconds)
1034 using LocalType = MessageValue1<UpdateManager, float>;
1036 // Reserve some memory inside the message queue
1037 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1039 // Construct message in the message queue memory; note that delete should not be called on the return value
1040 new(slot) LocalType(&manager, &UpdateManager::KeepRendering, durationSeconds);
1043 inline void SetRenderingBehaviorMessage(UpdateManager& manager, DevelStage::Rendering renderingBehavior)
1045 using LocalType = MessageValue1<UpdateManager, DevelStage::Rendering>;
1047 // Reserve some memory inside the message queue
1048 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1050 // Construct message in the message queue memory; note that delete should not be called on the return value
1051 new(slot) LocalType(&manager, &UpdateManager::SetRenderingBehavior, renderingBehavior);
1054 inline void RequestRenderingMessage(UpdateManager& manager)
1056 using LocalType = Message<UpdateManager>;
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::RequestRendering);
1066 * Create a message for setting the depth of a layer
1067 * @param[in] manager The update manager
1068 * @param[in] layers list of layers
1069 * @param[in] rootLayer The rool layer
1071 inline void SetLayerDepthsMessage(UpdateManager& manager, const std::vector<Layer*>& layers, const Layer* rootLayer)
1073 using LocalType = MessageValue2<UpdateManager, std::vector<Layer*>, const Layer*>;
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::SetLayerDepths, layers, rootLayer);
1082 inline void AddRendererMessage(UpdateManager& manager, OwnerPointer<Renderer>& object)
1084 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Renderer> >;
1086 // Reserve some memory inside the message queue
1087 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1088 // Construct message in the message queue memory; note that delete should not be called on the return value
1089 new(slot) LocalType(&manager, &UpdateManager::AddRenderer, object);
1092 inline void RemoveRendererMessage(UpdateManager& manager, const Renderer& object)
1094 using LocalType = MessageValue1<UpdateManager, Renderer*>;
1096 // Reserve some memory inside the message queue
1097 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1098 // Construct message in the message queue memory; note that delete should not be called on the return value
1099 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderer, const_cast<Renderer*>(&object));
1102 // The render thread can safely change the Shader
1103 inline void AddTextureSetMessage(UpdateManager& manager, OwnerPointer<TextureSet>& textureSet)
1105 using LocalType = MessageValue1<UpdateManager, OwnerPointer<TextureSet> >;
1107 // Reserve some memory inside the message queue
1108 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1110 // Construct message in the message queue memory; note that delete should not be called on the return value
1111 new(slot) LocalType(&manager, &UpdateManager::AddTextureSet, textureSet);
1114 // The render thread can safely change the Shader
1115 inline void RemoveTextureSetMessage(UpdateManager& manager, TextureSet& textureSet)
1117 using LocalType = MessageValue1<UpdateManager, TextureSet*>;
1119 // Reserve some memory inside the message queue
1120 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1122 // Construct message in the message queue memory; note that delete should not be called on the return value
1123 new(slot) LocalType(&manager, &UpdateManager::RemoveTextureSet, &textureSet);
1126 inline void AddSamplerMessage(UpdateManager& manager, OwnerPointer<Render::Sampler>& sampler)
1128 // Message has ownership of Sampler while in transit from event -> update
1129 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Sampler> >;
1131 // Reserve some memory inside the message queue
1132 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1134 // Construct message in the message queue memory; note that delete should not be called on the return value
1135 new(slot) LocalType(&manager, &UpdateManager::AddSampler, sampler);
1138 inline void RemoveSamplerMessage(UpdateManager& manager, Render::Sampler& sampler)
1140 using LocalType = MessageValue1<UpdateManager, Render::Sampler*>;
1142 // Reserve some memory inside the message queue
1143 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1145 // Construct message in the message queue memory; note that delete should not be called on the return value
1146 new(slot) LocalType(&manager, &UpdateManager::RemoveSampler, &sampler);
1149 inline void SetFilterModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode)
1151 using LocalType = MessageValue3<UpdateManager, Render::Sampler*, uint32_t, uint32_t>;
1153 // Reserve some memory inside the message queue
1154 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1156 // Construct message in the message queue memory; note that delete should not be called on the return value
1157 new(slot) LocalType(&manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode);
1160 inline void SetWrapModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode)
1162 using LocalType = MessageValue4<UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t>;
1164 // Reserve some memory inside the message queue
1165 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1167 // Construct message in the message queue memory; note that delete should not be called on the return value
1168 new(slot) LocalType(&manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode);
1171 inline void AddVertexBuffer(UpdateManager& manager, OwnerPointer<Render::VertexBuffer>& vertexBuffer)
1173 // Message has ownership of vertexBuffer while in transit from event -> update
1174 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::VertexBuffer> >;
1176 // Reserve some memory inside the message queue
1177 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1179 // Construct message in the message queue memory; note that delete should not be called on the return value
1180 new(slot) LocalType(&manager, &UpdateManager::AddVertexBuffer, vertexBuffer);
1183 inline void RemoveVertexBuffer(UpdateManager& manager, Render::VertexBuffer& vertexBuffer)
1185 using LocalType = MessageValue1<UpdateManager, Render::VertexBuffer*>;
1187 // Reserve some memory inside the message queue
1188 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1190 // Construct message in the message queue memory; note that delete should not be called on the return value
1191 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &vertexBuffer);
1194 inline void SetVertexBufferFormat(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format)
1196 // Message has ownership of VertexBuffer::Format while in transit from event -> update
1197 using LocalType = MessageValue2<UpdateManager, Render::VertexBuffer*, OwnerPointer<Render::VertexBuffer::Format> >;
1199 // Reserve some memory inside the message queue
1200 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1202 // Construct message in the message queue memory; note that delete should not be called on the return value
1203 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferFormat, &vertexBuffer, format);
1206 inline void SetVertexBufferData(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Vector<uint8_t> >& data, uint32_t size)
1208 // Message has ownership of VertexBuffer data while in transit from event -> update
1209 using LocalType = MessageValue3<UpdateManager, Render::VertexBuffer*, OwnerPointer<Vector<uint8_t> >, uint32_t>;
1211 // Reserve some memory inside the message queue
1212 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1214 // Construct message in the message queue memory; note that delete should not be called on the return value
1215 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferData, &vertexBuffer, data, size);
1218 inline void AddGeometry(UpdateManager& manager, OwnerPointer<Render::Geometry>& geometry)
1220 // Message has ownership of Geometry while in transit from event -> update
1221 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Geometry> >;
1223 // Reserve some memory inside the message queue
1224 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1226 // Construct message in the message queue memory; note that delete should not be called on the return value
1227 new(slot) LocalType(&manager, &UpdateManager::AddGeometry, geometry);
1230 inline void RemoveGeometry(UpdateManager& manager, Render::Geometry& geometry)
1232 using LocalType = MessageValue1<UpdateManager, Render::Geometry*>;
1234 // Reserve some memory inside the message queue
1235 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1237 // Construct message in the message queue memory; note that delete should not be called on the return value
1238 new(slot) LocalType(&manager, &UpdateManager::RemoveGeometry, &geometry);
1241 inline void AttachVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1243 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1245 // Reserve some memory inside the message queue
1246 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1248 // Construct message in the message queue memory; note that delete should not be called on the return value
1249 new(slot) LocalType(&manager, &UpdateManager::AttachVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1252 inline void RemoveVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1254 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
1256 // Reserve some memory inside the message queue
1257 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1259 // Construct message in the message queue memory; note that delete should not be called on the return value
1260 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1263 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1264 template<typename T>
1265 class IndexBufferMessage : public MessageBase
1269 * Constructor which does a Vector::Swap()
1271 IndexBufferMessage(T* manager, Render::Geometry* geometry, Dali::Vector<uint16_t>& indices)
1274 mRenderGeometry(geometry)
1276 mIndices.Swap(indices);
1280 * Virtual destructor
1282 ~IndexBufferMessage() override = default;
1285 * @copydoc MessageBase::Process
1287 void Process(BufferIndex /*bufferIndex*/) override
1289 DALI_ASSERT_DEBUG(mManager && "Message does not have an object");
1290 mManager->SetIndexBuffer(mRenderGeometry, mIndices);
1295 Render::Geometry* mRenderGeometry;
1296 Dali::Vector<uint16_t> mIndices;
1299 inline void SetIndexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, Dali::Vector<uint16_t>& indices)
1301 using LocalType = IndexBufferMessage<UpdateManager>;
1303 // Reserve some memory inside the message queue
1304 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1306 // Construct message in the message queue memory; note that delete should not be called on the return value
1307 new(slot) LocalType(&manager, &geometry, indices);
1310 inline void SetGeometryTypeMessage(UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType)
1312 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, uint32_t>;
1314 // Reserve some memory inside the message queue
1315 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1317 // Construct message in the message queue memory; note that delete should not be called on the return value
1318 new(slot) LocalType(&manager, &UpdateManager::SetGeometryType, &geometry, geometryType);
1321 inline void AddTexture(UpdateManager& manager, OwnerPointer<Render::Texture>& texture)
1323 // Message has ownership of Texture while in transit from event -> update
1324 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Texture> >;
1326 // Reserve some memory inside the message queue
1327 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1329 // Construct message in the message queue memory; note that delete should not be called on the return value
1330 new(slot) LocalType(&manager, &UpdateManager::AddTexture, texture);
1333 inline void RemoveTexture(UpdateManager& manager, Render::Texture& texture)
1335 using LocalType = MessageValue1<UpdateManager, Render::Texture*>;
1337 // Reserve some memory inside the message queue
1338 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1340 // Construct message in the message queue memory; note that delete should not be called on the return value
1341 new(slot) LocalType(&manager, &UpdateManager::RemoveTexture, &texture);
1344 inline void UploadTextureMessage(UpdateManager& manager, Render::Texture& texture, PixelDataPtr pixelData, const Texture::UploadParams& params)
1346 using LocalType = MessageValue3<UpdateManager, Render::Texture*, PixelDataPtr, Texture::UploadParams>;
1348 // Reserve some memory inside the message queue
1349 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1351 // Construct message in the message queue memory; note that delete should not be called on the return value
1352 new(slot) LocalType(&manager, &UpdateManager::UploadTexture, &texture, pixelData, params);
1355 inline void GenerateMipmapsMessage(UpdateManager& manager, Render::Texture& texture)
1357 using LocalType = MessageValue1<UpdateManager, Render::Texture*>;
1359 // Reserve some memory inside the message queue
1360 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1362 // Construct message in the message queue memory; note that delete should not be called on the return value
1363 new(slot) LocalType(&manager, &UpdateManager::GenerateMipmaps, &texture);
1366 inline void AddFrameBuffer(UpdateManager& manager, OwnerPointer<Render::FrameBuffer>& frameBuffer)
1368 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::FrameBuffer> >;
1370 // Reserve some memory inside the message queue
1371 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1373 // Construct message in the message queue memory; note that delete should not be called on the return value
1374 new(slot) LocalType(&manager, &UpdateManager::AddFrameBuffer, frameBuffer);
1377 inline void RemoveFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer)
1379 using LocalType = MessageValue1<UpdateManager, Render::FrameBuffer*>;
1381 // Reserve some memory inside the message queue
1382 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1384 // Construct message in the message queue memory; note that delete should not be called on the return value
1385 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer);
1388 inline void AttachColorTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer)
1390 using LocalType = MessageValue4<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t>;
1392 // Reserve some memory inside the message queue
1393 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1395 // Construct message in the message queue memory; note that delete should not be called on the return value
1396 new(slot) LocalType(&manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer);
1399 inline void AttachDepthTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1401 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1403 // Reserve some memory inside the message queue
1404 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1406 // Construct message in the message queue memory; note that delete should not be called on the return value
1407 new(slot) LocalType(&manager, &UpdateManager::AttachDepthTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1410 inline void AttachDepthStencilTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1412 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1414 // Reserve some memory inside the message queue
1415 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1417 // Construct message in the message queue memory; note that delete should not be called on the return value
1418 new(slot) LocalType(&manager, &UpdateManager::AttachDepthStencilTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1421 inline void SetDepthIndicesMessage(UpdateManager& manager, OwnerPointer<NodeDepths>& nodeDepths)
1423 using LocalType = MessageValue1<UpdateManager, OwnerPointer<NodeDepths> >;
1425 // Reserve some memory inside the message queue
1426 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1428 // Construct message in the message queue memory; note that delete should not be called on the return value
1429 new(slot) LocalType(&manager, &UpdateManager::SetDepthIndices, nodeDepths);
1432 inline void AddResetterMessage(UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter)
1434 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyResetterBase> >;
1436 // Reserve some memory inside the message queue
1437 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1439 // Construct message in the message queue memory; note that delete should not be called on the return value
1440 new(slot) LocalType(&manager, &UpdateManager::AddPropertyResetter, resetter);
1443 inline void AddFrameCallbackMessage(UpdateManager& manager, OwnerPointer<FrameCallback>& frameCallback, const Node& rootNode)
1445 using LocalType = MessageValue2<UpdateManager, OwnerPointer<FrameCallback>, const Node*>;
1447 // Reserve some memory inside the message queue
1448 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1450 // Construct message in the message queue memory; note that delete should not be called on the return value
1451 new(slot) LocalType(&manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode);
1454 inline void RemoveFrameCallbackMessage(UpdateManager& manager, FrameCallbackInterface& frameCallback)
1456 using LocalType = MessageValue1<UpdateManager, FrameCallbackInterface*>;
1458 // Reserve some memory inside the message queue
1459 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1461 // Construct message in the message queue memory; note that delete should not be called on the return value
1462 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameCallback, &frameCallback);
1465 } // namespace SceneGraph
1467 } // namespace Internal
1471 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H