Ensure that RenderScene actually renders something. 75/321475/1
authorDavid Steele <david.steele@samsung.com>
Fri, 21 Mar 2025 17:02:08 +0000 (17:02 +0000)
committerDavid Steele <david.steele@samsung.com>
Fri, 21 Mar 2025 17:02:08 +0000 (17:02 +0000)
RenderScene should only get called if there is something to
present and nothing prevents a renderer being drawn.

The only early-out that's allowed now is null scene handle.

ClearScene will only get called if RenderScene did not present
when we expected it to have actually drawn something.

If there are no renderers, but we set the background color of
the window; currently, FullSwapNextFrame is set. If this is not
desired behaviour, it should be changed in
SceneHolder::SetBackgroundColor.

Change-Id: I549d2fd5a25f6a182d89c8c2cc5abfaa07f985c6
Signed-off-by: David Steele <david.steele@samsung.com>
dali/internal/adaptor/common/combined-update-render-controller.cpp

index 1fdfa0d671b64b01314af26d6c081b7b90942391..6e18e73b42ee57ed6f638d39a707873b1f7f00cf 100644 (file)
@@ -865,6 +865,17 @@ void CombinedUpdateRenderController::UpdateRenderThread()
           bool willRender = mCore.PreRender(scene, mDamagedRects); // willRender is set if there are any render instructions with renderables
           bool fullSwap   = windowSurface->GetFullSwapNextFrame(); // true on Resize|set bg color
 
+          Rect<int> clippingRect; // Empty for fbo rendering
+
+          // Ensure surface can be drawn to; merge damaged areas for previous frames
+          windowSurface->PreRender(sceneSurfaceResized > 0u, mDamagedRects, clippingRect);
+          if(mEnvironmentOptions.PartialUpdateRequired() && clippingRect.IsEmpty())
+          {
+            DALI_LOG_INFO(gLogFilter, Debug::General, "PartialUpdate and no clip\n");
+            DALI_LOG_DEBUG_INFO("ClippingRect was empty. Skip rendering\n");
+            willRender = false;
+          }
+
           LOG_RENDER_SCENE("RenderThread: core.PreRender():%s  fullSwap:%s\n",
                            willRender ? "T" : "F",
                            fullSwap ? "T" : "F");
@@ -880,11 +891,6 @@ void CombinedUpdateRenderController::UpdateRenderThread()
           bool didRender = false;
           if(willRender)
           {
-            Rect<int> clippingRect; // Empty for fbo rendering
-
-            // Ensure surface can be drawn to; merge damaged areas for previous frames
-            windowSurface->PreRender(sceneSurfaceResized > 0u, mDamagedRects, clippingRect);
-
             LOG_RENDER_SCENE("RenderThread: core.RenderScene() Render the surface\n");
 
             // Render the surface (Present & SwapBuffers)