Merge "Seperate KeepRendering reason more detail" into devel/master
authorDavid Steele <david.steele@samsung.com>
Mon, 15 Apr 2024 10:49:51 +0000 (10:49 +0000)
committerGerrit Code Review <gerrit@review>
Mon, 15 Apr 2024 10:49:51 +0000 (10:49 +0000)
automated-tests/src/dali/utc-Dali-FrameCallbackInterface.cpp
automated-tests/src/dali/utc-Dali-Renderer.cpp
dali/integration-api/core.h
dali/internal/update/manager/update-manager.cpp

index 9de27be..dd95d0f 100644 (file)
@@ -301,12 +301,12 @@ public:
     mBakeColorCallSuccess                    = updateProxy.BakeColor(mActorId, vec4);
     mBakeScaleCallSuccess                    = updateProxy.BakeScale(mActorId, vec3);
 
-    mGetOrientationCallSuccess               = updateProxy.GetOrientation(mActorId, quat);
-    mSetOrientationCallSuccess               = updateProxy.SetOrientation(mActorId, quat);
-    mBakeOrientationCallSuccess              = updateProxy.BakeOrientation(mActorId, quat);
-    mGetWorldTransformCallSuccess            = updateProxy.GetWorldTransformAndSize(mActorId, vec3, vec3, quat, vec3);
-    mGetUpdateAreaCallSuccess                = updateProxy.GetUpdateArea(mActorId, vec4);
-    mSetUpdateAreaCallSuccess                = updateProxy.SetUpdateArea(mActorId, vec4);
+    mGetOrientationCallSuccess    = updateProxy.GetOrientation(mActorId, quat);
+    mSetOrientationCallSuccess    = updateProxy.SetOrientation(mActorId, quat);
+    mBakeOrientationCallSuccess   = updateProxy.BakeOrientation(mActorId, quat);
+    mGetWorldTransformCallSuccess = updateProxy.GetWorldTransformAndSize(mActorId, vec3, vec3, quat, vec3);
+    mGetUpdateAreaCallSuccess     = updateProxy.GetUpdateArea(mActorId, vec4);
+    mSetUpdateAreaCallSuccess     = updateProxy.SetUpdateArea(mActorId, vec4);
 
     return false;
   }
@@ -331,13 +331,13 @@ public:
     mBakeColorCallSuccess                    = false;
     mBakeScaleCallSuccess                    = false;
 
-    mSetOrientationCallSuccess               = false;
-    mGetOrientationCallSuccess               = false;
-    mBakeOrientationCallSuccess              = false;
+    mSetOrientationCallSuccess  = false;
+    mGetOrientationCallSuccess  = false;
+    mBakeOrientationCallSuccess = false;
 
-    mGetWorldTransformCallSuccess            = false;
-    mGetUpdateAreaCallSuccess                = false;
-    mSetUpdateAreaCallSuccess                = false;
+    mGetWorldTransformCallSuccess = false;
+    mGetUpdateAreaCallSuccess     = false;
+    mSetUpdateAreaCallSuccess     = false;
   }
 
   const uint32_t mActorId;
@@ -1118,7 +1118,7 @@ int UtcDaliFrameCallbackUpdateStatus(void)
   application.SendNotification();
   application.Render();
 
-  DALI_TEST_EQUALS(application.GetUpdateStatus(), Integration::KeepUpdating::STAGE_KEEP_RENDERING, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetUpdateStatus(), Integration::KeepUpdating::FRAME_UPDATE_CALLBACK, TEST_LOCATION);
 
   END_TEST;
 }
index 0b09348..14f607d 100644 (file)
@@ -3538,7 +3538,7 @@ int UtcDaliRendererRenderingBehavior(void)
 
   uint32_t updateStatus = application.GetUpdateStatus();
 
-  DALI_TEST_CHECK(!(updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING));
+  DALI_TEST_CHECK(!(updateStatus & (Integration::KeepUpdating::STAGE_KEEP_RENDERING | Integration::KeepUpdating::RENDERER_CONTINUOUSLY)));
 
   TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
   TraceCallStack&    drawTrace     = glAbstraction.GetDrawTrace();
@@ -3557,7 +3557,7 @@ int UtcDaliRendererRenderingBehavior(void)
 
   updateStatus = application.GetUpdateStatus();
 
-  DALI_TEST_CHECK(updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING);
+  DALI_TEST_CHECK(updateStatus & Integration::KeepUpdating::RENDERER_CONTINUOUSLY);
 
   value = renderer.GetCurrentProperty(DevelRenderer::Property::RENDERING_BEHAVIOR);
   DALI_TEST_CHECK(value.Get(renderingBehavior));
@@ -3573,7 +3573,7 @@ int UtcDaliRendererRenderingBehavior(void)
 
   updateStatus = application.GetUpdateStatus();
 
-  DALI_TEST_CHECK(updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING);
+  DALI_TEST_CHECK(updateStatus & Integration::KeepUpdating::RENDERER_CONTINUOUSLY);
 
   DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION);
 
@@ -3597,7 +3597,7 @@ int UtcDaliRendererRenderingBehavior(void)
 
     updateStatus = application.GetUpdateStatus();
 
-    DALI_TEST_CHECK(updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING);
+    DALI_TEST_CHECK(updateStatus & Integration::KeepUpdating::RENDERER_CONTINUOUSLY);
 
     DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION);
   }
@@ -3611,7 +3611,7 @@ int UtcDaliRendererRenderingBehavior(void)
 
   updateStatus = application.GetUpdateStatus();
 
-  DALI_TEST_CHECK(!(updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING));
+  DALI_TEST_CHECK(!(updateStatus & (Integration::KeepUpdating::STAGE_KEEP_RENDERING | Integration::KeepUpdating::RENDERER_CONTINUOUSLY)));
 
   END_TEST;
 }
@@ -3701,7 +3701,7 @@ int UtcDaliRendererRenderAfterAddShader(void)
 
   uint32_t updateStatus = application.GetUpdateStatus();
 
-  DALI_TEST_CHECK(!(updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING));
+  DALI_TEST_CHECK(!(updateStatus & (Integration::KeepUpdating::STAGE_KEEP_RENDERING | Integration::KeepUpdating::RENDERER_CONTINUOUSLY)));
 
   // Update for several frames
   application.SendNotification();
@@ -3732,7 +3732,7 @@ int UtcDaliRendererRenderAfterAddShader(void)
 
   updateStatus = application.GetUpdateStatus();
 
-  DALI_TEST_CHECK(!(updateStatus & Integration::KeepUpdating::STAGE_KEEP_RENDERING));
+  DALI_TEST_CHECK(!(updateStatus & (Integration::KeepUpdating::STAGE_KEEP_RENDERING | Integration::KeepUpdating::RENDERER_CONTINUOUSLY)));
 
   DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION);
 
index c958522..d570f9b 100644 (file)
@@ -65,7 +65,9 @@ enum Reasons
   STAGE_KEEP_RENDERING   = 1 << 1, ///<  - Stage::KeepRendering() is being used
   ANIMATIONS_RUNNING     = 1 << 2, ///< - Animations are ongoing
   MONITORING_PERFORMANCE = 1 << 3, ///< - The --enable-performance-monitor option is being used
-  RENDER_TASK_SYNC       = 1 << 4  ///< - A render task is waiting for render sync
+  RENDER_TASK_SYNC       = 1 << 4, ///< - A render task is waiting for render sync
+  FRAME_UPDATE_CALLBACK  = 1 << 5, ///< - Some FrameUpdateCallback return true
+  RENDERER_CONTINUOUSLY  = 1 << 6  ///< - Some Renderer renderinb behaviour is continuously
 };
 }
 
index 7a971f5..e97fde8 100644 (file)
@@ -1024,9 +1024,8 @@ uint32_t UpdateManager::Update(float    elapsedSeconds,
     mImpl->frameCallbackProcessor ||                   // ..a frame callback processor is existed OR
     gestureUpdated;                                    // ..a gesture property was updated
 
-  uint32_t keepUpdating          = 0;
-  bool     keepRendererRendering = false;
-  mImpl->renderingRequired       = false;
+  uint32_t keepUpdating    = 0;
+  mImpl->renderingRequired = false;
 
   // Although the scene-graph may not require an update, we still need to synchronize double-buffered
   // values if the scene was updated in the previous frame.
@@ -1075,7 +1074,10 @@ uint32_t UpdateManager::Update(float    elapsedSeconds,
     // Call the frame-callback-processor if set
     if(mImpl->frameCallbackProcessor)
     {
-      keepRendererRendering |= mImpl->frameCallbackProcessor->Update(bufferIndex, elapsedSeconds);
+      if(mImpl->frameCallbackProcessor->Update(bufferIndex, elapsedSeconds))
+      {
+        keepUpdating |= KeepUpdating::FRAME_UPDATE_CALLBACK;
+      }
     }
 
     // Update node hierarchy, apply constraints,
@@ -1117,7 +1119,9 @@ uint32_t UpdateManager::Update(float    elapsedSeconds,
     if(mImpl->renderersAdded)
     {
       // Calculate how many render tasks we have in total
-      std::size_t numberOfRenderTasks = 0;
+      std::size_t numberOfRenderTasks        = 0;
+      std::size_t numberOfRenderInstructions = 0;
+      bool        renderContinuously         = false;
       for(auto&& scene : mImpl->scenes)
       {
         if(scene && scene->taskList)
@@ -1126,8 +1130,7 @@ uint32_t UpdateManager::Update(float    elapsedSeconds,
         }
       }
 
-      std::size_t numberOfRenderInstructions = 0;
-      mImpl->renderInstructionCapacity       = 0u;
+      mImpl->renderInstructionCapacity = 0u;
       for(auto&& scene : mImpl->scenes)
       {
         if(scene && scene->root && scene->taskList && scene->scene)
@@ -1146,13 +1149,13 @@ uint32_t UpdateManager::Update(float    elapsedSeconds,
           // or keep rendering is requested
           if(!isAnimationRunning || animationActive || mImpl->renderingRequired || (mImpl->nodeDirtyFlags & RenderableUpdateFlags) || sceneKeepUpdating)
           {
-            keepRendererRendering |= mImpl->renderTaskProcessor.Process(bufferIndex,
-                                                                        *scene->taskList,
-                                                                        *scene->root,
-                                                                        scene->sortedLayerList,
-                                                                        scene->scene->GetRenderInstructions(),
-                                                                        renderToFboEnabled,
-                                                                        isRenderingToFbo);
+            renderContinuously |= mImpl->renderTaskProcessor.Process(bufferIndex,
+                                                                     *scene->taskList,
+                                                                     *scene->root,
+                                                                     scene->sortedLayerList,
+                                                                     scene->scene->GetRenderInstructions(),
+                                                                     renderToFboEnabled,
+                                                                     isRenderingToFbo);
 
             mImpl->renderInstructionCapacity += scene->scene->GetRenderInstructions().GetCapacity();
             scene->scene->SetSkipRendering(false);
@@ -1166,6 +1169,11 @@ uint32_t UpdateManager::Update(float    elapsedSeconds,
         }
       }
 
+      if(renderContinuously)
+      {
+        keepUpdating |= KeepUpdating::RENDERER_CONTINUOUSLY;
+      }
+
       DALI_LOG_INFO(gLogFilter, Debug::General, "Update: numberOfRenderTasks(%d), Render Instructions(%d)\n", numberOfRenderTasks, numberOfRenderInstructions);
     }
   }
@@ -1217,12 +1225,7 @@ uint32_t UpdateManager::Update(float    elapsedSeconds,
   // Check whether further updates are required
   keepUpdating |= KeepUpdatingCheck(elapsedSeconds);
 
-  if(keepRendererRendering)
-  {
-    keepUpdating |= KeepUpdating::STAGE_KEEP_RENDERING;
-  }
-
-  if(keepUpdating & KeepUpdating::STAGE_KEEP_RENDERING)
+  if(keepUpdating & (KeepUpdating::STAGE_KEEP_RENDERING | KeepUpdating::FRAME_UPDATE_CALLBACK | KeepUpdating::RENDERER_CONTINUOUSLY))
   {
     // Set dirty flags for next frame to continue rendering
     mImpl->nodeDirtyFlags |= RenderableUpdateFlags;