/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// The following values will get calculated at compile time
const float DEFAULT_FRAME_DURATION_IN_SECONDS( 1.0f / 60.0f );
-const unsigned int DEFAULT_FRAME_DURATION_IN_MILLISECONDS( DEFAULT_FRAME_DURATION_IN_SECONDS * MILLISECONDS_PER_SECOND );
-const unsigned int DEFAULT_FRAME_DURATION_IN_NANOSECONDS( DEFAULT_FRAME_DURATION_IN_SECONDS * NANOSECONDS_PER_SECOND );
+const uint64_t DEFAULT_FRAME_DURATION_IN_MILLISECONDS( DEFAULT_FRAME_DURATION_IN_SECONDS * MILLISECONDS_PER_SECOND );
+const uint64_t DEFAULT_FRAME_DURATION_IN_NANOSECONDS( DEFAULT_FRAME_DURATION_IN_SECONDS * NANOSECONDS_PER_SECOND );
/**
* Handles the use case when an update-request is received JUST before we process a sleep-request. If we did not have an update-request count then
mDestroyUpdateRenderThread( FALSE ),
mUpdateRenderThreadCanSleep( FALSE ),
mPendingRequestUpdate( FALSE ),
+ mUseElapsedTimeAfterWait( FALSE ),
mNewSurface( NULL ),
mPostRendering( FALSE )
{
void CombinedUpdateRenderController::RequestUpdateOnce()
{
+ // Increment the update-request count to the maximum
+ if( mUpdateRequestCount < MAXIMUM_UPDATE_REQUESTS )
+ {
+ ++mUpdateRequestCount;
+ }
+
if( IsUpdateRenderThreadPaused() )
{
LOG_EVENT_TRACE;
{
// Not protected by lock, but written to rarely so not worth adding a lock when reading
mDefaultFrameDelta = numberOfFramesPerRender * DEFAULT_FRAME_DURATION_IN_SECONDS;
- mDefaultFrameDurationMilliseconds = (uint64_t)numberOfFramesPerRender * DEFAULT_FRAME_DURATION_IN_MILLISECONDS;
- mDefaultFrameDurationNanoseconds = (uint64_t)numberOfFramesPerRender * DEFAULT_FRAME_DURATION_IN_NANOSECONDS;
- mDefaultHalfFrameNanoseconds = mDefaultFrameDurationNanoseconds / 2;
+ mDefaultFrameDurationMilliseconds = uint64_t( numberOfFramesPerRender ) * DEFAULT_FRAME_DURATION_IN_MILLISECONDS;
+ mDefaultFrameDurationNanoseconds = uint64_t( numberOfFramesPerRender ) * DEFAULT_FRAME_DURATION_IN_NANOSECONDS;
+ mDefaultHalfFrameNanoseconds = mDefaultFrameDurationNanoseconds / 2u;
LOG_EVENT( "mDefaultFrameDelta(%.6f), mDefaultFrameDurationMilliseconds(%lld), mDefaultFrameDurationNanoseconds(%lld)", mDefaultFrameDelta, mDefaultFrameDurationMilliseconds, mDefaultFrameDurationNanoseconds );
}
mCore.Render( renderStatus );
AddPerformanceMarker( PerformanceInterface::RENDER_END );
- if( renderStatus.HasRendered() )
+ if( renderStatus.NeedsPostRender() )
{
mRenderHelper.PostRender();
}
{
ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
while( mPostRendering &&
- ! mNewSurface ) // We should NOT wait if we're replacing the surface
+ ! mNewSurface && // We should NOT wait if we're replacing the surface
+ ! mDestroyUpdateRenderThread )
{
mUpdateRenderThreadWaitCondition.Wait( lock );
}