[Tizen] Fix to do not update state of render task in case of uploadOnly 97/273497/4 accepted/tizen/6.0/unified/20220408.080152 submit/tizen_6.0/20220408.024131
authorseungho <sbsh.baek@samsung.com>
Wed, 6 Apr 2022 10:36:52 +0000 (19:36 +0900)
committerseungho <sbsh.baek@samsung.com>
Fri, 8 Apr 2022 02:16:45 +0000 (11:16 +0900)
Change-Id: I0fc24207ef7ea36ad5f04b0debfeb920d986f18e
Signed-off-by: seungho <sbsh.baek@samsung.com>
automated-tests/src/dali/dali-test-suite-utils/test-application.cpp
dali/integration-api/core.cpp
dali/integration-api/core.h
dali/internal/common/core-impl.cpp
dali/internal/common/core-impl.h
dali/internal/update/manager/update-manager.cpp
dali/internal/update/manager/update-manager.h

index 062276a..14052fe 100644 (file)
@@ -179,7 +179,7 @@ void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* locati
   uint32_t nextVSyncTime  = mLastVSyncTime + intervalMilliseconds;
   float    elapsedSeconds = static_cast<float>(intervalMilliseconds) * 0.001f;
 
-  mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false);
+  mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false, false);
 
   GetRenderController().Initialize();
 
index 83cfedf..4172171 100644 (file)
@@ -106,9 +106,9 @@ uint32_t Core::GetMaximumUpdateCount() const
   return mImpl->GetMaximumUpdateCount();
 }
 
-void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo)
+void Core::Update(float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly)
 {
-  mImpl->Update(elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo);
+  mImpl->Update(elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status, renderToFboEnabled, isRenderingToFbo, uploadOnly);
 }
 
 void Core::PreRender(RenderStatus& status, bool forceClear, bool uploadOnly)
index 97ebcef..e11784d 100644 (file)
@@ -337,13 +337,15 @@ public:
    * whether a Notification event should be sent, regardless of whether the multi-threading is used.
    * @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.
    */
   void Update(float         elapsedSeconds,
               uint32_t      lastVSyncTimeMilliseconds,
               uint32_t      nextVSyncTimeMilliseconds,
               UpdateStatus& status,
               bool          renderToFboEnabled,
-              bool          isRenderingToFbo);
+              bool          isRenderingToFbo,
+              bool          uploadOnly);
 
   /**
    * This is called before rendering any scene in the next frame. This method should be preceded
index b3b953f..99082e8 100644 (file)
@@ -193,7 +193,7 @@ void Core::ContextDestroyed()
   mRenderManager->ContextDestroyed();
 }
 
-void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo )
+void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly )
 {
   // set the time delta so adaptor can easily print FPS with a release build with 0 as
   // it is cached by frametime
@@ -205,7 +205,8 @@ void Core::Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uin
                                                 lastVSyncTimeMilliseconds,
                                                 nextVSyncTimeMilliseconds,
                                                 renderToFboEnabled,
-                                                isRenderingToFbo );
+                                                isRenderingToFbo,
+                                                uploadOnly );
 
   // Check the Notification Manager message queue to set needsNotification
   status.needsNotification = mNotificationManager->MessagesToProcess();
index 1e72470..622f02c 100644 (file)
@@ -127,7 +127,7 @@ public:
   /**
    * @copydoc Dali::Integration::Core::Update()
    */
-  void Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo );
+  void Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo, bool uploadOnly );
 
   /**
    * @copydoc Dali::Integration::Core::PreRender()
index 5fe5c44..02880a2 100644 (file)
@@ -877,7 +877,8 @@ uint32_t UpdateManager::Update( float elapsedSeconds,
                                 uint32_t lastVSyncTimeMilliseconds,
                                 uint32_t nextVSyncTimeMilliseconds,
                                 bool renderToFboEnabled,
-                                bool isRenderingToFbo )
+                                bool isRenderingToFbo,
+                                bool uploadOnly )
 {
   const BufferIndex bufferIndex = mSceneGraphBuffers.GetUpdateBufferIndex();
 
@@ -982,7 +983,6 @@ uint32_t UpdateManager::Update( float elapsedSeconds,
         }
       }
 
-
       std::size_t numberOfRenderInstructions = 0;
       for ( auto&& scene : mImpl->scenes )
       {
@@ -1009,36 +1009,39 @@ uint32_t UpdateManager::Update( float elapsedSeconds,
     }
   }
 
-  for ( auto&& scene : mImpl->scenes )
+  if(!uploadOnly)
   {
-    if ( scene && scene->root && scene->taskList )
+    for(auto&& scene : mImpl->scenes)
     {
-      RenderTaskList::RenderTaskContainer& tasks = scene->taskList->GetTasks();
-
-      // check the countdown and notify
-      bool doRenderOnceNotify = false;
-      mImpl->renderTaskWaiting = false;
-      for ( auto&& renderTask : tasks )
+      if(scene && scene->root && scene->taskList)
       {
-        renderTask->UpdateState();
+        RenderTaskList::RenderTaskContainer& tasks = scene->taskList->GetTasks();
 
-        if( renderTask->IsWaitingToRender() &&
-            renderTask->ReadyToRender( bufferIndex ) /*avoid updating forever when source actor is off-stage*/ )
+        // check the countdown and notify
+        bool doRenderOnceNotify  = false;
+        mImpl->renderTaskWaiting = false;
+        for(auto&& renderTask : tasks)
         {
-          mImpl->renderTaskWaiting = true; // keep update/render threads alive
+          renderTask->UpdateState();
+
+          if(renderTask->IsWaitingToRender() &&
+             renderTask->ReadyToRender(bufferIndex) /*avoid updating forever when source actor is off-stage*/)
+          {
+            mImpl->renderTaskWaiting = true; // keep update/render threads alive
+          }
+
+          if(renderTask->HasRendered())
+          {
+            doRenderOnceNotify = true;
+          }
         }
 
-        if( renderTask->HasRendered() )
+        if(doRenderOnceNotify)
         {
-          doRenderOnceNotify = true;
+          DALI_LOG_INFO(gRenderTaskLogFilter, Debug::General, "Notify a render task has finished\n");
+          mImpl->notificationManager.QueueCompleteNotification(scene->taskList->GetCompleteNotificationInterface());
         }
       }
-
-      if( doRenderOnceNotify )
-      {
-        DALI_LOG_INFO(gRenderTaskLogFilter, Debug::General, "Notify a render task has finished\n");
-        mImpl->notificationManager.QueueCompleteNotification( scene->taskList->GetCompleteNotificationInterface() );
-      }
     }
   }
 
index 0417ff3..277efa0 100644 (file)
@@ -625,13 +625,15 @@ public:
    * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
    * @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.
    * @return True if further updates are required e.g. during animations.
    */
   uint32_t Update( float elapsedSeconds,
                    uint32_t lastVSyncTimeMilliseconds,
                    uint32_t nextVSyncTimeMilliseconds,
                    bool renderToFboEnabled,
-                   bool isRenderingToFbo );
+                   bool isRenderingToFbo,
+                   bool uploadOnly );
 
   /**
    * Set the default surface rect.