Moved FrameTime class to Adaptor.
[Problem] Dali core is trying to second guess what the Vsync monitor is doing
in adaptor.
[Solution] Remove FrameTime from dali-core, and instead pass in the correct
elapsed time and last/next vsync times to Update().
Change-Id: I002dea0c3e126fdb982990776c4ea7966b72758f
Signed-off-by: David Steele <david.steele@partner.samsung.com>
Internal::SceneGraph::UpdateManager& updateManager = Internal::ThreadLocalStorage::Get().GetUpdateManager();
AddMaterialMessage( updateManager, sceneObject );
application.SendNotification(); // Flush update Q
-
- application.GetPlatform().IncrementGetTimeResult( 1 );
- Integration::UpdateStatus status;
- application.GetCore().Update( status );
+ application.UpdateOnly(1);
// Check that a render object has been created
Internal::SceneGraph::RenderMaterial* renderMaterial = sceneObject->GetRenderMaterial();
Internal::SceneGraph::UpdateManager& updateManager = Internal::ThreadLocalStorage::Get().GetUpdateManager();
AddMaterialMessage( updateManager, sceneObject );
application.SendNotification(); // Flush update Q
-
- application.GetPlatform().IncrementGetTimeResult( 1 );
- Integration::UpdateStatus status;
- application.GetCore().Update( status );
+ application.UpdateOnly(1);
// Check that a render object has been created
Internal::SceneGraph::RenderMaterial* renderMaterial = sceneObject->GetRenderMaterial();
mSurfaceWidth( surfaceWidth ),
mSurfaceHeight( surfaceHeight ),
mFrame( 0u ),
- mDpi( horizontalDpi, verticalDpi )
+ mDpi( horizontalDpi, verticalDpi ),
+ mLastVSyncTime(0u)
{
Initialize();
}
mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
}
-bool TestApplication::Render( unsigned int intervalMilliseconds )
+void TestApplication::DoUpdate( unsigned int intervalMilliseconds )
{
- // Update Time values
- mPlatformAbstraction.IncrementGetTimeResult( intervalMilliseconds );
unsigned int seconds(0u), microseconds(0u);
mPlatformAbstraction.GetTimeMicroseconds( seconds, microseconds );
+ mLastVSyncTime = ( seconds * 1e3 ) + ( microseconds / 1e3 );
+ unsigned int nextVSyncTime = mLastVSyncTime + 16;
+
+ // Update Time values
+ mPlatformAbstraction.IncrementGetTimeResult( intervalMilliseconds );
+
+ float elapsedSeconds = intervalMilliseconds / 1e3f;
+ mCore->Update( elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus );
+}
- mCore->VSync( mFrame, seconds, microseconds );
- mCore->Update( mStatus );
+bool TestApplication::Render( unsigned int intervalMilliseconds )
+{
+ DoUpdate( intervalMilliseconds );
mCore->Render( mRenderStatus );
mFrame++;
bool TestApplication::UpdateOnly( unsigned int intervalMilliseconds )
{
- // Update Time values
- mPlatformAbstraction.IncrementGetTimeResult( intervalMilliseconds );
- unsigned int seconds(0u), microseconds(0u);
- mPlatformAbstraction.GetTimeMicroseconds( seconds, microseconds );
-
- mCore->VSync( mFrame, seconds, microseconds );
- mCore->Update( mStatus );
-
+ DoUpdate( intervalMilliseconds );
return mStatus.KeepUpdating();
}
bool RenderOnly( );
void ResetContext();
+private:
+ void DoUpdate( unsigned int intervalMilliseconds );
+
protected:
TestPlatformAbstraction mPlatformAbstraction;
TestRenderController mRenderController;
unsigned int mFrame;
Vector2 mDpi;
+ unsigned int mLastVSyncTime;
};
} // Dali
mImpl->SetDpi(dpiHorizontal, dpiVertical);
}
-void Core::SetMinimumFrameTimeInterval(unsigned int interval)
-{
- mImpl->SetMinimumFrameTimeInterval(interval);
-}
-
void Core::Suspend()
{
mImpl->Suspend();
return mImpl->GetMaximumUpdateCount();
}
-void Core::Update( UpdateStatus& status )
+void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status )
{
- mImpl->Update( status );
+ mImpl->Update( elapsedSeconds, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, status );
}
void Core::Render( RenderStatus& status )
mImpl->Render( status );
}
-void Core::Sleep()
-{
- mImpl->Sleep();
-}
-
-void Core::WakeUp()
-{
- mImpl->WakeUp();
-}
-
-void Core::VSync( unsigned int frameNumber, unsigned int seconds, unsigned int microseconds )
-{
- mImpl->VSync( frameNumber, seconds, microseconds );
-}
-
SystemOverlay& Core::GetSystemOverlay()
{
return mImpl->GetSystemOverlay();
*/
void SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical);
- /**
- * Sets the expected interval between frames used to predict future intervals and the time when the
- * next render will take place.
- *
- * This is the minimum interval that Core should expect. Core will adapt the predicted interval
- * accordingly if the expected interval is constantly not met (but will not drop it below this
- * amount).
- *
- * The value provided should be in microseconds.
- *
- * @param[in] interval The minimum interval between frames (in microseconds).
- *
- * Multi-threading note: this method should be called from the render thread
- */
- void SetMinimumFrameTimeInterval(unsigned int interval);
-
// Core Lifecycle
/**
* However the update-thread must wait until frame N has been rendered, before processing frame N+2.
* After this method returns, messages may be queued internally for the main thread.
* In order to process these messages, a notification is sent via the main thread's event loop.
+ * @param[in] elapsedSeconds Number of seconds since the last call
+ * @param[in] lastVSyncTimeMilliseconds The last vsync time in milliseconds
+ * @param[in] nextVSyncTimeMilliseconds The time of the next predicted VSync in milliseconds
* @param[out] status showing whether further updates are required. This also shows
* whether a Notification event should be sent, regardless of whether the multi-threading is used.
*/
- void Update( UpdateStatus& status );
+ void Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, UpdateStatus& status );
/**
* Render the next frame. This method should be preceded by a call up Update.
*/
void Render( RenderStatus& status );
- /**
- * Tells core that it is about to sleep.
- * Application is running as normal, but no updates are taking place i.e. no ongoing animations.
- * This should be called when we choose to stop updating and rendering when there are no screen
- * updates required.
- * Multi-threading note: this method should be called from the update-thread.
- */
- void Sleep();
-
- /**
- * Wakes up core from a sleep state.
- * At the first update the elapsed time passed to the animations is zero.
- * Multi-threading note: this method should be called from the update-thread.
- */
- void WakeUp();
-
- /**
- * Notification of a vertical blank sync
- * @param[in] frameNumber The frame number of this vsync. This number will not update
- * while paused.
- * @param[in] seconds The timestamp seconds
- * @param[in] microseconds The timestamp microseconds
- */
- void VSync( unsigned int frameNumber, unsigned int seconds, unsigned int microseconds );
-
// System-level overlay
/**
#include <dali/internal/render/common/render-manager.h>
#include <dali/internal/update/common/discard-queue.h>
#include <dali/internal/common/event-to-update.h>
-#include <dali/internal/common/frame-time.h>
#include <dali/internal/update/resources/resource-manager.h>
#include <dali/internal/event/text/font-factory.h>
#include <dali/internal/event/images/image-factory.h>
mDiscardQueue(NULL),
mResourcePostProcessQueue(),
mNotificationManager(NULL),
- mFrameTime(NULL),
mFontFactory(NULL),
mImageFactory(NULL),
mModelFactory(NULL),
mGestureEventProcessor = new GestureEventProcessor(*mStage, gestureManager, mRenderController);
mEventProcessor = new EventProcessor(*mStage, *mNotificationManager, *mGestureEventProcessor);
- mFrameTime = new FrameTime( mPlatform );
mFontFactory = new FontFactory(*mResourceClient);
mImageFactory = new ImageFactory( *mResourceClient );
mModelFactory = new ModelFactory(*mResourceClient);
delete mRenderManager;
delete mDiscardQueue;
delete mResourcePostProcessQueue;
- delete mFrameTime;
}
void Core::ContextCreated()
mStage->SetDpi( Vector2( dpiHorizontal , dpiVertical) );
}
-void Core::SetMinimumFrameTimeInterval(unsigned int interval)
+void Core::Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, Integration::UpdateStatus& status )
{
- mFrameTime->SetMinimumFrameTimeInterval(interval);
-}
-
-void Core::Update( UpdateStatus& status )
-{
- // get the last delta and the predict when this update will be rendered
- float lastFrameDelta( 0.0f );
- unsigned int lastVSyncTime( 0 );
- unsigned int nextVSyncTime( 0 );
- mFrameTime->PredictNextVSyncTime( lastFrameDelta, lastVSyncTime, nextVSyncTime );
-
// set the time delta so adaptor can easily print FPS with a release build with 0 as
// it is cached by frametime
- status.secondsFromLastFrame = lastFrameDelta;
+ status.secondsFromLastFrame = elapsedSeconds;
// Render returns true when there are updates on the stage or one or more animations are completed.
// Use the estimated time diff till we render as the elapsed time.
- status.keepUpdating = mUpdateManager->Update( lastFrameDelta, lastVSyncTime, nextVSyncTime );
+ status.keepUpdating = mUpdateManager->Update( elapsedSeconds,
+ lastVSyncTimeMilliseconds,
+ nextVSyncTimeMilliseconds );
// Check the Notification Manager message queue to set needsNotification
status.needsNotification = mNotificationManager->MessagesToProcess();
void Core::Suspend()
{
- if( mFrameTime )
- {
- mFrameTime->Suspend();
- }
-
mPlatform.Suspend();
mIsActive = false;
void Core::Resume()
{
- if( mFrameTime )
- {
- mFrameTime->Resume();
- }
-
mPlatform.Resume();
mIsActive = true;
ProcessEvents();
}
-void Core::Sleep()
-{
- if( mFrameTime )
- {
- mFrameTime->Sleep();
- }
-}
-
-void Core::WakeUp()
-{
- if( mFrameTime )
- {
- mFrameTime->WakeUp();
- }
-}
-
-void Core::VSync( unsigned int frameNumber, unsigned int seconds, unsigned int microseconds )
-{
- // Can't use passed in time as that is not the clock the touch events use so our predicted render value will be meaningless.
- mFrameTime->SetVSyncTime( frameNumber );
-}
-
void Core::QueueEvent( const Integration::Event& event )
{
mEventProcessor->QueueEvent( event );
class GestureEventProcessor;
class ResourceClient;
class ResourceManager;
-class FrameTime;
class FontFactory;
class ImageFactory;
class ModelFactory;
/**
* @copydoc Dali::Integration::Core::Update()
*/
- void Update( Integration::UpdateStatus& status );
+ void Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, Integration::UpdateStatus& status );
/**
* @copydoc Dali::Integration::Core::Render()
unsigned int GetMaximumUpdateCount() const;
/**
- * @copydoc Dali::Integration::Core::Sleep()
- */
- void Sleep();
-
- /**
- * @copydoc Dali::Integration::Core::Wake()
- */
- void WakeUp();
-
- /**
- * @copydoc Dali::Integration::Core::VSync()
- */
- void VSync( unsigned int frameNumber, unsigned int seconds, unsigned int microseconds );
-
- /**
* @copydoc Dali::Integration::Core::GetSystemOverlay()
*/
Integration::SystemOverlay& GetSystemOverlay();
NotificationManager* mNotificationManager; ///< Notification manager
AnimationPlaylistOwner mAnimationPlaylist; ///< For 'Fire and forget' animation support
OwnerPointer<PropertyNotificationManager> mPropertyNotificationManager; ///< For safe signal emmision of property changed notifications
- FrameTime* mFrameTime; ///< Time when we render
FontFactory* mFontFactory; ///< font resource factory
ImageFactory* mImageFactory; ///< Image resource factory
ModelFactory* mModelFactory; ///< Model resource factory
+++ /dev/null
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/common/frame-time.h>
-
-// INTERNAL INCLUDES
-#include <dali/integration-api/debug.h>
-#include <dali/integration-api/platform-abstraction.h>
-
-namespace Dali
-{
-
-using Integration::PlatformAbstraction;
-
-namespace Internal
-{
-
-namespace
-{
-#if defined(DEBUG_ENABLED)
-Integration::Log::Filter* gLogFilter = Integration::Log::Filter::New(Debug::NoLogging, false, "LOG_FRAME_TIME");
-#endif
-
-const unsigned int DEFAULT_MINIMUM_FRAME_TIME_INTERVAL( 16667u );
-
-const unsigned int MICROSECONDS_PER_SECOND( 1000000u );
-const unsigned int MICROSECONDS_PER_MILLISECOND( 1000u );
-
-const float MICROSECONDS_TO_SECONDS( 0.000001f );
-
-const unsigned int HISTORY_SIZE(3);
-} // unnamed namespace
-
-FrameTime::FrameTime( PlatformAbstraction& platform )
-: mPlatform( platform ),
- mMinimumFrameTimeInterval( DEFAULT_MINIMUM_FRAME_TIME_INTERVAL ),
- mLastVSyncTime( 0u ),
- mLastVSyncTimeAtUpdate( 0u ),
- mLastVSyncFrameNumber( 0u ),
- mLastUpdateFrameNumber( 0u ),
- mRunning( true ),
- mFirstFrame( true ),
- writePos( 0u ),
- mExtraUpdatesSinceVSync( 0u )
-{
- // Clear buffer
- for ( unsigned int i = 0; i < HISTORY_SIZE; ++i )
- {
- mPreviousUpdateFrames[i] = 0;
- }
-
- SetLastVSyncTime();
- mLastVSyncTimeAtUpdate = mLastVSyncTime;
-
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "FrameTime Initialized\n" );
-}
-
-FrameTime::~FrameTime()
-{
-}
-
-void FrameTime::SetMinimumFrameTimeInterval( unsigned int interval )
-{
- mMinimumFrameTimeInterval = interval;
-}
-
-void FrameTime::SetVSyncTime( unsigned int frameNumber )
-{
- // Only set the render time if we are running
- if ( mRunning )
- {
- SetLastVSyncTime();
-
- mLastVSyncFrameNumber = frameNumber;
-
- DALI_LOG_INFO( gLogFilter, Debug::General, "FrameTime: Frame: %u: Time: %u\n", mLastVSyncFrameNumber, (unsigned int) ( mLastVSyncTime / MICROSECONDS_PER_MILLISECOND ) );
- }
-}
-
-void FrameTime::Suspend()
-{
- mRunning = false;
-
- // Reset members
- mLastVSyncFrameNumber = 0;
- mLastUpdateFrameNumber = 0;
- writePos = 0;
- mExtraUpdatesSinceVSync = 0;
-
- // Clear buffer
- for ( unsigned int i = 0; i < HISTORY_SIZE; ++i )
- {
- mPreviousUpdateFrames[i] = 0;
- }
-
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "FrameTime: Suspended\n" );
-}
-
-void FrameTime::Resume()
-{
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "FrameTime: Resuming\n" );
-
- SetLastVSyncTime(); // Should only update the last VSync time so the elapsed time during suspension is taken into consideration when we next update.
- mFirstFrame = true;
-
- mRunning = true;
-}
-
-void FrameTime::Sleep()
-{
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "FrameTime: Sleeping\n" );
-
- // Mimic Suspend behaviour
- Suspend();
-}
-
-void FrameTime::WakeUp()
-{
- DALI_LOG_INFO( gLogFilter, Debug::Concise, "FrameTime: Waking Up\n" );
-
- SetLastVSyncTime();
- mLastVSyncTimeAtUpdate = mLastVSyncTime; // We do not want any animations to progress as we have just been woken up.
- mFirstFrame = true;
-
- mRunning = true;
-}
-
-void FrameTime::PredictNextVSyncTime( float& lastFrameDeltaSeconds, unsigned int& lastVSyncTimeMilliseconds, unsigned int& nextVSyncTimeMilliseconds )
-{
- if ( mRunning )
- {
- const unsigned int minimumFrameTimeInterval( mMinimumFrameTimeInterval );
- const uint64_t lastVSyncTime( mLastVSyncTime );
- const unsigned int lastVSyncFrameNumber( mLastVSyncFrameNumber );
-
- float lastFrameDelta( 0.0f ); // Assume the last update frame delta is 0.
- unsigned int framesTillNextVSync( 1 ); // Assume next render will be in one VSync frame time.
-
- unsigned int framesInLastUpdate( lastVSyncFrameNumber - mLastUpdateFrameNumber );
- lastFrameDelta = lastVSyncTime - mLastVSyncTimeAtUpdate;
-
- // We should only evaluate the previous frame values if this is not the first frame.
- if ( !mFirstFrame )
- {
- // Check whether we have had any VSyncs since we last did an Update.
- if ( framesInLastUpdate == 0 )
- {
- // We have had another update before a VSync, increment counter.
- ++mExtraUpdatesSinceVSync;
-
- // This update frame will be rendered mUpdatesSinceVSync later.
- framesTillNextVSync += mExtraUpdatesSinceVSync;
- }
- else
- {
- mExtraUpdatesSinceVSync = 0;
- }
-
- // If more than one frame elapsed since last Update, then check if this is a recurring theme so we can accurately predict when this Update is rendered.
- if ( framesInLastUpdate > 1 )
- {
- unsigned int average(0);
- for ( unsigned int i = 0; i < HISTORY_SIZE; ++i )
- {
- average += mPreviousUpdateFrames[i];
- }
- average /= HISTORY_SIZE;
-
- if ( average > 1 )
- {
- // Our average shows a recurring theme, we are missing frames when rendering so calculate number of frames this will take.
- framesTillNextVSync = average;
- }
- }
-
- // Write the number of frames the last update took to the array.
- mPreviousUpdateFrames[writePos] = framesInLastUpdate;
- writePos = ( writePos + 1 ) % HISTORY_SIZE;
- }
-
- mLastUpdateFrameNumber = lastVSyncFrameNumber;
- mLastVSyncTimeAtUpdate = lastVSyncTime;
- mFirstFrame = false;
-
- // Calculate the time till the next render
- unsigned int timeTillNextRender( minimumFrameTimeInterval * framesTillNextVSync );
-
- // Set the input variables
- lastFrameDeltaSeconds = lastFrameDelta * MICROSECONDS_TO_SECONDS;
- lastVSyncTimeMilliseconds = lastVSyncTime / MICROSECONDS_PER_MILLISECOND;
- nextVSyncTimeMilliseconds = ( lastVSyncTime + timeTillNextRender ) / MICROSECONDS_PER_MILLISECOND;
-
- DALI_LOG_INFO( gLogFilter, Debug::General, "FrameTime: Frame: %u, Time: %u, NextTime: %u, LastDelta: %f\n", mLastUpdateFrameNumber, lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds, lastFrameDeltaSeconds );
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, " FramesInLastUpdate: %u, FramesTillNextVSync: %u\n", framesInLastUpdate, framesTillNextVSync );
- }
-}
-
-inline void FrameTime::SetLastVSyncTime()
-{
- unsigned int seconds( 0u );
- unsigned int microseconds( 0u );
-
- mPlatform.GetTimeMicroseconds( seconds, microseconds );
-
- mLastVSyncTime = seconds;
- mLastVSyncTime = ( mLastVSyncTime * MICROSECONDS_PER_SECOND ) + microseconds;
-}
-
-} // namespace Internal
-
-} // namespace Dali
+++ /dev/null
-#ifndef __DALI_INTERNAL_FRAME_TIME_H__
-#define __DALI_INTERNAL_FRAME_TIME_H__
-
-/*
- * Copyright (c) 2014 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#include <stdint.h>
-
-namespace Dali
-{
-
-namespace Integration
-{
-class PlatformAbstraction;
-}
-
-namespace Internal
-{
-
-/**
- * FrameTime stores the time of the last VSync. It can then be used by the update thread to predict
- * the current update will be rendered.
- */
-class FrameTime
-{
-public: // Core Methods
-
- // Called from Event thread
-
- /**
- * Constructor
- * @param[in] platform The platform used to retrieve the current time
- */
- FrameTime( Integration::PlatformAbstraction& platform );
-
- /**
- * Destructor, non virtual
- */
- ~FrameTime();
-
- /**
- * Sets the expected minimum frame time interval.
- * @param[in] interval The interval in microseconds.
- */
- void SetMinimumFrameTimeInterval( unsigned int interval );
-
- /**
- * Suspends the FrameTime object.
- * During the suspended state animations will be paused.
- * @note Should only be called by the Core.
- */
- void Suspend();
-
- /**
- * Resumes the FrameTime object.
- * Animations etc. will carry on from where they left off.
- * @note Should only be called by the Core.
- */
- void Resume();
-
- // Called from Update thread
-
- /**
- * Sets the FrameTime object to sleep.
- * @note Should only be called by the Core, from the update thread.
- */
- void Sleep();
-
- /**
- * Wakes the FrameTime object from a sleep state.
- * @note Should only be called by the Core, from the update thread.
- */
- void WakeUp();
-
- /**
- * Predicts when the next render time will occur.
- *
- * @param[out] lastFrameDeltaSeconds The delta, in seconds (with float precision), between the last two renders.
- * @param[out] lastVSyncTimeMilliseconds The time, in milliseconds, of the last VSync.
- * @param[out] nextVSyncTimeMilliseconds The estimated time, in milliseconds, at the next VSync.
- *
- * @note Should only be called once per tick, from the update thread.
- */
- void PredictNextVSyncTime( float& lastFrameDeltaSeconds, unsigned int& lastVSyncTimeMilliseconds, unsigned int& nextVSyncTimeMilliseconds );
-
- // Called from VSync thread
-
- /**
- * Tells the FrameTime object that a VSync has occurred.
- *
- * @param[in] frameNumber The frame number of the current VSync.
- *
- * @note Should only be called by the Core (from the VSync thread).
- */
- void SetVSyncTime( unsigned int frameNumber );
-
-private:
-
- /**
- * Sets the current time to be the last Vsync time.
- */
- inline void SetLastVSyncTime();
-
-private:
-
- Integration::PlatformAbstraction& mPlatform; ///< The platform abstraction.
-
- unsigned int mMinimumFrameTimeInterval; ///< The minimum frame time interval, set by Adaptor.
-
- uint64_t mLastVSyncTime; ///< The last VSync time (in microseconds).
- uint64_t mLastVSyncTimeAtUpdate; ///< The last VSync time at Update (in microseconds).
-
- unsigned int mLastVSyncFrameNumber; ///< The last VSync frame number
- unsigned int mLastUpdateFrameNumber; ///< The last VSync frame number handled in Update.
-
- bool mRunning:1; ///< The state of the FrameTime object.
- bool mFirstFrame:1; ///< Whether the current update is the first frame (after initialisation, resume or wake up).
-
- unsigned int mPreviousUpdateFrames[3]; ///< Array holding the number of frames Update took in the last three iterations.
- unsigned int writePos; ///< The current write position in the array.
-
- unsigned int mExtraUpdatesSinceVSync; ///< The number of extra updates since the last VSync.
-};
-
-} // namespace Internal
-
-} // namespace Dali
-
-#endif // __DALI_INTERNAL_FRAME_TIME_H__
internal_src_files = \
$(internal_src_dir)/common/blending-options.cpp \
$(internal_src_dir)/common/core-impl.cpp \
- $(internal_src_dir)/common/frame-time.cpp \
$(internal_src_dir)/common/internal-constants.cpp \
$(internal_src_dir)/common/message-buffer.cpp \
$(internal_src_dir)/common/text-parameters.cpp \
PERF_MONITOR_END(PerformanceMonitor::RESET_PROPERTIES);
}
-bool UpdateManager::ProcessGestures( unsigned int lastVSyncTime, unsigned int nextVSyncTime )
+bool UpdateManager::ProcessGestures( unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds )
{
bool gestureUpdated( false );
{
PanGesture& gesture = **iter;
gesture.ResetToBaseValues( mSceneGraphBuffers.GetUpdateBufferIndex() ); // Needs to be done every time as gesture data is written directly to an update-buffer rather than via a message
- gestureUpdated |= gesture.UpdateProperties( lastVSyncTime, nextVSyncTime );
+ gestureUpdated |= gesture.UpdateProperties( lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds );
}
return gestureUpdated;
}
}
-unsigned int UpdateManager::Update( float elapsedSeconds, unsigned int lastVSyncTime, unsigned int nextVSyncTime )
+unsigned int UpdateManager::Update( float elapsedSeconds,
+ unsigned int lastVSyncTimeMilliseconds,
+ unsigned int nextVSyncTimeMilliseconds )
{
PERF_MONITOR_END(PerformanceMonitor::FRAME_RATE); // Mark the End of the last frame
PERF_MONITOR_NEXT_FRAME(); // Prints out performance info for the last frame (if enabled)
// 3) Process Touches & Gestures
mImpl->touchResampler.Update();
- const bool gestureUpdated = ProcessGestures( lastVSyncTime, nextVSyncTime );
+ const bool gestureUpdated = ProcessGestures( lastVSyncTimeMilliseconds, nextVSyncTimeMilliseconds );
const bool updateScene = // The scene-graph requires an update if..
mImpl->activeConstraints != 0 || // ..constraints were active in previous frame OR
/**
* Performs an Update traversal on the scene-graph.
* @param[in] elapsedSeconds The elapsed time that should be applied to animations.
- * @param[in] lastVSyncTime The last time, in milliseconds, that we had a VSync.
- * @param[in] nextVSyncTime The estimated time, in milliseconds, of the next VSync.
+ * @param[in] lastVSyncTimeMilliseconds The last time, in milliseconds, that we had a VSync.
+ * @param[in] nextVSyncTimeMilliseconds The estimated time, in milliseconds, of the next VSync.
* @return True if further updates are required e.g. during animations.
*/
- unsigned int Update( float elapsedSeconds, unsigned int lastVSyncTime, unsigned int nextVSyncTime );
+ unsigned int Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
/**
* Set the background color i.e. the glClear color used at the beginning of each frame.
/**
* Perform gesture updates.
- * @param[in] lastVSyncTime The last VSync time.
- * @param[in] nextVSyncTime The estimated time of the next VSync.
+ * @param[in] lastVSyncTime The last VSync time in milliseconds.
+ * @param[in] nextVSyncTime The estimated time of the next VSync in milliseconds.
* @return true, if any properties were updated.
*/
- bool ProcessGestures( unsigned int lastVSyncTime, unsigned int nextVSyncTime );
+ bool ProcessGestures( unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds );
/**
* Perform animation updates