Ensure render once after we set surface full swap 53/316053/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 13 Aug 2024 02:36:34 +0000 (11:36 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 13 Aug 2024 02:36:34 +0000 (11:36 +0900)
It is possible if event thread running too slow, the surface's full swap infomatin
might not be applied to update render thread.

For example : When OnIconifyChanged come, mAdaptor->Resume() called so
combined update render thread wake up.
But it is possible that window render surface's SetFullSwapNextFrame() not be called
until the end of render loop.
If then, the full scene rendering might be skiped after Adaptor resume finished.

To avoid this kind of issue, let we request update once when
SetFullSwapNextFrame() called after ProcessCoreEvents().

Change-Id: I40e738f6a7d56f1abd3e6d0dec37ad0de5a57994
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/window-system/common/window-impl.cpp

index 867abc6..59e4504 100644 (file)
@@ -587,6 +587,12 @@ void Window::Show()
 
   mSurface->SetFullSwapNextFrame();
 
+  // Need to update/render once if surface set full swaped after adaptor call ProcessCoreEvents().
+  if(DALI_LIKELY(mAdaptor))
+  {
+    mAdaptor->RequestUpdateOnce();
+  }
+
   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Show(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible);
 }
 
@@ -772,6 +778,12 @@ void Window::SetSize(Dali::Window::WindowSize size)
   }
 
   mSurface->SetFullSwapNextFrame();
+
+  // Need to update/render once if surface set full swaped after adaptor call ProcessCoreEvents().
+  if(DALI_LIKELY(mAdaptor))
+  {
+    mAdaptor->RequestUpdateOnce();
+  }
 }
 
 Dali::Window::WindowSize Window::GetSize() const
@@ -877,6 +889,12 @@ void Window::SetPositionSize(PositionSize positionSize)
   }
 
   mSurface->SetFullSwapNextFrame();
+
+  // Need to update/render once if surface set full swaped after adaptor call ProcessCoreEvents().
+  if(DALI_LIKELY(mAdaptor))
+  {
+    mAdaptor->RequestUpdateOnce();
+  }
 }
 
 void Window::SetLayout(unsigned int numCols, unsigned int numRows, unsigned int column, unsigned int row, unsigned int colSpan, unsigned int rowSpan)
@@ -994,6 +1012,12 @@ void Window::OnIconifyChanged(bool iconified)
   }
 
   mSurface->SetFullSwapNextFrame();
+
+  // Need to update/render once if surface set full swaped after adaptor call ProcessCoreEvents().
+  if(DALI_LIKELY(mAdaptor))
+  {
+    mAdaptor->RequestUpdateOnce();
+  }
 }
 
 void Window::OnMaximizeChanged(bool maximized)
@@ -1126,6 +1150,12 @@ void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize)
   }
 
   mSurface->SetFullSwapNextFrame();
+
+  // Need to update/render once if surface set full swaped after adaptor call ProcessCoreEvents().
+  if(DALI_LIKELY(mAdaptor))
+  {
+    mAdaptor->RequestUpdateOnce();
+  }
 }
 
 void Window::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
@@ -1223,6 +1253,12 @@ void Window::OnResume()
   }
 
   mSurface->SetFullSwapNextFrame();
+
+  // Need to update/render once if surface set full swaped after adaptor call ProcessCoreEvents().
+  if(DALI_LIKELY(mAdaptor))
+  {
+    mAdaptor->RequestUpdateOnce();
+  }
 }
 
 void Window::OnAuxiliaryMessage(const std::string& key, const std::string& value, const Property::Array& options)