From: Seungho BAEK Date: Thu, 19 Sep 2019 22:54:08 +0000 (+0000) Subject: Merge "Log patch to show the first five swapbuffers call after resume" into devel... X-Git-Tag: dali_1.4.38~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=123185296518ae2611020fcc50dcef3c1ba51168;hp=a0e8db622c654ccb515b002128af5e8dc3a1e5a8 Merge "Log patch to show the first five swapbuffers call after resume" into devel/master --- diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp index 338b71f..44b4964 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp @@ -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++; diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 2c297e0..50d63ec 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include #include // 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 ); } } diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 93f766f..f0a5e65 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -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 diff --git a/dali/internal/adaptor/common/combined-update-render-controller.h b/dali/internal/adaptor/common/combined-update-render-controller.h index 41f519c..e83bacb 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.h +++ b/dali/internal/adaptor/common/combined-update-render-controller.h @@ -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 diff --git a/dali/internal/adaptor/common/thread-controller-interface.h b/dali/internal/adaptor/common/thread-controller-interface.h index 751dceb..8c63c7d 100644 --- a/dali/internal/adaptor/common/thread-controller-interface.h +++ b/dali/internal/adaptor/common/thread-controller-interface.h @@ -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. diff --git a/dali/internal/system/common/thread-controller.cpp b/dali/internal/system/common/thread-controller.cpp index ac7e49e..cd6671d 100644 --- a/dali/internal/system/common/thread-controller.cpp +++ b/dali/internal/system/common/thread-controller.cpp @@ -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 ) diff --git a/dali/internal/system/common/thread-controller.h b/dali/internal/system/common/thread-controller.h index 4a7b81e..686c653 100644 --- a/dali/internal/system/common/thread-controller.h +++ b/dali/internal/system/common/thread-controller.h @@ -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.