Dali 3D User Interface Engine
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
Dali::Internal::Adaptor::SingleThreadController Class Reference

Single Thread Controller, where events, updates & renders ALL occur on the same thread. More...

#include <single-thread-controller.h>

Inheritance diagram for Dali::Internal::Adaptor::SingleThreadController:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::Adaptor::SingleThreadController:
Collaboration graph
[legend]

Classes

struct  State
 State Machine. More...
 

Public Member Functions

 SingleThreadController (AdaptorInternalServices &adaptorInterfaces, const EnvironmentOptions &environmentOptions)
 Constructor. More...
 
 ~SingleThreadController ()
 Non virtual destructor. More...
 
void Initialize ()
 Initializes the thread controller. More...
 
void Start ()
  More...
 
void Pause ()
  More...
 
void Resume ()
  More...
 
void Stop ()
  More...
 
void RequestUpdate ()
 Called by the adaptor when core requires another update. More...
 
void RequestUpdateOnce ()
 Called by the adaptor when core requires one update If Adaptor is paused, we do one update and return to pause. More...
 
void ReplaceSurface (RenderSurface *surface)
 Replaces the surface. More...
 
void SetRenderRefreshRate (unsigned int refreshRate)
  More...
 
- Public Member Functions inherited from Dali::ConnectionTracker
 ConnectionTracker ()
 Constructor. More...
 
virtual ~ConnectionTracker ()
 Virtual destructor. More...
 
void DisconnectAll ()
 Disconnect all signals from this object. More...
 
virtual void SignalConnected (SlotObserver *slotObserver, CallbackBase *callback)
 Called when a signal is connected. More...
 
virtual void SignalDisconnected (SlotObserver *slotObserver, CallbackBase *callback)
 This method is called when the signal is disconnecting. More...
 
std::size_t GetConnectionCount () const
 returns the connection count .0 More...
 
- Public Member Functions inherited from Dali::ConnectionTrackerInterface
 ConnectionTrackerInterface ()
 Constructor. More...
 
virtual ~ConnectionTrackerInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from Dali::SignalObserver
 SignalObserver ()
 Constructor. More...
 
virtual ~SignalObserver ()
 Virtual destructor. More...
 
- Public Member Functions inherited from Dali::Internal::Adaptor::ThreadControllerInterface
virtual ~ThreadControllerInterface ()
 Virtual destructor. More...
 

Private Member Functions

 SingleThreadController (const SingleThreadController &)
 
SingleThreadControlleroperator= (const SingleThreadController &)
 
bool OnTimerTick ()
 Ticks whenever the timer expires. More...
 
void UpdateRender (bool incrementTime)
 Runs the update and render. More...
 
float UpdateTimeSinceLastRender ()
 Updates mCurrentTime and gets the time elapsed (in seconds) since last time this function was called. More...
 
void AddPerformanceMarker (PerformanceInterface::MarkerType type)
 Helper to add a performance marker to the performance server (if it's active) More...
 
void ChangeState (State::Type state)
 Changes the state and performs any other state-change related functionality. More...
 
void StopRendering ()
 Performs operations to stop rendering, e.g. More...
 

Private Attributes

Dali::Timer mTimer
 Ensures an update & render is run every frame. More...
 
FpsTracker mFpsTracker
 Object that tracks the FPS. More...
 
UpdateStatusLogger mUpdateStatusLogger
 Object that logs the update-status as required. More...
 
RenderHelper mRenderHelper
 Helper class for EGL, pre & post rendering. More...
 
Integration::CoremCore
 DALi core reference. More...
 
PerformanceInterfacemPerformanceInterface
 The performance logging interface. More...
 
uint64_t mLastUpdateRenderTime
 Last time we did an update and render. More...
 
uint64_t mSystemTime
 The current system time for FPS calculations. More...
 
unsigned int mRefreshRate
 Frame skipping count. More...
 
State::Type mState
 The state. More...
 
bool mUpdatingAndRendering:1
 Set to true when we are updating and rendering. More...
 
bool mStopRequestedWhileRendering:1
 Set to true if we were told to stop while we were in the middle of a render. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dali::Internal::Adaptor::ThreadControllerInterface
 ThreadControllerInterface ()
 Constructor. More...
 

Detailed Description

Single Thread Controller, where events, updates & renders ALL occur on the same thread.

Definition at line 51 of file single-thread-controller.h.

Constructor & Destructor Documentation

Dali::Internal::Adaptor::SingleThreadController::SingleThreadController ( AdaptorInternalServices adaptorInterfaces,
const EnvironmentOptions environmentOptions 
)

Constructor.

Definition at line 53 of file single-thread-controller.cpp.

References DALI_LOG_INFO.

Dali::Internal::Adaptor::SingleThreadController::~SingleThreadController ( )

Non virtual destructor.

Not intended as base class.

Definition at line 72 of file single-thread-controller.cpp.

References DALI_LOG_INFO, and Stop().

Here is the call graph for this function:

Dali::Internal::Adaptor::SingleThreadController::SingleThreadController ( const SingleThreadController )
private

Member Function Documentation

void Dali::Internal::Adaptor::SingleThreadController::AddPerformanceMarker ( PerformanceInterface::MarkerType  type)
private

Helper to add a performance marker to the performance server (if it's active)

Parameters
typeperformance marker type

Definition at line 308 of file single-thread-controller.cpp.

References Dali::Internal::Adaptor::PerformanceInterface::AddMarker(), and mPerformanceInterface.

Referenced by Pause(), Resume(), and UpdateRender().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::SingleThreadController::ChangeState ( State::Type  state)
private

Changes the state and performs any other state-change related functionality.

Parameters
[in]stateThe new state

Definition at line 316 of file single-thread-controller.cpp.

References mState, mTimer, Dali::Internal::Adaptor::SingleThreadController::State::PAUSED, Dali::Internal::Adaptor::SingleThreadController::State::RUNNING, Dali::Internal::Adaptor::SingleThreadController::State::SLEEPING, Dali::Timer::Start(), Dali::Timer::Stop(), and Dali::Internal::Adaptor::SingleThreadController::State::STOPPED.

Referenced by Pause(), RequestUpdate(), Resume(), Start(), Stop(), and UpdateRender().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::SingleThreadController::Initialize ( void  )
virtual
bool Dali::Internal::Adaptor::SingleThreadController::OnTimerTick ( )
private

Ticks whenever the timer expires.

Definition at line 210 of file single-thread-controller.cpp.

References DALI_LOG_INFO, mState, mStopRequestedWhileRendering, Dali::Internal::Adaptor::SingleThreadController::State::RUNNING, Dali::Internal::Adaptor::SingleThreadController::State::STOPPED, StopRendering(), and UpdateRender().

Referenced by Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

SingleThreadController& Dali::Internal::Adaptor::SingleThreadController::operator= ( const SingleThreadController )
private
void Dali::Internal::Adaptor::SingleThreadController::Pause ( )
virtual
void Dali::Internal::Adaptor::SingleThreadController::ReplaceSurface ( RenderSurface *  surface)
virtual

Replaces the surface.

Parameters
surfacenew surface

Implements Dali::Internal::Adaptor::ThreadControllerInterface.

Definition at line 189 of file single-thread-controller.cpp.

References DALI_LOG_INFO, mRenderHelper, and Dali::Internal::Adaptor::RenderHelper::ReplaceSurface().

Here is the call graph for this function:

void Dali::Internal::Adaptor::SingleThreadController::RequestUpdate ( )
virtual
void Dali::Internal::Adaptor::SingleThreadController::RequestUpdateOnce ( )
virtual
void Dali::Internal::Adaptor::SingleThreadController::Resume ( )
virtual
void Dali::Internal::Adaptor::SingleThreadController::SetRenderRefreshRate ( unsigned int  refreshRate)
virtual
void Dali::Internal::Adaptor::SingleThreadController::Start ( )
virtual
void Dali::Internal::Adaptor::SingleThreadController::Stop ( )
virtual
void Dali::Internal::Adaptor::SingleThreadController::StopRendering ( )
private

Performs operations to stop rendering, e.g.

informing Core of context being destroyed & shutting down EGL.

Definition at line 337 of file single-thread-controller.cpp.

References Dali::Integration::Core::ContextDestroyed(), mCore, mRenderHelper, Dali::Internal::Adaptor::RenderHelper::ShutdownEgl(), and Dali::Internal::Adaptor::RenderHelper::Stop().

Referenced by OnTimerTick(), and Stop().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Adaptor::SingleThreadController::UpdateRender ( bool  incrementTime)
private

Runs the update and render.

Parameters
[in]incrementTimeIf true, then the animation times are incremented.

Definition at line 232 of file single-thread-controller.cpp.

References AddPerformanceMarker(), ChangeState(), Dali::Internal::Adaptor::RenderHelper::ConsumeEvents(), DALI_LOG_INFO, Dali::Integration::RenderStatus::HasRendered(), Dali::Integration::UpdateStatus::KeepUpdating(), Dali::Internal::Adaptor::UpdateStatusLogger::Log(), mCore, mFpsTracker, Dali::Internal::Adaptor::anonymous_namespace{single-thread-controller.cpp}::MILLISECONDS_PER_FRAME, mLastUpdateRenderTime, mRefreshRate, mRenderHelper, mState, mUpdateStatusLogger, mUpdatingAndRendering, Dali::Integration::RenderStatus::NeedsUpdate(), Dali::Internal::Adaptor::RenderHelper::PostRender(), Dali::Internal::Adaptor::RenderHelper::PreRender(), Dali::Integration::Core::Render(), Dali::Internal::Adaptor::PerformanceInterface::RENDER_END, Dali::Internal::Adaptor::PerformanceInterface::RENDER_START, Dali::Internal::Adaptor::anonymous_namespace{single-thread-controller.cpp}::SECONDS_PER_FRAME, Dali::Internal::Adaptor::SingleThreadController::State::SLEEPING, Dali::Internal::Adaptor::SingleThreadController::State::STOPPED, Dali::Internal::Adaptor::FpsTracker::Track(), Dali::Integration::Core::Update(), Dali::Internal::Adaptor::PerformanceInterface::UPDATE_END, Dali::Internal::Adaptor::PerformanceInterface::UPDATE_START, and UpdateTimeSinceLastRender().

Referenced by OnTimerTick(), RequestUpdate(), Resume(), and Start().

Here is the call graph for this function:

Here is the caller graph for this function:

float Dali::Internal::Adaptor::SingleThreadController::UpdateTimeSinceLastRender ( )
private

Updates mCurrentTime and gets the time elapsed (in seconds) since last time this function was called.

Returns
time elapsed (in seconds) since last call.

Definition at line 288 of file single-thread-controller.cpp.

References Dali::Internal::Adaptor::FpsTracker::Enabled(), Dali::Internal::Adaptor::TimeService::GetNanoseconds(), mFpsTracker, mSystemTime, and Dali::Internal::Adaptor::anonymous_namespace{single-thread-controller.cpp}::NANOSECONDS_TO_SECONDS().

Referenced by RequestUpdate(), Resume(), Start(), and UpdateRender().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Integration::Core& Dali::Internal::Adaptor::SingleThreadController::mCore
private

DALi core reference.

Definition at line 177 of file single-thread-controller.h.

Referenced by RequestUpdateOnce(), Start(), StopRendering(), and UpdateRender().

FpsTracker Dali::Internal::Adaptor::SingleThreadController::mFpsTracker
private

Object that tracks the FPS.

Definition at line 172 of file single-thread-controller.h.

Referenced by UpdateRender(), and UpdateTimeSinceLastRender().

uint64_t Dali::Internal::Adaptor::SingleThreadController::mLastUpdateRenderTime
private

Last time we did an update and render.

Definition at line 180 of file single-thread-controller.h.

Referenced by RequestUpdateOnce(), and UpdateRender().

PerformanceInterface* Dali::Internal::Adaptor::SingleThreadController::mPerformanceInterface
private

The performance logging interface.

Definition at line 178 of file single-thread-controller.h.

Referenced by AddPerformanceMarker().

unsigned int Dali::Internal::Adaptor::SingleThreadController::mRefreshRate
private

Frame skipping count.

Definition at line 182 of file single-thread-controller.h.

Referenced by Initialize(), RequestUpdateOnce(), SetRenderRefreshRate(), and UpdateRender().

RenderHelper Dali::Internal::Adaptor::SingleThreadController::mRenderHelper
private

Helper class for EGL, pre & post rendering.

Definition at line 175 of file single-thread-controller.h.

Referenced by ReplaceSurface(), RequestUpdateOnce(), Start(), StopRendering(), and UpdateRender().

State::Type Dali::Internal::Adaptor::SingleThreadController::mState
private
bool Dali::Internal::Adaptor::SingleThreadController::mStopRequestedWhileRendering
private

Set to true if we were told to stop while we were in the middle of a render.

Definition at line 185 of file single-thread-controller.h.

Referenced by OnTimerTick(), and Stop().

uint64_t Dali::Internal::Adaptor::SingleThreadController::mSystemTime
private

The current system time for FPS calculations.

Definition at line 181 of file single-thread-controller.h.

Referenced by UpdateTimeSinceLastRender().

Dali::Timer Dali::Internal::Adaptor::SingleThreadController::mTimer
private

Ensures an update & render is run every frame.

Definition at line 171 of file single-thread-controller.h.

Referenced by ChangeState(), Initialize(), and SetRenderRefreshRate().

UpdateStatusLogger Dali::Internal::Adaptor::SingleThreadController::mUpdateStatusLogger
private

Object that logs the update-status as required.

Definition at line 173 of file single-thread-controller.h.

Referenced by UpdateRender().

bool Dali::Internal::Adaptor::SingleThreadController::mUpdatingAndRendering
private

Set to true when we are updating and rendering.

Definition at line 184 of file single-thread-controller.h.

Referenced by Stop(), and UpdateRender().


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali