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/renderer-resetter.h>
40 #include <dali/internal/update/common/resetter-manager.h>
41 #include <dali/internal/update/common/scene-graph-buffers.h>
42 #include <dali/internal/update/common/scene-graph-property-notification.h>
43 #include <dali/internal/update/common/scene-graph-scene.h>
44 #include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
45 #include <dali/internal/update/manager/scene-graph-frame-callback.h> // for OwnerPointer< FrameCallback >
46 #include <dali/internal/update/nodes/node.h>
47 #include <dali/internal/update/nodes/scene-graph-layer.h>
48 #include <dali/internal/update/render-tasks/scene-graph-camera.h>
49 #include <dali/internal/update/render-tasks/scene-graph-render-task-list.h>
50 #include <dali/internal/update/rendering/scene-graph-renderer.h> // for OwnerPointer< Renderer >
51 #include <dali/internal/update/rendering/scene-graph-texture-set.h> // for OwnerPointer< TextureSet >
53 #include <dali/graphics-api/graphics-texture-upload-helper.h> // for Graphics::UploadParams
60 class FrameCallbackInterface;
64 class RenderController;
66 } // namespace Integration
70 class PropertyNotifier;
71 class NotificationManager;
72 class CompleteNotificationInterface;
80 // value types used by messages
82 struct ParameterType<PropertyNotification::NotifyMode>
83 : public BasicType<PropertyNotification::NotifyMode>
92 class RenderTaskProcessor;
97 * UpdateManager maintains a scene graph i.e. a tree of nodes as well as
98 * other scene graph property owning objects.
99 * It controls the Update traversal, in which nodes are repositioned/animated,
100 * and organizes the the culling and rendering of the scene.
101 * It also maintains the lifecycle of nodes and other property owners that are
102 * disconnected from the scene graph.
104 class UpdateManager : public ShaderSaver, public ResetterManager
108 * Construct a new UpdateManager.
109 * @param[in] notificationManager This should be notified when animations have finished.
110 * @param[in] animationPlaylist The CompleteNotificationInterface that handles the animations
111 * @param[in] propertyNotifier The PropertyNotifier
112 * @param[in] controller After messages are flushed, we request a render from the RenderController.
113 * @param[in] renderManager This is responsible for rendering the results of each "update".
114 * @param[in] renderQueue Used to queue messages for the next render.
115 * @param[in] renderTaskProcessor Handles RenderTasks and RenderInstrucitons.
117 UpdateManager(NotificationManager& notificationManager,
118 CompleteNotificationInterface& animationPlaylist,
119 PropertyNotifier& propertyNotifier,
120 Integration::RenderController& controller,
121 RenderManager& renderManager,
122 RenderQueue& renderQueue,
123 RenderTaskProcessor& renderTaskProcessor);
128 ~UpdateManager() override;
130 // Node connection methods
133 * Installs a new layer as the root node.
134 * @pre The layer is of derived Node type Layer.
135 * @pre The layer does not have a parent.
136 * @param[in] layer The new root node.
137 * @post The node is owned by UpdateManager.
139 void InstallRoot(OwnerPointer<Layer>& layer);
142 * Uninstalls the root node.
143 * @pre The layer is of derived Node type Layer.
144 * @pre The layer does not have a parent.
145 * @param[in] layer The root node.
146 * @post The node is owned by UpdateManager.
148 void UninstallRoot(Layer* layer);
151 * Add a Node; UpdateManager takes ownership.
152 * @pre The node does not have a parent.
153 * @note even though nodes are pool allocated, they also contain other heap allocated data, thus using OwnerPointer when transferring the data
154 * @param[in] node The node to add.
156 void AddNode(OwnerPointer<Node>& node);
159 * Connect a Node to the scene-graph.
160 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
161 * @pre The node does not already have a parent.
162 * @param[in] parent The new parent node.
164 void ConnectNode(Node* parent, Node* node);
167 * Disconnect a Node from the scene-graph.
168 * A disconnected Node has has no parent or children, and its properties cannot be animated/constrained.
169 * @pre The node has a parent.
170 * @param[in] node The node to disconnect.
172 void DisconnectNode(Node* node);
175 * Destroy a Node owned by UpdateManager.
176 * This is not immediate; Nodes are passed to the RenderQueue to allow GL resources to be deleted.
177 * In the following update, the previously queued Nodes may be deleted.
178 * @pre The node has been disconnected from the scene-graph i.e. has no parent or children.
179 * @param[in] node The node to destroy.
181 void DestroyNode(Node* node);
184 * Add a newly created object.
185 * @param[in] object The object to add.
186 * @post The object is owned by UpdateManager.
188 void AddObject(OwnerPointer<PropertyOwner>& object);
192 * @param[in] object The object to remove.
194 void RemoveObject(PropertyOwner* object);
197 * Add a newly created render task list.
198 * @param[in] taskList The render task list to add.
199 * @post The render task list is owned by UpdateManager.
201 void AddRenderTaskList(OwnerPointer<RenderTaskList>& taskList);
204 * Remove a render task list.
205 * @param[in] taskList The render task list to remove.
207 void RemoveRenderTaskList(RenderTaskList* taskList);
210 * Add a newly created scene.
211 * @param[in] scene The scene to add.
212 * @post The scene is owned by UpdateManager.
214 void AddScene(OwnerPointer<Scene>& scene);
218 * @param[in] scene The scene to remove.
220 void RemoveScene(Scene* scene);
225 * Add a newly created animation.
226 * @param[in] animation The animation to add.
227 * @post The animation is owned by UpdateManager.
229 void AddAnimation(OwnerPointer<SceneGraph::Animation>& animation);
233 * @param[in] animation The animation to stop.
235 void StopAnimation(Animation* animation);
238 * Remove an animation.
239 * @param[in] animation The animation to remove.
241 void RemoveAnimation(Animation* animation);
244 * Query whether any animations are currently running.
245 * @return True if any animations are running.
247 bool IsAnimationRunning() const;
252 * @copydoc Dali::Internal::SceneGraph::ResetterManager::AddPropertyResetter()
254 void AddPropertyResetter(OwnerPointer<PropertyResetterBase>& propertyResetter) override;
257 * @copydoc Dali::Internal::SceneGraph::ResetterManager::AddNodeResetter()
259 void AddNodeResetter(const Node& node) override;
262 * @copydoc Dali::Internal::SceneGraph::ResetterManager::AddRendererResetter()
264 void AddRendererResetter(const Renderer& renderer) override;
266 // Property Notification
269 * Add a newly created property notification
270 * @param[in] propertyNotification The notification to add
271 * @post The propertyNotification is owned by UpdateManager.
273 void AddPropertyNotification(OwnerPointer<PropertyNotification>& propertyNotification);
276 * Remove a property notification
277 * @param[in] propertyNotification The notification to remove
279 void RemovePropertyNotification(PropertyNotification* propertyNotification);
282 * Set Notify state for PropertyNotification
283 * @param[in] propertyNotification The notification to remove
284 * @param[in] notifyMode The notification mode.
286 void PropertyNotificationSetNotify(PropertyNotification* propertyNotification, PropertyNotification::NotifyMode notifyMode);
291 * Add a newly created shader.
292 * @param[in] shader The shader to add.
293 * @post The shader is owned by the UpdateManager.
295 void AddShader(OwnerPointer<Shader>& shader);
299 * @pre The shader has been added to the UpdateManager.
300 * @param[in] shader The shader to remove.
301 * @post The shader is destroyed.
303 void RemoveShader(Shader* shader);
306 * Set the shader data for a Shader object
307 * @param[in] shader The shader to modify
308 * @param[in] shaderData Source code, hash over source, and optional compiled binary for the shader program
310 void SetShaderData(Shader* shader, Internal::ShaderDataPtr shaderData);
313 * @brief Accept compiled shaders passed back on render thread for saving.
314 * @param[in] shaderData Source code, hash over source, and corresponding compiled binary to be saved.
316 void SaveBinary(Internal::ShaderDataPtr shaderData) override;
319 * @brief Set the destination for compiled shader binaries to be passed on to.
320 * The dispatcher passed in will be called from the update thread.
321 * @param[in] upstream A sink for ShaderDatas to be passed into.
323 void SetShaderSaver(ShaderSaver& upstream);
328 * Add a new renderer to scene
329 * @param renderer to add
331 void AddRenderer(const RendererKey& renderer);
334 * Remove a renderer from scene
335 * @param renderer to remove
337 void RemoveRenderer(const RendererKey& renderer);
340 * Attach a renderer to node
341 * @param renderer to attach
343 void AttachRenderer(Node* node, Renderer* renderer);
348 * Set the pan gesture processor.
349 * Pan Gesture processor lives for the lifetime of UpdateManager
350 * @param[in] gesture The gesture processor.
351 * @post The gestureProcessor is owned by the UpdateManager.
353 void SetPanGestureProcessor(PanGesture* gestureProcessor);
358 * Add a newly created TextureSet.
359 * @param[in] textureSet The texture set to add.
360 * @post The TextureSet is owned by the UpdateManager.
362 void AddTextureSet(OwnerPointer<TextureSet>& textureSet);
365 * Remove a TextureSet.
366 * @pre The TextureSet has been added to the UpdateManager.
367 * @param[in] textureSet The TextureSet to remove.
368 * @post The TextureSet is destroyed.
370 void RemoveTextureSet(TextureSet* textureSet);
375 * Get the scene graph side list of RenderTasks.
376 * @param[in] systemLevel True if using the system-level overlay.
377 * @return The list of render tasks
379 RenderTaskList* GetRenderTaskList(bool systemLevel);
381 // Message queue handling
384 * Reserve space for another message in the queue; this must then be initialized by the caller.
385 * The message will be read from the update-thread after the next FlushMessages is called.
386 * @post Calling this method may invalidate any previously returned slots.
387 * @param[in] size The message size with respect to the size of type "char".
388 * @param[in] updateScene A flag, when true denotes that the message will cause the scene-graph node tree to require an update.
389 * @note the default value of updateScene should match that in EventThreadServices::ReserveMessageSlot.
390 * @return A pointer to the first char allocated for the message.
392 uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene = true);
395 * @return the current event-buffer index.
397 BufferIndex GetEventBufferIndex() const
399 // inlined as its called often from event thread
400 return mSceneGraphBuffers.GetEventBufferIndex();
404 * Called by the event-thread to signal that FlushQueue will be called
405 * e.g. when it has finished event processing.
407 void EventProcessingStarted();
410 * Called by the event-thread to signal that we need to queue messages.
412 void EventProcessingFinished();
415 * Flush the set of messages, which were previously stored with QueueMessage().
416 * Calls to this thread-safe method should be minimized, to avoid thread blocking.
418 * @return True if there are messages to process.
423 * Add a new sampler to RenderManager
424 * @param[in] sampler The sampler to add
425 * @post Sends a message to RenderManager to add the sampler.
426 * The sampler will be owned by RenderManager
428 void AddSampler(OwnerPointer<Render::Sampler>& sampler);
431 * Removes an existing sampler from RenderManager
432 * @param[in] sampler The sampler to remove
433 * @post The sampler will be destroyed in the render thread
435 void RemoveSampler(Render::Sampler* sampler);
438 * Sets the filter modes for an existing sampler
439 * @param[in] sampler The sampler
440 * @param[in] minFilterMode The filter to use under minification
441 * @param[in] magFilterMode The filter to use under magnification
443 void SetFilterMode(Render::Sampler* sampler, uint32_t minFilterMode, uint32_t magFilterMode);
446 * Sets the wrap mode for an existing sampler
447 * @param[in] sampler The sampler
448 * @param[in] rWrapMode Wrapping mode in z direction
449 * @param[in] sWrapMode Wrapping mode in x direction
450 * @param[in] tWrapMode Wrapping mode in y direction
452 void SetWrapMode(Render::Sampler* sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode);
455 * Add a new property buffer to RenderManager
456 * @param[in] propertryBuffer The property buffer to add
457 * @post Sends a message to RenderManager to add the property buffer.
458 * The property buffer will be owned by RenderManager
460 void AddVertexBuffer(OwnerPointer<Render::VertexBuffer>& propertryBuffer);
463 * Removes an existing VertexBuffer from RenderManager
464 * @param[in] propertryBuffer The property buffer to remove
465 * @post The property buffer will be destroyed in the render thread
467 void RemoveVertexBuffer(Render::VertexBuffer* propertryBuffer);
470 * Sets the format of an existing property buffer
471 * @param[in] vertexBuffer The property buffer.
472 * @param[in] format The new format of the buffer
473 * @post Sends a message to RenderManager to set the new format to the property buffer.
475 void SetVertexBufferFormat(Render::VertexBuffer* vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format);
478 * Sets the data of an existing property buffer
479 * @param[in] vertexBuffer The property buffer.
480 * @param[in] data The new data of the buffer
481 * @param[in] size The new size of the buffer
482 * @post Sends a message to RenderManager to set the new data to the property buffer.
484 void SetVertexBufferData(Render::VertexBuffer* vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size);
487 * Sets the divisor of a vertex buffer. This is used by the GPU to provide
489 * @param[in] vertexBuffer The property buffer.
490 * @param[in] divisor The instance divisor. 0 to turn instancing off.
492 void SetVertexBufferDivisor(Render::VertexBuffer* vertexBuffer, uint32_t divisor);
494 * Sets vertex buffer update callback
495 * @param[in] vertexBuffer
496 * @param[in] callback
498 void SetVertexBufferUpdateCallback(Render::VertexBuffer* vertexBuffer, Dali::VertexBufferUpdateCallback* callback);
501 * Adds a geometry to the RenderManager
502 * @param[in] geometry The geometry to add
503 * @post Sends a message to RenderManager to add the Geometry
504 * The geometry will be owned by RenderManager
506 void AddGeometry(OwnerPointer<Render::Geometry>& geometry);
509 * Removes an existing Geometry from RenderManager
510 * @param[in] geometry The geometry to remove
511 * @post The geometry will be destroyed in the render thread
513 void RemoveGeometry(Render::Geometry* geometry);
516 * Sets the geometry type of an existing Geometry
517 * @param[in] geometry The geometry
518 * @param[in] geometryType The type of the geometry
520 void SetGeometryType(Render::Geometry* geometry, uint32_t geometryType);
523 * Sets the index buffer to be used by a geometry
524 * @param[in] geometry The geometry
525 * @param[in] indices A vector containing the indices for the geometry
527 void SetIndexBuffer(Render::Geometry* geometry, Render::Geometry::Uint16ContainerType& indices);
530 * Sets the index buffer to be used by a geometry
531 * @param[in] geometry The geometry
532 * @param[in] indices A vector containing the indices for the geometry
534 void SetIndexBuffer(Render::Geometry* geometry, Render::Geometry::Uint32ContainerType& indices);
537 * Adds a vertex buffer to a geometry
538 * @param[in] geometry The geometry
539 * @param[in] vertexBuffer The property buffer
541 void AttachVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
544 * Removes a vertex buffer from a geometry
545 * @param[in] geometry The geometry
546 * @param[in] vertexBuffer The property buffer
548 void RemoveVertexBuffer(Render::Geometry* geometry, Render::VertexBuffer* vertexBuffer);
551 * Adds a texture to the render manager
552 * @param[in] texture The texture to add
553 * The texture will be owned by RenderManager
555 void AddTexture(const Render::TextureKey& texture);
558 * Removes a texture from the render manager
559 * @param[in] texture The texture to remove
560 * @post The texture will be destroyed in the render thread
562 void RemoveTexture(const Render::TextureKey& texture);
565 * Uploads data to a texture owned by the RenderManager
566 * @param[in] texture The texture
567 * @param[in] pixelData The pixel data object
568 * @param[in] params The parameters for the upload
570 void UploadTexture(const Render::TextureKey& texture, PixelDataPtr pixelData, const Graphics::UploadParams& params);
573 * Generates mipmaps for a texture owned by the RenderManager
574 * @param[in] texture The texture
576 void GenerateMipmaps(const Render::TextureKey& texture);
579 * Set the texture size owned by the RenderManager
580 * @param[in] texture The texture
581 * @param[in] size The texture size
583 void SetTextureSize(const Render::TextureKey& texture, const Dali::ImageDimensions& size);
586 * Set the texture pixel format owned by the RenderManager
587 * @param[in] texture The texture
588 * @param[in] pixelFormat The texture pixel format
590 void SetTextureFormat(const Render::TextureKey& texture, Dali::Pixel::Format pixelFormat);
593 * Adds a framebuffer to the render manager
594 * @param[in] frameBuffer The framebuffer to add
595 * The framebuffer will be owned by RenderManager
597 void AddFrameBuffer(OwnerPointer<Render::FrameBuffer>& frameBuffer);
600 * Removes a FrameBuffer from the render manager
601 * @param[in] frameBuffer The FrameBuffer to remove
602 * @post The FrameBuffer will be destroyed in the render thread
604 void RemoveFrameBuffer(Render::FrameBuffer* frameBuffer);
607 * Attach a texture as color output to an existing FrameBuffer
608 * @param[in] frameBuffer The FrameBuffer
609 * @param[in] texture The texture that will be used as output when rendering
610 * @param[in] mipmapLevel The mipmap of the texture to be attached
611 * @param[in] layer Indicates which layer of a cube map or array texture to attach. Unused for 2D textures
613 void AttachColorTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t face);
616 * Attach a texture as depth output to an existing FrameBuffer
617 * @param[in] frameBuffer The FrameBuffer
618 * @param[in] texture The texture that will be used as output when rendering
619 * @param[in] mipmapLevel The mipmap of the texture to be attached
621 void AttachDepthTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
624 * Attach a texture as depth/stencil output to an existing FrameBuffer
625 * @param[in] frameBuffer The FrameBuffer
626 * @param[in] texture The texture that will be used as output when rendering
627 * @param[in] mipmapLevel The mipmap of the texture to be attached
629 void AttachDepthStencilTextureToFrameBuffer(Render::FrameBuffer* frameBuffer, Render::Texture* texture, uint32_t mipmapLevel);
632 * Set a multisampling level value as texture output to the existing FrameBuffer
633 * @param[in] frameBuffer The FrameBuffer
634 * @param[in] multiSamplingLevel The level of multisampling
636 void SetMultiSamplingLevelToFrameBuffer(Render::FrameBuffer* frameBuffer, uint8_t multiSamplingLevel);
639 * This is called when the surface of the scene has been replaced.
640 * @param[in] scene The scene.
642 void SurfaceReplaced(Scene* scene);
646 * Performs an Update traversal on the scene-graph.
647 * @param[in] elapsedSeconds The elapsed time that should be applied to animations.
648 * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
649 * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
650 * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
651 * @param[in] isRenderingToFbo Whether this frame is being rendered into the Frame Buffer Object.
652 * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
653 * @return True if further updates are required e.g. during animations.
655 uint32_t Update(float elapsedSeconds,
656 uint32_t lastVSyncTimeMilliseconds,
657 uint32_t nextVSyncTimeMilliseconds,
658 bool renderToFboEnabled,
659 bool isRenderingToFbo,
663 * This is called after rendering all the scenes in the next frame.
668 * @copydoc Dali::Stage::KeepRendering()
670 void KeepRendering(float durationSeconds);
673 * @copydoc Dali::DevelStage::SetRenderingBehavior()
675 void SetRenderingBehavior(DevelStage::Rendering renderingBehavior);
678 * Request to render the current frame
679 * @note This is a temporary workaround (to be removed in the future) to request the rendering of
680 * the current frame if the color or visibility of any actor is updated. It MUST NOT be used
681 * for any other purposes.
683 void RequestRendering();
686 * Sets the depths of all layers.
687 * @param layers The layers in depth order.
688 * @param[in] rootLayer The root layer of the sorted layers.
690 void SetLayerDepths(const std::vector<Layer*>& layers, const Layer* rootLayer);
693 * Set the depth indices of all nodes (in LayerUI's)
694 * @param[in] nodeDepths A vector of nodes and associated depth indices
696 void SetDepthIndices(OwnerPointer<NodeDepths>& nodeDepths);
699 * Adds an implementation of the FrameCallbackInterface.
700 * @param[in] frameCallback An OwnerPointer to the SceneGraph FrameCallback object
701 * @param[in] rootNode A pointer to the root node to apply the FrameCallback to
703 void AddFrameCallback(OwnerPointer<FrameCallback>& frameCallback, const Node* rootNode);
706 * Removes the specified implementation of FrameCallbackInterface.
707 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to remove.
709 void RemoveFrameCallback(FrameCallbackInterface* frameCallback);
712 * Notify the specified implementation of FrameCallbackInterface with the given sync point.
713 * @param[in] frameCallback A pointer to the implementation of the FrameCallbackInterface to notify.
714 * @param[in] syncPoint The unique sync point to notify with.
716 void NotifyFrameCallback(FrameCallbackInterface* frameCallback, Dali::UpdateProxy::NotifySyncPoint syncPoint);
719 * Get the update message queue capacity (mutex locked)
721 std::size_t GetUpdateMessageQueueCapacity() const;
724 * Get the render message queue capacity
726 std::size_t GetRenderMessageQueueCapacity() const;
729 * Get the render instruction capacity
731 std::size_t GetRenderInstructionCapacity() const;
735 UpdateManager(const UpdateManager&);
738 UpdateManager& operator=(const UpdateManager& rhs);
741 * Add a camera on scene
742 * @param[in] camera The camera to add
744 void AddCamera(Camera* camera);
747 * Remove a camera from scene
748 * @param[in] camera to remove
750 void RemoveCamera(Camera* camera);
753 * Helper to check whether the update-thread should keep going.
754 * @param[in] elapsedSeconds The time in seconds since the previous update.
755 * @return True if the update-thread should keep going.
757 uint32_t KeepUpdatingCheck(float elapsedSeconds) const;
760 * Helper to reset all Node properties
761 * @param[in] bufferIndex to use
763 void ResetProperties(BufferIndex bufferIndex);
766 * Perform gesture updates.
767 * @param[in] bufferIndex to use
768 * @param[in] lastVSyncTime The last VSync time in milliseconds.
769 * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
770 * @return true, if any properties were updated.
772 bool ProcessGestures(BufferIndex bufferIndex, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds);
775 * Perform animation updates
776 * @param[in] bufferIndex to use
777 * @param[in] elapsedSeconds time since last frame
778 * @return true if at least one animations is currently active or false otherwise
780 bool Animate(BufferIndex bufferIndex, float elapsedSeconds);
783 * Applies constraints to CustomObjects
784 * @param[out] postPropertyOwner property owners those have post constraint.
785 * @param[in] bufferIndex to use
787 void ConstrainCustomObjects(PropertyOwnerContainer& postPropertyOwners, BufferIndex bufferIndex);
790 * Applies constraints to RenderTasks
791 * @param[out] postPropertyOwner property owners those have post constraint.
792 * @param[in] bufferIndex to use
794 void ConstrainRenderTasks(PropertyOwnerContainer& postPropertyOwners, BufferIndex bufferIndex);
797 * Applies constraints to Shaders
798 * @param[out] postPropertyOwner property owners those have post constraint.
799 * @param[in] bufferIndex to use
801 void ConstrainShaders(PropertyOwnerContainer& postPropertyOwners, BufferIndex bufferIndex);
804 * Perform property notification updates
805 * @param[in] bufferIndex to use
807 void ProcessPropertyNotifications(BufferIndex bufferIndex);
810 * Pass shader binaries queued here on to event thread.
812 void ForwardCompiledShadersToEventThread();
815 * Update node shaders, opacity, geometry etc.
816 * @param[out] postPropertyOwner property owners those have post constraint.
817 * @param[in] bufferIndex to use
819 void UpdateNodes(PropertyOwnerContainer& postPropertyOwners, BufferIndex bufferIndex);
822 * initialize layer renderables
823 * @param[in] bufferIndex
825 void UpdateLayers(BufferIndex bufferIndex);
829 * @param[out] postPropertyOwner property owners those have post constraint.
830 * @param[in] bufferIndex to use
832 void UpdateRenderers(PropertyOwnerContainer& postPropertyOwners, BufferIndex bufferIndex);
835 // needs to be direct member so that getter for event buffer can be inlined
836 SceneGraphBuffers mSceneGraphBuffers;
842 // Messages for UpdateManager
844 inline void InstallRootMessage(UpdateManager& manager, OwnerPointer<Layer>& root)
846 // Message has ownership of Layer while in transit from event -> update
847 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Layer>>;
849 // Reserve some memory inside the message queue
850 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
852 // Construct message in the message queue memory; note that delete should not be called on the return value
853 new(slot) LocalType(&manager, &UpdateManager::InstallRoot, root);
856 inline void UninstallRootMessage(UpdateManager& manager, const Layer* constRoot)
858 // Scene graph thread can destroy this object.
859 Layer* root = const_cast<Layer*>(constRoot);
861 using LocalType = MessageValue1<UpdateManager, Layer*>;
863 // Reserve some memory inside the message queue
864 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
866 // Construct message in the message queue memory; note that delete should not be called on the return value
867 new(slot) LocalType(&manager, &UpdateManager::UninstallRoot, root);
870 inline void AddNodeMessage(UpdateManager& manager, OwnerPointer<Node>& node)
872 // Message has ownership of Node while in transit from event -> update
873 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Node>>;
875 // Reserve some memory inside the message queue
876 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
878 // Construct message in the message queue memory; note that delete should not be called on the return value
879 new(slot) LocalType(&manager, &UpdateManager::AddNode, node);
882 inline void ConnectNodeMessage(UpdateManager& manager, const Node& constParent, const Node& constChild)
884 // Update thread can edit the object
885 Node& parent = const_cast<Node&>(constParent);
886 Node& child = const_cast<Node&>(constChild);
888 using LocalType = MessageValue2<UpdateManager, Node*, Node*>;
890 // Reserve some memory inside the message queue
891 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
893 // Construct message in the message queue memory; note that delete should not be called on the return value
894 new(slot) LocalType(&manager, &UpdateManager::ConnectNode, &parent, &child);
897 inline void DisconnectNodeMessage(UpdateManager& manager, const Node& constNode)
899 // Scene graph thread can modify this object.
900 Node& node = const_cast<Node&>(constNode);
902 using LocalType = MessageValue1<UpdateManager, Node*>;
904 // Reserve some memory inside the message queue
905 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
907 // Construct message in the message queue memory; note that delete should not be called on the return value
908 new(slot) LocalType(&manager, &UpdateManager::DisconnectNode, &node);
911 inline void DestroyNodeMessage(UpdateManager& manager, const Node& constNode)
913 // Scene graph thread can destroy this object.
914 Node& node = const_cast<Node&>(constNode);
916 using LocalType = MessageValue1<UpdateManager, Node*>;
918 // Reserve some memory inside the message queue
919 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
921 // Construct message in the message queue memory; note that delete should not be called on the return value
922 new(slot) LocalType(&manager, &UpdateManager::DestroyNode, &node);
925 inline void AddObjectMessage(UpdateManager& manager, OwnerPointer<PropertyOwner>& object)
927 // Message has ownership of object while in transit from event -> update
928 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyOwner>>;
930 // Reserve some memory inside the message queue
931 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
933 // Construct message in the message queue memory; note that delete should not be called on the return value
934 new(slot) LocalType(&manager, &UpdateManager::AddObject, object);
937 inline void RemoveObjectMessage(UpdateManager& manager, const PropertyOwner* object)
939 using LocalType = MessageValue1<UpdateManager, PropertyOwner*>;
941 // Reserve some memory inside the message queue
942 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
944 // Construct message in the message queue memory; note that delete should not be called on the return value
945 new(slot) LocalType(&manager, &UpdateManager::RemoveObject, const_cast<PropertyOwner*>(object));
948 inline void AddAnimationMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Animation>& animation)
950 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Animation>>;
952 // Reserve some memory inside the message queue
953 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
955 // Construct message in the message queue memory; note that delete should not be called on the return value
956 new(slot) LocalType(&manager, &UpdateManager::AddAnimation, animation);
959 inline void StopAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
961 // The scene-graph thread owns this object so it can safely edit it.
962 Animation& animation = const_cast<Animation&>(constAnimation);
964 using LocalType = MessageValue1<UpdateManager, Animation*>;
966 // Reserve some memory inside the message queue
967 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
969 // Construct message in the message queue memory; note that delete should not be called on the return value
970 new(slot) LocalType(&manager, &UpdateManager::StopAnimation, &animation);
973 inline void RemoveAnimationMessage(UpdateManager& manager, const Animation& constAnimation)
975 // The scene-graph thread owns this object so it can safely edit it.
976 Animation& animation = const_cast<Animation&>(constAnimation);
978 using LocalType = MessageValue1<UpdateManager, Animation*>;
980 // Reserve some memory inside the message queue
981 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
983 // Construct message in the message queue memory; note that delete should not be called on the return value
984 new(slot) LocalType(&manager, &UpdateManager::RemoveAnimation, &animation);
987 inline void AddRenderTaskListMessage(UpdateManager& manager, OwnerPointer<SceneGraph::RenderTaskList>& taskList)
989 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::RenderTaskList>>;
991 // Reserve some memory inside the message queue
992 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
994 // Construct message in the message queue memory; note that delete should not be called on the return value
995 new(slot) LocalType(&manager, &UpdateManager::AddRenderTaskList, taskList);
998 inline void RemoveRenderTaskListMessage(UpdateManager& manager, const RenderTaskList& constTaskList)
1000 // The scene-graph thread owns this object so it can safely edit it.
1001 RenderTaskList& taskList = const_cast<RenderTaskList&>(constTaskList);
1003 using LocalType = MessageValue1<UpdateManager, RenderTaskList*>;
1005 // Reserve some memory inside the message queue
1006 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1008 // Construct message in the message queue memory; note that delete should not be called on the return value
1009 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderTaskList, &taskList);
1012 inline void AddSceneMessage(UpdateManager& manager, OwnerPointer<SceneGraph::Scene>& scene)
1014 using LocalType = MessageValue1<UpdateManager, OwnerPointer<SceneGraph::Scene>>;
1016 // Reserve some memory inside the message queue
1017 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1019 // Construct message in the message queue memory; note that delete should not be called on the return value
1020 new(slot) LocalType(&manager, &UpdateManager::AddScene, scene);
1023 inline void RemoveSceneMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
1025 // The scene-graph thread owns this object so it can safely edit it.
1026 Scene& scene = const_cast<Scene&>(constScene);
1028 using LocalType = MessageValue1<UpdateManager, Scene*>;
1030 // Reserve some memory inside the message queue
1031 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1033 // Construct message in the message queue memory; note that delete should not be called on the return value
1034 new(slot) LocalType(&manager, &UpdateManager::RemoveScene, &scene);
1037 inline void AddPropertyNotificationMessage(UpdateManager& manager, OwnerPointer<PropertyNotification>& propertyNotification)
1039 // Message has ownership of PropertyNotification while in transit from event -> update
1040 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyNotification>>;
1042 // Reserve some memory inside the message queue
1043 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1045 // Construct message in the message queue memory; note that delete should not be called on the return value
1046 new(slot) LocalType(&manager, &UpdateManager::AddPropertyNotification, propertyNotification);
1049 inline void RemovePropertyNotificationMessage(UpdateManager& manager, const PropertyNotification& constPropertyNotification)
1051 // The scene-graph thread owns this object so it can safely edit it.
1052 PropertyNotification& propertyNotification = const_cast<PropertyNotification&>(constPropertyNotification);
1054 using LocalType = MessageValue1<UpdateManager, PropertyNotification*>;
1056 // Reserve some memory inside the message queue
1057 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1059 // Construct message in the message queue memory; note that delete should not be called on the return value
1060 new(slot) LocalType(&manager, &UpdateManager::RemovePropertyNotification, &propertyNotification);
1063 inline void PropertyNotificationSetNotifyModeMessage(UpdateManager& manager,
1064 const PropertyNotification* constPropertyNotification,
1065 PropertyNotification::NotifyMode notifyMode)
1067 // The scene-graph thread owns this object so it can safely edit it.
1068 PropertyNotification* propertyNotification = const_cast<PropertyNotification*>(constPropertyNotification);
1070 using LocalType = MessageValue2<UpdateManager, PropertyNotification*, PropertyNotification::NotifyMode>;
1072 // Reserve some memory inside the message queue
1073 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1075 // Construct message in the message queue memory; note that delete should not be called on the return value
1076 new(slot) LocalType(&manager, &UpdateManager::PropertyNotificationSetNotify, propertyNotification, notifyMode);
1079 // The render thread can safely change the Shader
1080 inline void AddShaderMessage(UpdateManager& manager, OwnerPointer<Shader>& shader)
1082 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Shader>>;
1084 // Reserve some memory inside the message queue
1085 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1087 // Construct message in the message queue memory; note that delete should not be called on the return value
1088 new(slot) LocalType(&manager, &UpdateManager::AddShader, shader);
1091 // The render thread can safely change the Shader
1092 inline void RemoveShaderMessage(UpdateManager& manager, const Shader* shader)
1094 using LocalType = MessageValue1<UpdateManager, Shader*>;
1096 // Reserve some memory inside the message queue
1097 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1099 // Construct message in the message queue memory; note that delete should not be called on the return value
1100 new(slot) LocalType(&manager, &UpdateManager::RemoveShader, const_cast<Shader*>(shader));
1103 inline void SurfaceReplacedMessage(UpdateManager& manager, const SceneGraph::Scene& constScene)
1105 // The scene-graph thread owns this object so it can safely edit it.
1106 Scene& scene = const_cast<Scene&>(constScene);
1108 using LocalType = MessageValue1<UpdateManager, Scene*>;
1110 // Reserve some memory inside the message queue
1111 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1113 // Construct message in the message queue memory; note that delete should not be called on the return value
1114 new(slot) LocalType(&manager, &UpdateManager::SurfaceReplaced, &scene);
1117 inline void KeepRenderingMessage(UpdateManager& manager, float durationSeconds)
1119 using LocalType = MessageValue1<UpdateManager, float>;
1121 // Reserve some memory inside the message queue
1122 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1124 // Construct message in the message queue memory; note that delete should not be called on the return value
1125 new(slot) LocalType(&manager, &UpdateManager::KeepRendering, durationSeconds);
1128 inline void SetRenderingBehaviorMessage(UpdateManager& manager, DevelStage::Rendering renderingBehavior)
1130 using LocalType = MessageValue1<UpdateManager, DevelStage::Rendering>;
1132 // Reserve some memory inside the message queue
1133 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1135 // Construct message in the message queue memory; note that delete should not be called on the return value
1136 new(slot) LocalType(&manager, &UpdateManager::SetRenderingBehavior, renderingBehavior);
1139 inline void RequestRenderingMessage(UpdateManager& manager)
1141 using LocalType = Message<UpdateManager>;
1143 // Reserve some memory inside the message queue
1144 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1146 // Construct message in the message queue memory; note that delete should not be called on the return value
1147 new(slot) LocalType(&manager, &UpdateManager::RequestRendering);
1151 * Create a message for setting the depth of a layer
1152 * @param[in] manager The update manager
1153 * @param[in] layers list of layers
1154 * @param[in] rootLayer The rool layer
1156 inline void SetLayerDepthsMessage(UpdateManager& manager, const std::vector<Layer*>& layers, const Layer* rootLayer)
1158 using LocalType = MessageValue2<UpdateManager, std::vector<Layer*>, const Layer*>;
1160 // Reserve some memory inside the message queue
1161 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1163 // Construct message in the message queue memory; note that delete should not be called on the return value
1164 new(slot) LocalType(&manager, &UpdateManager::SetLayerDepths, layers, rootLayer);
1167 inline void AddRendererMessage(UpdateManager& manager, const RendererKey& rendererKey)
1169 using LocalType = MessageValue1<UpdateManager, RendererKey>;
1171 // Reserve some memory inside the message queue
1172 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1173 // Construct message in the message queue memory; note that delete should not be called on the return value
1174 new(slot) LocalType(&manager, &UpdateManager::AddRenderer, rendererKey);
1177 inline void RemoveRendererMessage(UpdateManager& manager, const RendererKey& rendererKey)
1179 using LocalType = MessageValue1<UpdateManager, RendererKey>;
1181 // Reserve some memory inside the message queue
1182 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1183 // Construct message in the message queue memory; note that delete should not be called on the return value
1184 new(slot) LocalType(&manager, &UpdateManager::RemoveRenderer, rendererKey);
1187 inline void AttachRendererMessage(UpdateManager& manager, const Node& node, const Renderer& renderer)
1189 using LocalType = MessageValue2<UpdateManager, Node*, Renderer*>;
1191 // Reserve some memory inside the message queue
1192 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1193 // Construct message in the message queue memory; note that delete should not be called on the return value
1194 new(slot) LocalType(&manager, &UpdateManager::AttachRenderer, const_cast<Node*>(&node), const_cast<Renderer*>(&renderer));
1197 // The render thread can safely change the Shader
1198 inline void AddTextureSetMessage(UpdateManager& manager, OwnerPointer<TextureSet>& textureSet)
1200 using LocalType = MessageValue1<UpdateManager, OwnerPointer<TextureSet>>;
1202 // Reserve some memory inside the message queue
1203 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1205 // Construct message in the message queue memory; note that delete should not be called on the return value
1206 new(slot) LocalType(&manager, &UpdateManager::AddTextureSet, textureSet);
1209 // The render thread can safely change the Shader
1210 inline void RemoveTextureSetMessage(UpdateManager& manager, TextureSet& textureSet)
1212 using LocalType = MessageValue1<UpdateManager, TextureSet*>;
1214 // Reserve some memory inside the message queue
1215 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1217 // Construct message in the message queue memory; note that delete should not be called on the return value
1218 new(slot) LocalType(&manager, &UpdateManager::RemoveTextureSet, &textureSet);
1221 inline void AddSamplerMessage(UpdateManager& manager, OwnerPointer<Render::Sampler>& sampler)
1223 // Message has ownership of Sampler while in transit from event -> update
1224 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Sampler>>;
1226 // Reserve some memory inside the message queue
1227 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1229 // Construct message in the message queue memory; note that delete should not be called on the return value
1230 new(slot) LocalType(&manager, &UpdateManager::AddSampler, sampler);
1233 inline void RemoveSamplerMessage(UpdateManager& manager, Render::Sampler& sampler)
1235 using LocalType = MessageValue1<UpdateManager, Render::Sampler*>;
1237 // Reserve some memory inside the message queue
1238 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1240 // Construct message in the message queue memory; note that delete should not be called on the return value
1241 new(slot) LocalType(&manager, &UpdateManager::RemoveSampler, &sampler);
1244 inline void SetFilterModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t minFilterMode, uint32_t magFilterMode)
1246 using LocalType = MessageValue3<UpdateManager, Render::Sampler*, uint32_t, uint32_t>;
1248 // Reserve some memory inside the message queue
1249 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1251 // Construct message in the message queue memory; note that delete should not be called on the return value
1252 new(slot) LocalType(&manager, &UpdateManager::SetFilterMode, &sampler, minFilterMode, magFilterMode);
1255 inline void SetWrapModeMessage(UpdateManager& manager, Render::Sampler& sampler, uint32_t rWrapMode, uint32_t sWrapMode, uint32_t tWrapMode)
1257 using LocalType = MessageValue4<UpdateManager, Render::Sampler*, uint32_t, uint32_t, uint32_t>;
1259 // Reserve some memory inside the message queue
1260 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1262 // Construct message in the message queue memory; note that delete should not be called on the return value
1263 new(slot) LocalType(&manager, &UpdateManager::SetWrapMode, &sampler, rWrapMode, sWrapMode, tWrapMode);
1266 inline void AddVertexBuffer(UpdateManager& manager, OwnerPointer<Render::VertexBuffer>& vertexBuffer)
1268 // Message has ownership of vertexBuffer while in transit from event -> update
1269 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::VertexBuffer>>;
1271 // Reserve some memory inside the message queue
1272 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1274 // Construct message in the message queue memory; note that delete should not be called on the return value
1275 new(slot) LocalType(&manager, &UpdateManager::AddVertexBuffer, vertexBuffer);
1278 inline void RemoveVertexBuffer(UpdateManager& manager, Render::VertexBuffer& vertexBuffer)
1280 using LocalType = MessageValue1<UpdateManager, Render::VertexBuffer*>;
1282 // Reserve some memory inside the message queue
1283 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1285 // Construct message in the message queue memory; note that delete should not be called on the return value
1286 new(slot) LocalType(&manager, &UpdateManager::RemoveVertexBuffer, &vertexBuffer);
1289 inline void SetVertexBufferFormat(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Render::VertexBuffer::Format>& format)
1291 // Message has ownership of VertexBuffer::Format while in transit from event -> update
1292 using LocalType = MessageValue2<UpdateManager, Render::VertexBuffer*, OwnerPointer<Render::VertexBuffer::Format>>;
1294 // Reserve some memory inside the message queue
1295 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1297 // Construct message in the message queue memory; note that delete should not be called on the return value
1298 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferFormat, &vertexBuffer, format);
1301 inline void SetVertexBufferData(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, OwnerPointer<Vector<uint8_t>>& data, uint32_t size)
1303 // Message has ownership of VertexBuffer data while in transit from event -> update
1304 using LocalType = MessageValue3<UpdateManager, Render::VertexBuffer*, OwnerPointer<Vector<uint8_t>>, uint32_t>;
1306 // Reserve some memory inside the message queue
1307 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1309 // Construct message in the message queue memory; note that delete should not be called on the return value
1310 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferData, &vertexBuffer, data, size);
1313 inline void SetVertexBufferDivisorMessage(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, uint32_t divisor)
1315 using LocalType = MessageValue2<UpdateManager, Render::VertexBuffer*, uint32_t>;
1316 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1317 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferDivisor, &vertexBuffer, divisor);
1320 inline void SetVertexBufferUpdateCallbackMessage(UpdateManager& manager, Render::VertexBuffer& vertexBuffer, Dali::VertexBufferUpdateCallback* callback)
1322 // Message has ownership of VertexBuffer data while in transit from event -> update
1323 using LocalType = MessageValue2<UpdateManager, Render::VertexBuffer*, Dali::VertexBufferUpdateCallback*>;
1325 // Reserve some memory inside the message queue
1326 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1328 // Construct message in the message queue memory; note that delete should not be called on the return value
1329 new(slot) LocalType(&manager, &UpdateManager::SetVertexBufferUpdateCallback, &vertexBuffer, callback);
1332 inline void AddGeometry(UpdateManager& manager, OwnerPointer<Render::Geometry>& geometry)
1334 // Message has ownership of Geometry while in transit from event -> update
1335 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::Geometry>>;
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::AddGeometry, geometry);
1344 inline void RemoveGeometry(UpdateManager& manager, Render::Geometry& geometry)
1346 using LocalType = MessageValue1<UpdateManager, Render::Geometry*>;
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::RemoveGeometry, &geometry);
1355 inline void AttachVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1357 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
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::AttachVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1366 inline void RemoveVertexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, const Render::VertexBuffer& vertexBuffer)
1368 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, Render::VertexBuffer*>;
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::RemoveVertexBuffer, &geometry, const_cast<Render::VertexBuffer*>(&vertexBuffer));
1377 // Custom message type for SetIndexBuffer() used to move data with Vector::Swap()
1378 template<typename T, typename IndexContainerType>
1379 class IndexBufferMessage : public MessageBase
1383 * Constructor which does a Vector::Swap()
1385 IndexBufferMessage(T* manager, Render::Geometry* geometry, IndexContainerType& indices)
1388 mRenderGeometry(geometry)
1390 mIndices.Swap(indices);
1394 * Virtual destructor
1396 ~IndexBufferMessage() override = default;
1399 * @copydoc MessageBase::Process
1401 void Process(BufferIndex /*bufferIndex*/) override
1403 DALI_ASSERT_DEBUG(mManager && "Message does not have an object");
1404 mManager->SetIndexBuffer(mRenderGeometry, mIndices);
1409 Render::Geometry* mRenderGeometry;
1410 IndexContainerType mIndices;
1413 inline void SetIndexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, Render::Geometry::Uint16ContainerType& indices)
1415 using LocalType = IndexBufferMessage<UpdateManager, Render::Geometry::Uint16ContainerType>;
1417 // Reserve some memory inside the message queue
1418 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1420 // Construct message in the message queue memory; note that delete should not be called on the return value
1421 new(slot) LocalType(&manager, &geometry, indices);
1424 inline void SetIndexBufferMessage(UpdateManager& manager, Render::Geometry& geometry, Render::Geometry::Uint32ContainerType& indices)
1426 using LocalType = IndexBufferMessage<UpdateManager, Render::Geometry::Uint32ContainerType>;
1428 // Reserve some memory inside the message queue
1429 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1431 // Construct message in the message queue memory; note that delete should not be called on the return value
1432 new(slot) LocalType(&manager, &geometry, indices);
1435 inline void SetGeometryTypeMessage(UpdateManager& manager, Render::Geometry& geometry, uint32_t geometryType)
1437 using LocalType = MessageValue2<UpdateManager, Render::Geometry*, uint32_t>;
1439 // Reserve some memory inside the message queue
1440 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1442 // Construct message in the message queue memory; note that delete should not be called on the return value
1443 new(slot) LocalType(&manager, &UpdateManager::SetGeometryType, &geometry, geometryType);
1446 inline void AddTextureMessage(UpdateManager& manager, const Render::TextureKey& texture)
1448 using LocalType = MessageValue1<UpdateManager, Render::TextureKey>;
1450 // Reserve some memory inside the message queue
1451 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1453 // Construct message in the message queue memory; note that delete should not be called on the return value
1454 new(slot) LocalType(&manager, &UpdateManager::AddTexture, texture);
1457 inline void RemoveTextureMessage(UpdateManager& manager, const Render::TextureKey& texture)
1459 using LocalType = MessageValue1<UpdateManager, Render::TextureKey>;
1461 // Reserve some memory inside the message queue
1462 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1464 // Construct message in the message queue memory; note that delete should not be called on the return value
1465 new(slot) LocalType(&manager, &UpdateManager::RemoveTexture, texture);
1468 inline void UploadTextureMessage(UpdateManager& manager, Render::TextureKey texture, PixelDataPtr pixelData, const Graphics::UploadParams& params)
1470 using LocalType = MessageValue3<UpdateManager, Render::TextureKey, PixelDataPtr, Graphics::UploadParams>;
1472 // Reserve some memory inside the message queue
1473 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1475 // Construct message in the message queue memory; note that delete should not be called on the return value
1476 new(slot) LocalType(&manager, &UpdateManager::UploadTexture, texture, pixelData, params);
1479 inline void GenerateMipmapsMessage(UpdateManager& manager, Render::TextureKey texture)
1481 using LocalType = MessageValue1<UpdateManager, Render::TextureKey>;
1483 // Reserve some memory inside the message queue
1484 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1486 // Construct message in the message queue memory; note that delete should not be called on the return value
1487 new(slot) LocalType(&manager, &UpdateManager::GenerateMipmaps, texture);
1490 inline void SetTextureSizeMessage(UpdateManager& manager, Render::TextureKey texture, const Dali::ImageDimensions& size)
1492 using LocalType = MessageValue2<UpdateManager, Render::TextureKey, Dali::ImageDimensions>;
1494 // Reserve some memory inside the message queue
1495 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1497 // Construct message in the message queue memory; note that delete should not be called on the return value
1498 new(slot) LocalType(&manager, &UpdateManager::SetTextureSize, texture, size);
1501 inline void SetTextureFormatMessage(UpdateManager& manager, Render::TextureKey texture, Dali::Pixel::Format pixelFormat)
1503 using LocalType = MessageValue2<UpdateManager, Render::TextureKey, Dali::Pixel::Format>;
1505 // Reserve some memory inside the message queue
1506 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1508 // Construct message in the message queue memory; note that delete should not be called on the return value
1509 new(slot) LocalType(&manager, &UpdateManager::SetTextureFormat, texture, pixelFormat);
1512 inline void AddFrameBuffer(UpdateManager& manager, OwnerPointer<Render::FrameBuffer>& frameBuffer)
1514 using LocalType = MessageValue1<UpdateManager, OwnerPointer<Render::FrameBuffer>>;
1516 // Reserve some memory inside the message queue
1517 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1519 // Construct message in the message queue memory; note that delete should not be called on the return value
1520 new(slot) LocalType(&manager, &UpdateManager::AddFrameBuffer, frameBuffer);
1523 inline void RemoveFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer)
1525 using LocalType = MessageValue1<UpdateManager, Render::FrameBuffer*>;
1527 // Reserve some memory inside the message queue
1528 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1530 // Construct message in the message queue memory; note that delete should not be called on the return value
1531 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameBuffer, &frameBuffer);
1534 inline void AttachColorTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel, uint32_t layer)
1536 using LocalType = MessageValue4<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t, uint32_t>;
1538 // Reserve some memory inside the message queue
1539 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1541 // Construct message in the message queue memory; note that delete should not be called on the return value
1542 new(slot) LocalType(&manager, &UpdateManager::AttachColorTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel, layer);
1545 inline void AttachDepthTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1547 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1549 // Reserve some memory inside the message queue
1550 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1552 // Construct message in the message queue memory; note that delete should not be called on the return value
1553 new(slot) LocalType(&manager, &UpdateManager::AttachDepthTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1556 inline void AttachDepthStencilTextureToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, Render::Texture* texture, uint32_t mipmapLevel)
1558 using LocalType = MessageValue3<UpdateManager, Render::FrameBuffer*, Render::Texture*, uint32_t>;
1560 // Reserve some memory inside the message queue
1561 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1563 // Construct message in the message queue memory; note that delete should not be called on the return value
1564 new(slot) LocalType(&manager, &UpdateManager::AttachDepthStencilTextureToFrameBuffer, &frameBuffer, texture, mipmapLevel);
1567 inline void SetMultiSamplingLevelToFrameBuffer(UpdateManager& manager, Render::FrameBuffer& frameBuffer, uint8_t multiSamplingLevel)
1569 using LocalType = MessageValue2<UpdateManager, Render::FrameBuffer*, uint8_t>;
1571 // Reserve some memory inside the message queue
1572 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1574 // Construct message in the message queue memory; note that delete should not be called on the return value
1575 new(slot) LocalType(&manager, &UpdateManager::SetMultiSamplingLevelToFrameBuffer, &frameBuffer, multiSamplingLevel);
1578 inline void SetDepthIndicesMessage(UpdateManager& manager, OwnerPointer<NodeDepths>& nodeDepths)
1580 using LocalType = MessageValue1<UpdateManager, OwnerPointer<NodeDepths>>;
1582 // Reserve some memory inside the message queue
1583 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1585 // Construct message in the message queue memory; note that delete should not be called on the return value
1586 new(slot) LocalType(&manager, &UpdateManager::SetDepthIndices, nodeDepths);
1589 inline void AddResetterMessage(UpdateManager& manager, OwnerPointer<PropertyResetterBase> resetter)
1591 using LocalType = MessageValue1<UpdateManager, OwnerPointer<PropertyResetterBase>>;
1593 // Reserve some memory inside the message queue
1594 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1596 // Construct message in the message queue memory; note that delete should not be called on the return value
1597 new(slot) LocalType(&manager, &UpdateManager::AddPropertyResetter, resetter);
1600 inline void AddFrameCallbackMessage(UpdateManager& manager, OwnerPointer<FrameCallback>& frameCallback, const Node& rootNode)
1602 using LocalType = MessageValue2<UpdateManager, OwnerPointer<FrameCallback>, const Node*>;
1604 // Reserve some memory inside the message queue
1605 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1607 // Construct message in the message queue memory; note that delete should not be called on the return value
1608 new(slot) LocalType(&manager, &UpdateManager::AddFrameCallback, frameCallback, &rootNode);
1611 inline void RemoveFrameCallbackMessage(UpdateManager& manager, FrameCallbackInterface& frameCallback)
1613 using LocalType = MessageValue1<UpdateManager, FrameCallbackInterface*>;
1615 // Reserve some memory inside the message queue
1616 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1618 // Construct message in the message queue memory; note that delete should not be called on the return value
1619 new(slot) LocalType(&manager, &UpdateManager::RemoveFrameCallback, &frameCallback);
1622 inline void NotifyFrameCallbackMessage(UpdateManager& manager, FrameCallbackInterface* frameCallback, Dali::UpdateProxy::NotifySyncPoint syncPoint)
1624 using LocalType = MessageValue2<UpdateManager, FrameCallbackInterface*, Dali::UpdateProxy::NotifySyncPoint>;
1625 uint32_t* slot = manager.ReserveMessageSlot(sizeof(LocalType));
1626 new(slot) LocalType(&manager, &UpdateManager::NotifyFrameCallback, frameCallback, syncPoint);
1629 } // namespace SceneGraph
1631 } // namespace Internal
1635 #endif // DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H