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++;
bool TestApplication::RenderOnly( )
{
// Update Time values
- mCore->Render( mRenderStatus, false );
+ mCore->Render( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
mFrame++;
#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
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;
}
{
if( mThreadController )
{
- mThreadController->RequestUpdateOnce();
+ mThreadController->RequestUpdateOnce( UpdateMode::NORMAL );
}
}
mDeletedSurface( nullptr ),
mPostRendering( FALSE ),
mSurfaceResized( FALSE ),
- mForceClear( FALSE )
+ mForceClear( FALSE ),
+ mUploadWithoutRendering( FALSE )
{
LOG_EVENT_TRACE;
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" );
}
{
LOG_EVENT( "Resuming" );
- RunUpdateRenderThread( CONTINUOUS, true /* Animation progression required while we were paused */ );
+ RunUpdateRenderThread( CONTINUOUS, AnimationProgression::USE_ELAPSED_TIME, UpdateMode::NORMAL );
AddPerformanceMarker( PerformanceInterface::RESUME );
{
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 )
LOG_EVENT_TRACE;
// Run Update/Render once
- RunUpdateRenderThread( ONCE, false /* No animation progression */ );
+ RunUpdateRenderThread( ONCE, AnimationProgression::NONE, updateMode );
}
}
// 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 );
}
Integration::RenderStatus renderStatus;
AddPerformanceMarker( PerformanceInterface::RENDER_START );
- mCore.Render( renderStatus, mForceClear );
+ mCore.Render( renderStatus, mForceClear, mUploadWithoutRendering );
//////////////////////////////
// DELETE SURFACE
/**
* @copydoc ThreadControllerInterface::RequestUpdateOnce()
*/
- virtual void RequestUpdateOnce();
+ virtual void RequestUpdateOnce( UpdateMode updateMode );
/**
* @copydoc ThreadControllerInterface::ReplaceSurface()
// 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.
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
namespace Adaptor
{
+enum class UpdateMode
+{
+ NORMAL, ///< Update and render
+ SKIP_RENDER ///< Update and resource upload but no rendering
+};
+
/**
* Interface Class for all controlling threads.
*/
/**
* 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.
mThreadControllerInterface->RequestUpdate();
}
-void ThreadController::RequestUpdateOnce()
+void ThreadController::RequestUpdateOnce( UpdateMode updateMode )
{
- mThreadControllerInterface->RequestUpdateOnce();
+ mThreadControllerInterface->RequestUpdateOnce( updateMode );
}
void ThreadController::ReplaceSurface( Dali::RenderSurfaceInterface* newSurface )
namespace Adaptor
{
+enum class UpdateMode;
+
class AdaptorInternalServices;
class EnvironmentOptions;
class ThreadControllerInterface;
* @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.