Merge "Log patch to show the first five swapbuffers call after resume" into devel...
authorSeungho BAEK <sbsh.baek@samsung.com>
Thu, 19 Sep 2019 22:54:08 +0000 (22:54 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 19 Sep 2019 22:54:08 +0000 (22:54 +0000)
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/adaptor/common/combined-update-render-controller.h
dali/internal/adaptor/common/thread-controller-interface.h
dali/internal/system/common/thread-controller.cpp
dali/internal/system/common/thread-controller.h

index 338b71f..44b4964 100644 (file)
@@ -193,7 +193,7 @@ void TestApplication::DoUpdate( uint32_t intervalMilliseconds, const char* locat
 bool TestApplication::Render( uint32_t intervalMilliseconds, const char* location )
 {
   DoUpdate( intervalMilliseconds, location );
-  mCore->Render( mRenderStatus, false );
+  mCore->Render( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
 
   mFrame++;
 
@@ -219,7 +219,7 @@ bool TestApplication::GetRenderNeedsUpdate()
 bool TestApplication::RenderOnly( )
 {
   // Update Time values
-  mCore->Render( mRenderStatus, false );
+  mCore->Render( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
 
   mFrame++;
 
index 2c297e0..50d63ec 100755 (executable)
@@ -41,6 +41,7 @@
 #include <dali/internal/system/common/thread-controller.h>
 #include <dali/internal/system/common/performance-interface-factory.h>
 #include <dali/internal/adaptor/common/lifecycle-observer.h>
+#include <dali/internal/adaptor/common/thread-controller-interface.h>
 
 #include <dali/internal/graphics/gles/egl-graphics-factory.h>
 #include <dali/internal/graphics/gles/egl-graphics.h> // Temporary until Core is abstracted
@@ -889,11 +890,10 @@ void Adaptor::RequestUpdate( bool forceUpdate )
     case PAUSED:
     case PAUSED_WHILE_HIDDEN:
     {
-      // When Dali applications are partially visible behind the lock-screen,
-      // the indicator must be updated (therefore allow updates in the PAUSED state)
       if( forceUpdate )
       {
-        mThreadController->RequestUpdateOnce();
+        // Update (and resource upload) without rendering
+        mThreadController->RequestUpdateOnce( UpdateMode::SKIP_RENDER );
       }
       break;
     }
@@ -1064,7 +1064,7 @@ void Adaptor::RequestUpdateOnce()
 {
   if( mThreadController )
   {
-    mThreadController->RequestUpdateOnce();
+    mThreadController->RequestUpdateOnce( UpdateMode::NORMAL );
   }
 }
 
index 93f766f..f0a5e65 100644 (file)
@@ -115,7 +115,8 @@ CombinedUpdateRenderController::CombinedUpdateRenderController( AdaptorInternalS
   mDeletedSurface( nullptr ),
   mPostRendering( FALSE ),
   mSurfaceResized( FALSE ),
-  mForceClear( FALSE )
+  mForceClear( FALSE ),
+  mUploadWithoutRendering( FALSE )
 {
   LOG_EVENT_TRACE;
 
@@ -183,7 +184,7 @@ void CombinedUpdateRenderController::Start()
 
   LOG_EVENT( "Startup Complete, starting Update/Render Thread" );
 
-  RunUpdateRenderThread( CONTINUOUS, false /* No animation progression */ );
+  RunUpdateRenderThread( CONTINUOUS, AnimationProgression::NONE, UpdateMode::NORMAL );
 
   DALI_LOG_RELEASE_INFO( "CombinedUpdateRenderController::Start\n" );
 }
@@ -209,7 +210,7 @@ void CombinedUpdateRenderController::Resume()
   {
     LOG_EVENT( "Resuming" );
 
-    RunUpdateRenderThread( CONTINUOUS, true /* Animation progression required while we were paused */ );
+    RunUpdateRenderThread( CONTINUOUS, AnimationProgression::USE_ELAPSED_TIME, UpdateMode::NORMAL );
 
     AddPerformanceMarker( PerformanceInterface::RESUME );
 
@@ -267,14 +268,14 @@ void CombinedUpdateRenderController::RequestUpdate()
   {
     LOG_EVENT( "Processing" );
 
-    RunUpdateRenderThread( CONTINUOUS, false /* No animation progression */ );
+    RunUpdateRenderThread( CONTINUOUS, AnimationProgression::NONE, UpdateMode::NORMAL );
   }
 
   ConditionalWait::ScopedLock updateLock( mUpdateRenderThreadWaitCondition );
   mPendingRequestUpdate = TRUE;
 }
 
-void CombinedUpdateRenderController::RequestUpdateOnce()
+void CombinedUpdateRenderController::RequestUpdateOnce( UpdateMode updateMode )
 {
   // Increment the update-request count to the maximum
   if( mUpdateRequestCount < MAXIMUM_UPDATE_REQUESTS )
@@ -287,7 +288,7 @@ void CombinedUpdateRenderController::RequestUpdateOnce()
     LOG_EVENT_TRACE;
 
     // Run Update/Render once
-    RunUpdateRenderThread( ONCE, false /* No animation progression */ );
+    RunUpdateRenderThread( ONCE, AnimationProgression::NONE, updateMode );
   }
 }
 
@@ -382,12 +383,13 @@ void CombinedUpdateRenderController::SetPreRenderCallback( CallbackBase* callbac
 // EVENT THREAD
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-void CombinedUpdateRenderController::RunUpdateRenderThread( int numberOfCycles, bool useElapsedTime )
+void CombinedUpdateRenderController::RunUpdateRenderThread( int numberOfCycles, AnimationProgression animationProgression, UpdateMode updateMode )
 {
   ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
   mUpdateRenderRunCount = numberOfCycles;
   mUpdateRenderThreadCanSleep = FALSE;
-  mUseElapsedTimeAfterWait = useElapsedTime;
+  mUseElapsedTimeAfterWait = ( animationProgression == AnimationProgression::USE_ELAPSED_TIME );
+  mUploadWithoutRendering = ( updateMode == UpdateMode::SKIP_RENDER );
   LOG_COUNTER_EVENT( "mUpdateRenderRunCount: %d, mUseElapsedTimeAfterWait: %d", mUpdateRenderRunCount, mUseElapsedTimeAfterWait );
   mUpdateRenderThreadWaitCondition.Notify( lock );
 }
@@ -643,7 +645,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     Integration::RenderStatus renderStatus;
 
     AddPerformanceMarker( PerformanceInterface::RENDER_START );
-    mCore.Render( renderStatus, mForceClear );
+    mCore.Render( renderStatus, mForceClear, mUploadWithoutRendering );
 
     //////////////////////////////
     // DELETE SURFACE
index 41f519c..e83bacb 100644 (file)
@@ -119,7 +119,7 @@ public:
   /**
    * @copydoc ThreadControllerInterface::RequestUpdateOnce()
    */
-  virtual void RequestUpdateOnce();
+  virtual void RequestUpdateOnce( UpdateMode updateMode );
 
   /**
    * @copydoc ThreadControllerInterface::ReplaceSurface()
@@ -158,14 +158,21 @@ private:
   // EventThread
   /////////////////////////////////////////////////////////////////////////////////////////////////
 
+  enum AnimationProgression
+  {
+    USE_ELAPSED_TIME,          ///< Animation progression using elapsed time
+    NONE                       ///< No animation progression
+  };
+
   /**
    * Runs the Update/Render Thread.
    * This will lock the mutex in mUpdateRenderThreadWaitCondition.
    *
    * @param[in]  numberOfCycles           The number of times the update/render cycle should run. If -1, then it will run continuously.
-   * @param[in]  useElapsedTimeAfterWait  If true, then the elapsed time during wait is used for animations, otherwise no animation progression is made.
+   * @param[in]  animationProgression     Whether to progress animation using time elapsed since the last frame.
+   * @param[in]  updateMode               The update mode (i.e. either update & render or skip rendering)
    */
-  inline void RunUpdateRenderThread( int numberOfCycles, bool useElapsedTimeAfterWait );
+  inline void RunUpdateRenderThread( int numberOfCycles, AnimationProgression animationProgression, UpdateMode updateMode );
 
   /**
    * Pauses the Update/Render Thread.
@@ -361,6 +368,8 @@ private:
   volatile unsigned int             mPostRendering;                    ///< Whether post-rendering is taking place (set by the event & render threads, read by the render-thread).
   volatile unsigned int             mSurfaceResized;                   ///< Will be set to resize the surface (set by the event-thread, read & cleared by the update-render thread).
   volatile unsigned int             mForceClear;                       ///< Will be set to clear forcibly
+
+  volatile unsigned int             mUploadWithoutRendering;           ///< Will be set to upload the resource only (with no rendering)
 };
 
 } // namespace Adaptor
index 751dceb..8c63c7d 100644 (file)
@@ -31,6 +31,12 @@ namespace Internal
 namespace Adaptor
 {
 
+enum class UpdateMode
+{
+  NORMAL,                     ///< Update and render
+  SKIP_RENDER                 ///< Update and resource upload but no rendering
+};
+
 /**
  * Interface Class for all controlling threads.
  */
@@ -75,9 +81,10 @@ public:
 
   /**
    * Called by the adaptor when core requires one update
-   * If Adaptor is paused, we do one update and return to pause
+   * If Adaptor is paused, we do one update/render and return to pause
+   * @param updateMode The update mode (i.e. i.e. either update & render or skip rendering)
    */
-  virtual void RequestUpdateOnce() = 0;
+  virtual void RequestUpdateOnce( UpdateMode updateMode ) = 0;
 
   /**
    * Replaces the surface.
index ac7e49e..cd6671d 100644 (file)
@@ -80,9 +80,9 @@ void ThreadController::RequestUpdate()
   mThreadControllerInterface->RequestUpdate();
 }
 
-void ThreadController::RequestUpdateOnce()
+void ThreadController::RequestUpdateOnce(   UpdateMode updateMode )
 {
-  mThreadControllerInterface->RequestUpdateOnce();
+  mThreadControllerInterface->RequestUpdateOnce( updateMode );
 }
 
 void ThreadController::ReplaceSurface( Dali::RenderSurfaceInterface* newSurface )
index 4a7b81e..686c653 100644 (file)
@@ -33,6 +33,8 @@ namespace Internal
 namespace Adaptor
 {
 
+enum class UpdateMode;
+
 class AdaptorInternalServices;
 class EnvironmentOptions;
 class ThreadControllerInterface;
@@ -97,8 +99,10 @@ public:
    * @brief Called by the adaptor when core requires one update
    *
    * @note If Adaptor is paused, we do one update/render only
+   *
+   * @param updateMode The update mode (i.e. either update and render, or update and upload without rendering)
    */
-  void RequestUpdateOnce();
+  void RequestUpdateOnce( UpdateMode updateMode );
 
   /**
    * @brief Replaces the surface.