Set RendererAdded value at UpdateStatus 39/321539/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Mon, 24 Mar 2025 04:39:26 +0000 (13:39 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 25 Mar 2025 02:05:59 +0000 (11:05 +0900)
Change-Id: Ia6dd039946ed952585beb8be54b908201acde0de
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/integration-api/core.h
dali/internal/common/core-impl.cpp
dali/internal/update/manager/update-manager.cpp
dali/internal/update/manager/update-manager.h

index 4c3070fdc76460b76d9afd23dc705f0d354b215f..4fbb1f183de8190f2c974aca64302420dff7afed 100644 (file)
@@ -83,6 +83,7 @@ public:
   UpdateStatus()
   : keepUpdating(false),
     needsNotification(false),
+    rendererAdded(false),
     secondsFromLastFrame(0.0f)
   {
   }
@@ -107,6 +108,15 @@ public:
     return needsNotification;
   }
 
+  /**
+   * Query whether the Core had added any renderer, or had never added renderer.
+   * @return True if an Core had added any renderer.
+   */
+  bool RendererAdded()
+  {
+    return rendererAdded;
+  }
+
   /**
    * This method is provided so that FPS can be easily calculated with a release version
    * of Core.
@@ -120,6 +130,7 @@ public:
 public:
   uint32_t keepUpdating; ///< A bitmask of KeepUpdating values
   bool     needsNotification;
+  bool     rendererAdded;
   float    secondsFromLastFrame;
 };
 
index 0d8bef354709febc9be31221dc800a9d6e733bfc..a364255aad95bba32389160f783ccd6e1b4e8f5d 100644 (file)
@@ -195,6 +195,7 @@ void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint
   // it is cached by frametime
   status.secondsFromLastFrame = elapsedSeconds;
 
+  static bool rendererAdded = false;
   // Render returns true when there are updates on the stage or one or more animations are completed.
   // Use the estimated time diff till we render as the elapsed time.
   status.keepUpdating = mUpdateManager->Update(elapsedSeconds,
@@ -202,7 +203,11 @@ void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint
                                                nextVSyncTimeMilliseconds,
                                                renderToFboEnabled,
                                                isRenderingToFbo,
-                                               uploadOnly);
+                                               uploadOnly,
+                                               rendererAdded);
+
+  // Get the value of renderer added from updateManager.
+  status.rendererAdded = rendererAdded;
 
   // Check the Notification Manager message queue to set needsNotification
   status.needsNotification = mNotificationManager->MessagesToProcess();
index cb1fc4f0d39e39d4e619ea2945404e2f1c51a83d..4aa3d794522f79327a2af35901eceb237fd7ec5d 100644 (file)
@@ -182,11 +182,11 @@ struct UpdateManager::Impl
     {
     }
 
-    ~SceneInfo()                               = default; ///< Default non-virtual destructor
-    SceneInfo(SceneInfo&& rhs)                 = default; ///< Move constructor
-    SceneInfo& operator=(SceneInfo&& rhs)      = default; ///< Move assignment operator
-    SceneInfo& operator=(const SceneInfo& rhs) = delete;  ///< Assignment operator
-    SceneInfo(const SceneInfo& rhs)            = delete;  ///< Copy constructor
+    ~SceneInfo()               = default;                ///< Default non-virtual destructor
+    SceneInfo(SceneInfo&& rhs) = default;                ///< Move constructor
+    SceneInfo& operator=(SceneInfo&& rhs) = default;     ///< Move assignment operator
+    SceneInfo& operator=(const SceneInfo& rhs) = delete; ///< Assignment operator
+    SceneInfo(const SceneInfo& rhs)            = delete; ///< Copy constructor
 
     Layer*                       root{nullptr};   ///< Root node (root is a layer). The layer is not stored in the node memory pool.
     OwnerPointer<RenderTaskList> taskList;        ///< Scene graph render task list
@@ -457,8 +457,7 @@ void UpdateManager::InstallRoot(OwnerPointer<Layer>& layer)
 
   Layer* rootLayer = layer.Release();
 
-  DALI_ASSERT_DEBUG(std::find_if(mImpl->scenes.begin(), mImpl->scenes.end(), [rootLayer](Impl::SceneInfoPtr& scene)
-                                 { return scene && scene->root == rootLayer; }) == mImpl->scenes.end() &&
+  DALI_ASSERT_DEBUG(std::find_if(mImpl->scenes.begin(), mImpl->scenes.end(), [rootLayer](Impl::SceneInfoPtr& scene) { return scene && scene->root == rootLayer; }) == mImpl->scenes.end() &&
                     "Root Node already installed");
 
   rootLayer->CreateTransform(&mImpl->transformManager);
@@ -981,8 +980,7 @@ bool UpdateManager::Animate(BufferIndex bufferIndex, float elapsedSeconds)
 
   auto&& iter = mImpl->animations.Begin();
 
-  DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_ANIMATION_ANIMATE", [&](std::ostringstream& oss)
-                                          { oss << "[" << mImpl->animations.Count() << "]"; });
+  DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_ANIMATION_ANIMATE", [&](std::ostringstream& oss) { oss << "[" << mImpl->animations.Count() << "]"; });
 
   while(iter != mImpl->animations.End())
   {
@@ -1033,8 +1031,7 @@ bool UpdateManager::Animate(BufferIndex bufferIndex, float elapsedSeconds)
     mImpl->notificationManager.QueueNotification(&mImpl->animationPlaylist, std::move(mImpl->notifyRequiredAnimations));
   }
 
-  DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_ANIMATION_ANIMATE", [&](std::ostringstream& oss)
-                                        { oss << "[" << mImpl->animations.Count() << "]"; });
+  DALI_TRACE_END_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_ANIMATION_ANIMATE", [&](std::ostringstream& oss) { oss << "[" << mImpl->animations.Count() << "]"; });
 
   return animationActive;
 }
@@ -1129,8 +1126,7 @@ void UpdateManager::UpdateRenderers(PropertyOwnerContainer& postPropertyOwners,
     return;
   }
 
-  DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_UPDATE_RENDERERS", [&](std::ostringstream& oss)
-                                          { oss << "[" << mImpl->renderers.Count() << "]"; });
+  DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_UPDATE_RENDERERS", [&](std::ostringstream& oss) { oss << "[" << mImpl->renderers.Count() << "]"; });
 
   for(const auto& rendererKey : mImpl->renderers)
   {
@@ -1182,7 +1178,8 @@ uint32_t UpdateManager::Update(float    elapsedSeconds,
                                uint32_t nextVSyncTimeMilliseconds,
                                bool     renderToFboEnabled,
                                bool     isRenderingToFbo,
-                               bool     uploadOnly)
+                               bool     uploadOnly,
+                               bool&    rendererAdded)
 {
   const BufferIndex bufferIndex = mSceneGraphBuffers.GetUpdateBufferIndex();
 
@@ -1230,8 +1227,7 @@ uint32_t UpdateManager::Update(float    elapsedSeconds,
   // We should not start skipping update steps or reusing lists until there has been two frames where nothing changes
   if(updateScene || mImpl->previousUpdateScene)
   {
-    DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_UPDATE_INTERNAL", [&](std::ostringstream& oss)
-                                            {
+    DALI_TRACE_BEGIN_WITH_MESSAGE_GENERATOR(gTraceFilter, "DALI_UPDATE_INTERNAL", [&](std::ostringstream& oss) {
       oss << "[n:" << mImpl->nodes.Size() << ",";
       oss << "c:" << mImpl->customObjects.Size() << ",";
       oss << "a:" << mImpl->animations.Size() << ",";
@@ -1308,6 +1304,7 @@ uint32_t UpdateManager::Update(float    elapsedSeconds,
     // reset the update buffer index and make sure there is enough room in the instruction container
     if(mImpl->renderersAdded)
     {
+      rendererAdded = true;
       // Calculate how many render tasks we have in total
       std::size_t numberOfRenderTasks        = 0;
       std::size_t numberOfRenderInstructions = 0;
@@ -1587,8 +1584,7 @@ void UpdateManager::SetDepthIndices(OwnerPointer<NodeDepths>& nodeDepths)
     {
       // Reorder children container only if sibiling order changed.
       NodeContainer& container = node->GetChildren();
-      std::sort(container.Begin(), container.End(), [](Node* a, Node* b)
-                { return a->GetDepthIndex() < b->GetDepthIndex(); });
+      std::sort(container.Begin(), container.End(), [](Node* a, Node* b) { return a->GetDepthIndex() < b->GetDepthIndex(); });
     }
   }
 }
index 60207915efce9ac6f125a8dc05f61423e7e1d741..c977e00619c71dde2d3278a7ac9e0273c9e40b73 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_UPDATE_MANAGER_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -673,6 +673,7 @@ public:
    * @param[in] renderToFboEnabled Whether rendering into the Frame Buffer Object is enabled.
    * @param[in] isRenderingToFbo   Whether this frame is being rendered into the Frame Buffer Object.
    * @param[in] uploadOnly uploadOnly Upload the resource only without rendering.
+   * @param[out] rendererAdded Whether at least one of renderer added to update manager, or not.
    * @return True if further updates are required e.g. during animations.
    */
   uint32_t Update(float    elapsedSeconds,
@@ -680,7 +681,8 @@ public:
                   uint32_t nextVSyncTimeMilliseconds,
                   bool     renderToFboEnabled,
                   bool     isRenderingToFbo,
-                  bool     uploadOnly);
+                  bool     uploadOnly,
+                  bool&    rendererAdded);
 
   /**
    * This is called after rendering all the scenes in the next frame.