base_adaptor_src_files = \
$(base_adaptor_src_dir)/conditional-wait.cpp \
- $(base_adaptor_src_dir)/frame-time.cpp \
$(base_adaptor_src_dir)/display-connection.cpp \
+ $(base_adaptor_src_dir)/environment-options.cpp \
+ $(base_adaptor_src_dir)/frame-time.cpp \
$(base_adaptor_src_dir)/render-thread.cpp \
+ $(base_adaptor_src_dir)/thread-controller.cpp \
+ $(base_adaptor_src_dir)/thread-synchronization.cpp \
$(base_adaptor_src_dir)/update-thread.cpp \
- $(base_adaptor_src_dir)/update-render-synchronization.cpp \
- $(base_adaptor_src_dir)/update-render-controller.cpp \
$(base_adaptor_src_dir)/vsync-notifier.cpp \
$(base_adaptor_src_dir)/performance-logging/frame-time-stamp.cpp \
- $(base_adaptor_src_dir)/environment-options.cpp \
$(base_adaptor_src_dir)/performance-logging/networking/network-performance-protocol.cpp \
$(base_adaptor_src_dir)/performance-logging/networking/network-performance-client.cpp \
$(base_adaptor_src_dir)/performance-logging/networking/network-performance-server.cpp \
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
// INTERNAL INCLUDES
#include <base/interfaces/adaptor-internal-services.h>
-#include <base/update-render-synchronization.h>
+#include <base/thread-synchronization.h>
#include <base/environment-options.h>
#include <base/display-connection.h>
}
-RenderThread::RenderThread( UpdateRenderSynchronization& sync,
+RenderThread::RenderThread( ThreadSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
const EnvironmentOptions& environmentOptions )
-: mUpdateRenderSync( sync ),
+: mThreadSync( sync ),
mCore( adaptorInterfaces.GetCore() ),
mGLES( adaptorInterfaces.GetGlesInterface() ),
mEglFactory( &adaptorInterfaces.GetEGLFactoryInterface()),
// render loop, we stay inside here when rendering
while( running )
{
- // Sync with update thread and get any outstanding requests from UpdateRenderSynchronization
+ // Sync with update thread and get any outstanding requests from ThreadSynchronization
DALI_LOG_INFO( gRenderLogFilter, Debug::Verbose, "RenderThread::Run. 1 - RenderSyncWithUpdate()\n");
RenderRequest* request = NULL;
- running = mUpdateRenderSync.RenderSyncWithUpdate( request );
+ running = mThreadSync.RenderSyncWithUpdate( request );
DALI_LOG_INFO( gRenderLogFilter, Debug::Verbose, "RenderThread::Run. 2 - Process requests\n");
}
else
{
- // Block until new surface... - cleared by ReplaceSurface code in UpdateRenderController
- running = mUpdateRenderSync.RenderSyncWithRequest(request);
+ // Block until new surface... - cleared by ReplaceSurface code in ThreadController
+ running = mThreadSync.RenderSyncWithRequest(request);
}
}
// Notify the update-thread that a render has completed
DALI_LOG_INFO( gRenderLogFilter, Debug::Verbose, "RenderThread::Run. 5 - Sync.RenderFinished()\n");
- mUpdateRenderSync.RenderFinished( renderStatus.NeedsUpdate(), requestProcessed );
+ mThreadSync.RenderFinished( renderStatus.NeedsUpdate(), requestProcessed );
- uint64_t newTime( mUpdateRenderSync.GetTimeMicroseconds() );
+ uint64_t newTime( mThreadSync.GetTimeMicroseconds() );
// perform any post-render operations
if ( renderStatus.HasRendered() )
#define __DALI_INTERNAL_RENDER_THREAD_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
{
class AdaptorInternalServices;
-class UpdateRenderSynchronization;
+class ThreadSynchronization;
class EglFactoryInterface;
class EnvironmentOptions;
/**
* Create the render-thread; this will not do anything until Start() is called.
- * @param[in] sync update-render synchronization object
+ * @param[in] sync thread synchronization object
* @param[in] adaptorInterfaces base adaptor interface
* @param[in] environmentOptions environment options
*/
- RenderThread( UpdateRenderSynchronization& sync,
+ RenderThread( ThreadSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
const EnvironmentOptions& environmentOptions );
private: // Data
- UpdateRenderSynchronization& mUpdateRenderSync; ///< Used to synchronize the update & render threads
+ ThreadSynchronization& mThreadSync; ///< Used to synchronize the all threads
Dali::Integration::Core& mCore; ///< Dali core reference
Integration::GlAbstraction& mGLES; ///< GL abstraction reference
EglFactoryInterface* mEglFactory; ///< Factory class to create EGL implementation
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
*/
// CLASS HEADER
-#include "update-render-controller.h"
+#include "thread-controller.h"
// INTERNAL INCLUDES
#include <base/update-thread.h>
#include <base/render-thread.h>
-#include <base/update-render-synchronization.h>
+#include <base/thread-synchronization.h>
#include <base/vsync-notifier.h>
#include <base/interfaces/adaptor-internal-services.h>
#include <base/environment-options.h>
namespace Adaptor
{
-UpdateRenderController::UpdateRenderController( AdaptorInternalServices& adaptorInterfaces,
+ThreadController::ThreadController( AdaptorInternalServices& adaptorInterfaces,
const EnvironmentOptions& environmentOptions )
: mAdaptorInterfaces( adaptorInterfaces ),
mUpdateThread( NULL ),
mRenderThread( NULL ),
mVSyncNotifier( NULL ),
- mUpdateRenderSync( NULL ),
+ mThreadSync( NULL ),
mNumberOfVSyncsPerRender( 1 )
{
- mUpdateRenderSync = new UpdateRenderSynchronization( adaptorInterfaces, mNumberOfVSyncsPerRender );
+ mThreadSync = new ThreadSynchronization( adaptorInterfaces, mNumberOfVSyncsPerRender );
- mUpdateThread = new UpdateThread( *mUpdateRenderSync, adaptorInterfaces, environmentOptions );
+ mUpdateThread = new UpdateThread( *mThreadSync, adaptorInterfaces, environmentOptions );
- mRenderThread = new RenderThread( *mUpdateRenderSync, adaptorInterfaces, environmentOptions );
+ mRenderThread = new RenderThread( *mThreadSync, adaptorInterfaces, environmentOptions );
- mVSyncNotifier = new VSyncNotifier( *mUpdateRenderSync, adaptorInterfaces, environmentOptions );
+ mVSyncNotifier = new VSyncNotifier( *mThreadSync, adaptorInterfaces, environmentOptions );
}
-UpdateRenderController::~UpdateRenderController()
+ThreadController::~ThreadController()
{
delete mVSyncNotifier;
delete mRenderThread;
delete mUpdateThread;
- delete mUpdateRenderSync;
+ delete mThreadSync;
}
-void UpdateRenderController::Start()
+void ThreadController::Start()
{
// Notify the synchronization object before starting the threads
- mUpdateRenderSync->Start();
+ mThreadSync->Start();
mUpdateThread->Start();
mRenderThread->Start();
mVSyncNotifier->Start();
}
-void UpdateRenderController::Pause()
+void ThreadController::Pause()
{
- mUpdateRenderSync->Pause();
+ mThreadSync->Pause();
// if update thread is napping, wake it up to get it to pause in correct place
- mUpdateRenderSync->UpdateRequested();
+ mThreadSync->UpdateRequested();
}
-void UpdateRenderController::ResumeFrameTime()
+void ThreadController::ResumeFrameTime()
{
- mUpdateRenderSync->ResumeFrameTime();
+ mThreadSync->ResumeFrameTime();
}
-void UpdateRenderController::Resume()
+void ThreadController::Resume()
{
- mUpdateRenderSync->Resume();
+ mThreadSync->Resume();
}
-void UpdateRenderController::Stop()
+void ThreadController::Stop()
{
// Notify the synchronization object before stopping the threads
- mUpdateRenderSync->Stop();
+ mThreadSync->Stop();
mVSyncNotifier->Stop();
mUpdateThread->Stop();
mRenderThread->Stop();
}
-void UpdateRenderController::RequestUpdate()
+void ThreadController::RequestUpdate()
{
- mUpdateRenderSync->UpdateRequested();
+ mThreadSync->UpdateRequested();
}
-void UpdateRenderController::RequestUpdateOnce()
+void ThreadController::RequestUpdateOnce()
{
// we may be sleeping
- mUpdateRenderSync->UpdateRequested();
+ mThreadSync->UpdateRequested();
// if we are paused, need to allow one update
- mUpdateRenderSync->UpdateWhilePaused();
+ mThreadSync->UpdateWhilePaused();
}
-void UpdateRenderController::ReplaceSurface( RenderSurface* newSurface )
+void ThreadController::ReplaceSurface( RenderSurface* newSurface )
{
// tell render thread to start the replace. This call will block until the replace
// has completed.
// Ensure the current surface releases any locks to prevent deadlock.
currentSurface->StopRender();
- mUpdateRenderSync->ReplaceSurface( newSurface );
+ mThreadSync->ReplaceSurface( newSurface );
}
-void UpdateRenderController::NewSurface( RenderSurface* newSurface )
+void ThreadController::NewSurface( RenderSurface* newSurface )
{
// This API shouldn't be used when there is a current surface, but check anyway.
RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
currentSurface->StopRender();
}
- mUpdateRenderSync->NewSurface( newSurface );
+ mThreadSync->NewSurface( newSurface );
}
-void UpdateRenderController::SetRenderRefreshRate(unsigned int numberOfVSyncsPerRender )
+void ThreadController::SetRenderRefreshRate(unsigned int numberOfVSyncsPerRender )
{
mNumberOfVSyncsPerRender = numberOfVSyncsPerRender;
- mUpdateRenderSync->SetRenderRefreshRate(numberOfVSyncsPerRender);
+ mThreadSync->SetRenderRefreshRate(numberOfVSyncsPerRender);
}
#define __DALI_INTERNAL_UPDATE_RENDER_CONTROLLER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
class UpdateThread;
class RenderThread;
class VSyncNotifier;
-class UpdateRenderSynchronization;
+class ThreadSynchronization;
class AdaptorInternalServices;
class EnvironmentOptions;
/**
- * Class to control the update and render threads.
+ * Class to control all the threads.
*/
-class UpdateRenderController
+class ThreadController
{
public:
/**
* Constructor
*/
- UpdateRenderController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions );
+ ThreadController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions );
/**
* Non virtual destructor. Not intended as base class.
*/
- ~UpdateRenderController();
+ ~ThreadController();
/**
* @copydoc Dali::Adaptor::Start()
private:
// Undefined copy constructor.
- UpdateRenderController( const UpdateRenderController& );
+ ThreadController( const ThreadController& );
// Undefined assignment operator.
- UpdateRenderController& operator=( const UpdateRenderController& );
+ ThreadController& operator=( const ThreadController& );
AdaptorInternalServices& mAdaptorInterfaces;
- UpdateThread* mUpdateThread; ///< The update-thread owned by UpdateRenderController
- RenderThread* mRenderThread; ///< The render-thread owned by UpdateRenderController
- VSyncNotifier* mVSyncNotifier; ///< The vsync-thread owned by UpdateRenderController
- UpdateRenderSynchronization* mUpdateRenderSync; ///< Used to synchronize the update & render threads; also owned by UpdateRenderController
+ UpdateThread* mUpdateThread; ///< The update-thread owned by ThreadController
+ RenderThread* mRenderThread; ///< The render-thread owned by ThreadController
+ VSyncNotifier* mVSyncNotifier; ///< The vsync-thread owned by ThreadController
+ ThreadSynchronization* mThreadSync; ///< Used to synchronize all the threads; owned by ThreadController
unsigned int mNumberOfVSyncsPerRender; ///< Frame skipping count
};
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
*/
// CLASS HEADER
-#include "update-render-synchronization.h"
+#include "thread-synchronization.h"
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
} // unnamed namespace
-UpdateRenderSynchronization::UpdateRenderSynchronization( AdaptorInternalServices& adaptorInterfaces,
+ThreadSynchronization::ThreadSynchronization( AdaptorInternalServices& adaptorInterfaces,
unsigned int numberOfVSyncsPerRender)
: mMaximumUpdateCount( adaptorInterfaces.GetCore().GetMaximumUpdateCount()),
mNumberOfVSyncsPerRender( numberOfVSyncsPerRender ),
{
}
-UpdateRenderSynchronization::~UpdateRenderSynchronization()
+ThreadSynchronization::~ThreadSynchronization()
{
}
-void UpdateRenderSynchronization::Start()
+void ThreadSynchronization::Start()
{
mFrameTime.SetMinimumFrameTimeInterval( mNumberOfVSyncsPerRender * TIME_PER_FRAME_IN_MICROSECONDS );
mRunning = true;
}
-void UpdateRenderSynchronization::Stop()
+void ThreadSynchronization::Stop()
{
mRunning = false;
mFrameTime.Suspend();
}
-void UpdateRenderSynchronization::Pause()
+void ThreadSynchronization::Pause()
{
mPaused = true;
mFrameTime.Suspend();
}
-void UpdateRenderSynchronization::ResumeFrameTime()
+void ThreadSynchronization::ResumeFrameTime()
{
mFrameTime.Resume();
}
-void UpdateRenderSynchronization::Resume()
+void ThreadSynchronization::Resume()
{
mPaused = false;
mVSyncSleep = false;
AddPerformanceMarker( PerformanceInterface::RESUME);
}
-void UpdateRenderSynchronization::UpdateRequested()
+void ThreadSynchronization::UpdateRequested()
{
mUpdateRequested = true;
mUpdateSleepCondition.notify_one();
}
-void UpdateRenderSynchronization::UpdateWhilePaused()
+void ThreadSynchronization::UpdateWhilePaused()
{
{
boost::unique_lock< boost::mutex > lock( mMutex );
mPausedCondition.notify_one();
}
-bool UpdateRenderSynchronization::ReplaceSurface( RenderSurface* newSurface )
+bool ThreadSynchronization::ReplaceSurface( RenderSurface* newSurface )
{
bool result=false;
return result;
}
-bool UpdateRenderSynchronization::NewSurface( RenderSurface* newSurface )
+bool ThreadSynchronization::NewSurface( RenderSurface* newSurface )
{
bool result=false;
}
-void UpdateRenderSynchronization::UpdateReadyToRun()
+void ThreadSynchronization::UpdateReadyToRun()
{
bool wokenFromPause( false );
AddPerformanceMarker( PerformanceInterface::UPDATE_START );
}
-bool UpdateRenderSynchronization::UpdateSyncWithRender( bool notifyEvent, bool& renderNeedsUpdate )
+bool ThreadSynchronization::UpdateSyncWithRender( bool notifyEvent, bool& renderNeedsUpdate )
{
AddPerformanceMarker( PerformanceInterface::UPDATE_END );
return mRunning;
}
-void UpdateRenderSynchronization::UpdateWaitForAllRenderingToFinish()
+void ThreadSynchronization::UpdateWaitForAllRenderingToFinish()
{
boost::unique_lock< boost::mutex > lock( mMutex );
}
}
-bool UpdateRenderSynchronization::UpdateTryToSleep()
+bool ThreadSynchronization::UpdateTryToSleep()
{
if ( !mUpdateRequired && !mUpdateRequested )
{
return mRunning;
}
-bool UpdateRenderSynchronization::RenderSyncWithRequest(RenderRequest*& requestPtr)
+bool ThreadSynchronization::RenderSyncWithRequest(RenderRequest*& requestPtr)
{
boost::unique_lock< boost::mutex > lock( mMutex );
return mRunning;
}
-bool UpdateRenderSynchronization::RenderSyncWithUpdate(RenderRequest*& requestPtr)
+bool ThreadSynchronization::RenderSyncWithUpdate(RenderRequest*& requestPtr)
{
boost::unique_lock< boost::mutex > lock( mMutex );
return mRunning;
}
-void UpdateRenderSynchronization::RenderFinished( bool updateRequired, bool requestProcessed )
+void ThreadSynchronization::RenderFinished( bool updateRequired, bool requestProcessed )
{
{
boost::unique_lock< boost::mutex > lock( mMutex );
AddPerformanceMarker( PerformanceInterface::RENDER_END );
}
-void UpdateRenderSynchronization::WaitSync()
+void ThreadSynchronization::WaitSync()
{
// Block until the start of a new sync.
// If we're experiencing slowdown and are behind by more than a frame
mAllowUpdateWhilePaused = false;
}
-bool UpdateRenderSynchronization::VSyncNotifierSyncWithUpdateAndRender( bool validSync, unsigned int frameNumber, unsigned int seconds, unsigned int microseconds, unsigned int& numberOfVSyncsPerRender )
+bool ThreadSynchronization::VSyncNotifierSyncWithUpdateAndRender( bool validSync, unsigned int frameNumber, unsigned int seconds, unsigned int microseconds, unsigned int& numberOfVSyncsPerRender )
{
// This may have changed since the last sync. Update VSyncNotifier's copy here if so.
if( numberOfVSyncsPerRender != mNumberOfVSyncsPerRender )
return mRunning;
}
-unsigned int UpdateRenderSynchronization::GetFrameNumber() const
+unsigned int ThreadSynchronization::GetFrameNumber() const
{
return mSyncFrameNumber;
}
-uint64_t UpdateRenderSynchronization::GetTimeMicroseconds()
+uint64_t ThreadSynchronization::GetTimeMicroseconds()
{
uint64_t currentTime(0);
return currentTime;
}
-void UpdateRenderSynchronization::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
+void ThreadSynchronization::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
{
mNumberOfVSyncsPerRender = numberOfVSyncsPerRender;
}
-inline void UpdateRenderSynchronization::AddPerformanceMarker( PerformanceInterface::MarkerType type )
+inline void ThreadSynchronization::AddPerformanceMarker( PerformanceInterface::MarkerType type )
{
if( mPerformanceInterface )
{
}
}
-void UpdateRenderSynchronization::PredictNextSyncTime(
+void ThreadSynchronization::PredictNextSyncTime(
float& lastFrameDeltaSeconds,
unsigned int& lastSyncTimeMilliseconds,
unsigned int& nextSyncTimeMilliseconds )
#define __DALI_INTERNAL_UPDATE_RENDER_SYNCHRONIZATION_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
* However the Core::Update() for frame N+2 may not be called, until the Core::Render() method for frame N has returned.
*
*/
-class UpdateRenderSynchronization
+class ThreadSynchronization
{
public:
* @param[in] adaptorInterfaces base adaptor interface
* @param[in] numberOfVSyncsPerRender The number of frames per render
*/
- UpdateRenderSynchronization( AdaptorInternalServices& adaptorInterfaces, unsigned int numberOfVSyncsPerRender );
+ ThreadSynchronization( AdaptorInternalServices& adaptorInterfaces, unsigned int numberOfVSyncsPerRender );
/**
* Non virtual destructor. Not intended as base class.
*/
- ~UpdateRenderSynchronization();
+ ~ThreadSynchronization();
/**
* Start the threads
private:
// Undefined copy constructor.
- UpdateRenderSynchronization( const UpdateRenderSynchronization& );
+ ThreadSynchronization( const ThreadSynchronization& );
// Undefined assignment operator.
- UpdateRenderSynchronization& operator=( const UpdateRenderSynchronization& );
+ ThreadSynchronization& operator=( const ThreadSynchronization& );
/**
* Helper to add a performance marker to the performance server (if its active)
ReplaceSurfaceRequest mReplaceSurfaceRequest; ///< Holder for a replace surface request
bool mReplaceSurfaceRequested; ///< True if there is a new replace surface request
-}; // class UpdateRenderSynchronization
+}; // class ThreadSynchronization
} // namespace Adaptor
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
// INTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <base/interfaces/adaptor-internal-services.h>
-#include <base/update-render-synchronization.h>
+#include <base/thread-synchronization.h>
#include <base/environment-options.h>
namespace Dali
#endif
} // unnamed namespace
-UpdateThread::UpdateThread( UpdateRenderSynchronization& sync,
+UpdateThread::UpdateThread( ThreadSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
const EnvironmentOptions& environmentOptions )
-: mUpdateRenderSync( sync ),
+: mThreadSync( sync ),
mCore( adaptorInterfaces.GetCore()),
mFpsTrackingSeconds( fabsf( environmentOptions.GetFrameRateLoggingFrequency() ) ),
mFrameCount( 0.0f ),
DALI_LOG_INFO( gUpdateLogFilter, Debug::Verbose, "UpdateThread::Run. 1 - Sync()\n");
// Inform synchronization object update is ready to run, this will pause update thread if required.
- mUpdateRenderSync.UpdateReadyToRun();
+ mThreadSync.UpdateReadyToRun();
DALI_LOG_INFO( gUpdateLogFilter, Debug::Verbose, "UpdateThread::Run. 2 - Ready()\n");
// get the last delta and the predict when this update will be rendered
float lastFrameDelta( 0.0f );
unsigned int lastSyncTime( 0 );
unsigned int nextSyncTime( 0 );
- mUpdateRenderSync.PredictNextSyncTime( lastFrameDelta, lastSyncTime, nextSyncTime );
+ mThreadSync.PredictNextSyncTime( lastFrameDelta, lastSyncTime, nextSyncTime );
DALI_LOG_INFO( gUpdateLogFilter, Debug::Verbose, "UpdateThread::Run. 3 - Update(delta:%f, lastSync:%u, nextSync:%u)\n", lastFrameDelta, lastSyncTime, nextSyncTime);
// tell the synchronisation class that a buffer has been written to,
// and to wait until there is a free buffer to write to
- running = mUpdateRenderSync.UpdateSyncWithRender( status.NeedsNotification(), renderNeedsUpdate );
+ running = mThreadSync.UpdateSyncWithRender( status.NeedsNotification(), renderNeedsUpdate );
DALI_LOG_INFO( gUpdateLogFilter, Debug::Verbose, "UpdateThread::Run. 4 - UpdateSyncWithRender complete\n");
if( running )
{
DALI_LOG_INFO( gUpdateLogFilter, Debug::Verbose, "UpdateThread::Run. 5 - Nothing to update, trying to sleep\n");
- running = mUpdateRenderSync.UpdateTryToSleep();
+ running = mThreadSync.UpdateTryToSleep();
}
}
}
namespace Adaptor
{
-class UpdateRenderSynchronization;
+class ThreadSynchronization;
class AdaptorInternalServices;
class EnvironmentOptions;
* @param[in] adaptorInterfaces base adaptor interface
* @param[in] environmentOptions environment options
*/
- UpdateThread(UpdateRenderSynchronization& sync,
+ UpdateThread(ThreadSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
const EnvironmentOptions& environmentOptions );
private: // Data
- UpdateRenderSynchronization& mUpdateRenderSync; ///< Used to synchronize the update & render threads
+ ThreadSynchronization& mThreadSync; ///< Used to synchronize all the threads
Dali::Integration::Core& mCore; ///< Dali core reference
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
// INTERNAL INCLUDES
#include <base/interfaces/adaptor-internal-services.h>
-#include <base/update-render-synchronization.h>
+#include <base/thread-synchronization.h>
#include <base/environment-options.h>
namespace Dali
} // unnamed namespace
-VSyncNotifier::VSyncNotifier( UpdateRenderSynchronization& sync,
+VSyncNotifier::VSyncNotifier( ThreadSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
const EnvironmentOptions& environmentOptions )
-: mUpdateRenderSync( sync ),
+: mThreadSync( sync ),
mCore( adaptorInterfaces.GetCore() ),
mPlatformAbstraction( adaptorInterfaces.GetPlatformAbstractionInterface() ),
mVSyncMonitor( adaptorInterfaces.GetVSyncMonitorInterface() ),
DALI_LOG_INFO( gSyncLogFilter, Debug::General, "VSyncNotifier::Run. 3 SyncWithUpdateAndRender(frame#:%d, current Sec:%u current uSec:%u)\n", frameNumber+1, currentSeconds, currentMicroseconds);
- running = mUpdateRenderSync.VSyncNotifierSyncWithUpdateAndRender( validSync, ++frameNumber, currentSeconds, currentMicroseconds, mNumberOfVSyncsPerRender );
+ running = mThreadSync.VSyncNotifierSyncWithUpdateAndRender( validSync, ++frameNumber, currentSeconds, currentMicroseconds, mNumberOfVSyncsPerRender );
// The number of vsyncs per render may have been modified by this call.
}
#define __DALI_INTERNAL_VSYNC_NOTIFIER_H__
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2015 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.
{
class VSyncMonitorInterface;
-class UpdateRenderSynchronization;
+class ThreadSynchronization;
class EnvironmentOptions;
class AdaptorInternalServices;
* @param[in] adaptorInterfaces base adaptor interface
* @param[in] environmentOptions environment options
*/
- VSyncNotifier( UpdateRenderSynchronization& sync,
+ VSyncNotifier( ThreadSynchronization& sync,
AdaptorInternalServices& adaptorInterfaces,
const EnvironmentOptions& environmentOptions);
private:
- UpdateRenderSynchronization& mUpdateRenderSync; ///< Used to synchronize the update, render & vsync threads
- Dali::Integration::Core& mCore; ///< Dali core reference
- Integration::PlatformAbstraction& mPlatformAbstraction; ///< The platform abstraction for retrieving the current time etc.
- VSyncMonitorInterface* mVSyncMonitor; ///< VSyncMonitor interface
- pthread_t* mThread; ///< The actual thread.
- const EnvironmentOptions& mEnvironmentOptions; ///< Environment options
- unsigned int mNumberOfVSyncsPerRender;///< How many frames for each update/render cycle.
+ ThreadSynchronization& mThreadSync; ///< Used to synchronize all the threads
+ Dali::Integration::Core& mCore; ///< Dali core reference
+ Integration::PlatformAbstraction& mPlatformAbstraction; ///< The platform abstraction for retrieving the current time etc.
+ VSyncMonitorInterface* mVSyncMonitor; ///< VSyncMonitor interface
+ pthread_t* mThread; ///< The actual thread.
+ const EnvironmentOptions& mEnvironmentOptions; ///< Environment options
+ unsigned int mNumberOfVSyncsPerRender; ///< How many frames for each update/render cycle.
}; // class VSyncNotifier
#include <dali/integration-api/events/touch-event-integ.h>
// INTERNAL INCLUDES
-#include <base/update-render-controller.h>
+#include <base/thread-controller.h>
#include <base/performance-logging/performance-interface-factory.h>
#include <base/lifecycle-observer.h>
mVSyncMonitor = new VSyncMonitor;
- mUpdateRenderController = new UpdateRenderController( *this, *mEnvironmentOptions );
+ mThreadController = new ThreadController( *this, *mEnvironmentOptions );
// Should be called after Core creation
if( mEnvironmentOptions->GetPanGestureLoggingLevel() )
(*iter)->OnDestroy();
}
- delete mUpdateRenderController; // this will shutdown render thread, which will call Core::ContextDestroyed before exit
+ delete mThreadController; // this will shutdown render thread, which will call Core::ContextDestroyed before exit
delete mVSyncMonitor;
delete mEventHandler;
delete mObjectProfiler;
PositionSize size = mSurface->GetPositionSize();
mCore->SurfaceResized( size.width, size.height );
- // Start the update & render threads
- mUpdateRenderController->Start();
+ // Start all the threads
+ mThreadController->Start();
mState = RUNNING;
mEventHandler->Pause();
}
- mUpdateRenderController->Pause();
+ mThreadController->Pause();
mCore->Suspend();
mState = PAUSED;
}
// We put ResumeFrameTime first, as this was originally called at the start of mCore->Resume()
// If there were events pending, mCore->Resume() will call
// RenderController->RequestUpdate()
- // UpdateRenderController->RequestUpdate()
- // UpdateRenderSynchronization->RequestUpdate()
+ // ThreadController->RequestUpdate()
+ // ThreadSynchronization->RequestUpdate()
// and we should have reset the frame timers before allowing Core->Update() to be called.
- //@todo Should we call UpdateRenderController->Resume before mCore->Resume()?
+ //@todo Should we call ThreadController->Resume before mCore->Resume()?
- mUpdateRenderController->ResumeFrameTime();
+ mThreadController->ResumeFrameTime();
mCore->Resume();
- mUpdateRenderController->Resume();
+ mThreadController->Resume();
mState = RUNNING;
(*iter)->OnStop();
}
- mUpdateRenderController->Stop();
+ mThreadController->Stop();
mCore->Suspend();
// Delete the TTS player
ProcessCoreEvents();
// this method blocks until the render thread has completed the replace.
- mUpdateRenderController->ReplaceSurface(mSurface);
+ mThreadController->ReplaceSurface(mSurface);
}
RenderSurface& Adaptor::GetSurface() const
void Adaptor::SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender )
{
- mUpdateRenderController->SetRenderRefreshRate( numberOfVSyncsPerRender );
+ mThreadController->SetRenderRefreshRate( numberOfVSyncsPerRender );
}
void Adaptor::SetUseHardwareVSync( bool useHardware )
if ( PAUSED == mState ||
RUNNING == mState )
{
- mUpdateRenderController->RequestUpdate();
+ mThreadController->RequestUpdate();
}
}
{
if( PAUSED_WHILE_HIDDEN != mState )
{
- if( mUpdateRenderController )
+ if( mThreadController )
{
- mUpdateRenderController->RequestUpdateOnce();
+ mThreadController->RequestUpdateOnce();
}
}
}
mAdaptor(adaptor),
mState(READY),
mCore(NULL),
- mUpdateRenderController(NULL),
+ mThreadController(NULL),
mVSyncMonitor(NULL),
mGLES( NULL ),
mEglFactory( NULL ),
class GestureManager;
class GlImplementation;
class GlSyncImplementation;
-class UpdateRenderController;
+class ThreadController;
class TriggerEvent;
class CallbackManager;
class FeedbackPluginProxy;
Dali::Adaptor& mAdaptor; ///< Reference to public adaptor instance.
State mState; ///< Current state of the adaptor
Dali::Integration::Core* mCore; ///< Dali Core
- UpdateRenderController* mUpdateRenderController; ///< Controls update/render threads
+ ThreadController* mThreadController; ///< Controls the threads
VSyncMonitor* mVSyncMonitor; ///< Monitors VSync events
GlImplementation* mGLES; ///< GL implementation
GlSyncImplementation* mGlSync; ///< GL Sync implementation