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

Internal class for Dali::Integration::Core. More...

#include <core-impl.h>

Collaboration diagram for Dali::Internal::Core:
Collaboration graph
[legend]

Public Member Functions

 Core (Integration::RenderController &renderController, Integration::PlatformAbstraction &platform, Integration::GlAbstraction &glAbstraction, Integration::GlSyncAbstraction &glSyncAbstraction, Integration::GestureManager &gestureManager, ResourcePolicy::DataRetention dataRetentionPolicy)
 Create and initialise a new Core instance. More...
 
 ~Core ()
 Destructor. More...
 
Integration::ContextNotifierInterfaceGetContextNotifier ()
 Get the object that will notify the application/toolkit when context is lost/regained. More...
 
void ContextCreated ()
 Notify the Core that the GL context has been created. More...
 
void ContextDestroyed ()
 Notify the Core that that GL context is about to be destroyed. More...
 
void RecoverFromContextLoss ()
 Notify the Core that the GL context has been re-created, e.g. More...
 
void SurfaceResized (unsigned int width, unsigned int height)
 Notify the Core that the GL surface has been resized. More...
 
void SetDpi (unsigned int dpiHorizontal, unsigned int dpiVertical)
 Notify the Core about the display's DPI values. More...
 
void SetMinimumFrameTimeInterval (unsigned int interval)
  More...
 
void Update (float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, Integration::UpdateStatus &status)
 Update the scene for the next frame. More...
 
void Render (Integration::RenderStatus &status)
 Render the next frame. More...
 
void Suspend ()
 Put Core into the suspended state. More...
 
void Resume ()
 Resume the Core from the suspended state. More...
 
void SceneCreated ()
 Notify Core that the scene has been created. More...
 
void QueueEvent (const Integration::Event &event)
  More...
 
void ProcessEvents ()
 Process the events queued with QueueEvent(). More...
 
void UpdateTouchData (const Integration::TouchData &touch)
 Update external raw touch data in core. More...
 
unsigned int GetMaximumUpdateCount () const
 The Core::Update() method prepares a frame for rendering. More...
 
Integration::SystemOverlayGetSystemOverlay ()
 Use the SystemOverlay to draw content for system-level indicators, dialogs etc. More...
 
void SetViewMode (ViewMode viewMode)
 Set the stereoscopic 3D view mode. More...
 
ViewMode GetViewMode () const
 Get the current view mode. More...
 
void SetStereoBase (float stereoBase)
 Set the stereo base (eye seperation) for stereoscopic 3D. More...
 
float GetStereoBase () const
 Get the stereo base (eye seperation) for stereoscopic 3D. More...
 

Private Member Functions

StagePtr GetCurrentStage ()
 Returns the current stage. More...
 
Integration::PlatformAbstractionGetPlatform ()
 Returns the platform abstraction. More...
 
SceneGraph::UpdateManagerGetUpdateManager ()
 Returns the update manager. More...
 
SceneGraph::RenderManagerGetRenderManager ()
 Returns the render manager. More...
 
NotificationManagerGetNotificationManager ()
 Returns the notification manager. More...
 
ResourceManagerGetResourceManager ()
 Returns the Resource Manager. More...
 
ResourceClientGetResourceClient ()
 Returns the Resource client. More...
 
ImageFactoryGetImageFactory ()
 Returns the Image factory. More...
 
ShaderFactoryGetShaderFactory ()
 Returns the Shader factory. More...
 
GestureEventProcessorGetGestureEventProcessor ()
 Returns the gesture event processor. More...
 
RelayoutControllerGetRelayoutController ()
 Return the relayout controller Return a reference to the relayout controller. More...
 
 Core (const Core &core)
 Undefined copy and assignment operators. More...
 
Coreoperator= (const Core &core)
 
void CreateThreadLocalStorage ()
 Create Thread local storage. More...
 

Private Attributes

Integration::RenderControllermRenderController
 Reference to Render controller to tell it to keep rendering. More...
 
Integration::PlatformAbstractionmPlatform
 The interface providing platform specific services. More...
 
IntrusivePtr< StagemStage
 The current stage. More...
 
GestureEventProcessormGestureEventProcessor
 The gesture event processor. More...
 
EventProcessormEventProcessor
 The event processor. More...
 
SceneGraph::UpdateManagermUpdateManager
 Update manager. More...
 
SceneGraph::RenderManagermRenderManager
 Render manager. More...
 
SceneGraph::DiscardQueuemDiscardQueue
 Used to cleanup nodes & resources when no longer in use. More...
 
ResourcePostProcessListmResourcePostProcessQueue
 Stores resource ids which require post processing after render. More...
 
NotificationManagermNotificationManager
 Notification manager. More...
 
AnimationPlaylistOwner mAnimationPlaylist
 For 'Fire and forget' animation support. More...
 
OwnerPointer
< PropertyNotificationManager
mPropertyNotificationManager
 For safe signal emmision of property changed notifications. More...
 
ImageFactorymImageFactory
 Image resource factory. More...
 
ShaderFactorymShaderFactory
 Shader resource factory. More...
 
ResourceClientmResourceClient
 Asynchronous Resource Loading. More...
 
ResourceManagermResourceManager
 Asynchronous Resource Loading. More...
 
TouchResamplermTouchResampler
 Resamples touches to correct frame rate. More...
 
IntrusivePtr< RelayoutControllermRelayoutController
 Size negotiation relayout controller. More...
 
bool mIsActive: 1
 Whether Core is active or suspended. More...
 
bool mProcessingEvent: 1
 True during ProcessEvents() More...
 

Friends

class ThreadLocalStorage
 

Detailed Description

Internal class for Dali::Integration::Core.

Definition at line 73 of file core-impl.h.

Constructor & Destructor Documentation

Dali::Internal::Core::Core ( Integration::RenderController renderController,
Integration::PlatformAbstraction platform,
Integration::GlAbstraction glAbstraction,
Integration::GlSyncAbstraction glSyncAbstraction,
Integration::GestureManager gestureManager,
ResourcePolicy::DataRetention  dataRetentionPolicy 
)

Create and initialise a new Core instance.

Dali::Internal::Core::~Core ( )

Destructor.

Dali::Internal::Core::Core ( const Core core)
private

Undefined copy and assignment operators.

Member Function Documentation

void Dali::Internal::Core::ContextCreated ( )

Notify the Core that the GL context has been created.

The context must be created before the Core can render. Multi-threading note: this method should be called from the rendering thread only

Postcondition
The Core is aware of the GL context.
void Dali::Internal::Core::ContextDestroyed ( )

Notify the Core that that GL context is about to be destroyed.

The Core will free any previously allocated GL resources. Multi-threading note: this method should be called from the rendering thread only

Postcondition
The Core is unaware of any GL context.
void Dali::Internal::Core::CreateThreadLocalStorage ( )
private

Create Thread local storage.

Definition at line 453 of file core-impl.cpp.

Integration::ContextNotifierInterface* Dali::Internal::Core::GetContextNotifier ( )

Get the object that will notify the application/toolkit when context is lost/regained.

StagePtr Dali::Internal::Core::GetCurrentStage ( )
private

Returns the current stage.

Returns
A smart-pointer to the current stage.

Definition at line 398 of file core-impl.cpp.

GestureEventProcessor & Dali::Internal::Core::GetGestureEventProcessor ( )
private

Returns the gesture event processor.

Returns
A reference to the gesture event processor.

Definition at line 443 of file core-impl.cpp.

ImageFactory & Dali::Internal::Core::GetImageFactory ( )
private

Returns the Image factory.

Returns
A reference to the Image factory.

Definition at line 433 of file core-impl.cpp.

unsigned int Dali::Internal::Core::GetMaximumUpdateCount ( ) const

The Core::Update() method prepares a frame for rendering.

This method determines how many frames may be prepared, ahead of the rendering. For example if the maximum update count is 2, then Core::Update() for frame N+1 may be processed whilst frame N is being rendered. However the Core::Update() for frame N+2 may not be called, until the Core::Render() method for frame N has returned.

Returns
The maximum update count (>= 1).
NotificationManager & Dali::Internal::Core::GetNotificationManager ( )
private

Returns the notification manager.

Returns
A reference to the Notification Manager.

Definition at line 418 of file core-impl.cpp.

PlatformAbstraction & Dali::Internal::Core::GetPlatform ( )
private

Returns the platform abstraction.

Returns
A reference to the platform abstraction.

Definition at line 403 of file core-impl.cpp.

RelayoutController & Dali::Internal::Core::GetRelayoutController ( )
private

Return the relayout controller Return a reference to the relayout controller.

Definition at line 448 of file core-impl.cpp.

RenderManager & Dali::Internal::Core::GetRenderManager ( )
private

Returns the render manager.

Returns
A reference to the render manager.

Definition at line 413 of file core-impl.cpp.

ResourceClient & Dali::Internal::Core::GetResourceClient ( )
private

Returns the Resource client.

Returns
A reference to the Resource Client.

Definition at line 428 of file core-impl.cpp.

ResourceManager & Dali::Internal::Core::GetResourceManager ( )
private

Returns the Resource Manager.

Returns
A reference to the Resource Manager.

Definition at line 423 of file core-impl.cpp.

ShaderFactory & Dali::Internal::Core::GetShaderFactory ( )
private

Returns the Shader factory.

Returns
A reference to the Shader binary factory.

Definition at line 438 of file core-impl.cpp.

float Dali::Internal::Core::GetStereoBase ( ) const

Get the stereo base (eye seperation) for stereoscopic 3D.

Returns
The stereo base (eye seperation) for stereoscopic 3D (mm)
Integration::SystemOverlay& Dali::Internal::Core::GetSystemOverlay ( )

Use the SystemOverlay to draw content for system-level indicators, dialogs etc.

Returns
The SystemOverlay.
UpdateManager & Dali::Internal::Core::GetUpdateManager ( )
private

Returns the update manager.

Returns
A reference to the update manager.

Definition at line 408 of file core-impl.cpp.

ViewMode Dali::Internal::Core::GetViewMode ( ) const

Get the current view mode.

Returns
The current view mode
See Also
SetViewMode.
Core& Dali::Internal::Core::operator= ( const Core core)
private
void Dali::Internal::Core::ProcessEvents ( )

Process the events queued with QueueEvent().

Multi-threading note: this method should be called from the main thread.

Precondition
ProcessEvents should not be called during ProcessEvents.
void Dali::Internal::Core::QueueEvent ( const Integration::Event &  event)

Definition at line 306 of file core-impl.cpp.

void Dali::Internal::Core::RecoverFromContextLoss ( )

Notify the Core that the GL context has been re-created, e.g.

after ReplaceSurface or Context loss.

In the case of ReplaceSurface, both ContextToBeDestroyed() and ContextCreated() will have been called on the render thread before this is called on the event thread.

Multi-threading note: this method should be called from the main thread

void Dali::Internal::Core::Render ( Integration::RenderStatus status)

Render the next frame.

This method should be preceded by a call up Update. Multi-threading note: this method should be called from a dedicated rendering thread.

Precondition
The GL context must have been created, and made current.
Parameters
[out]statusshowing whether update is required to run.
void Dali::Internal::Core::Resume ( )

Resume the Core from the suspended state.

At the first update, the elapsed time passed to the animations will be equal to the time spent suspended. Multi-threading note: this method should be called from the main thread

Postcondition
The Core is not in the suspended state.
void Dali::Internal::Core::SceneCreated ( )

Notify Core that the scene has been created.

void Dali::Internal::Core::SetDpi ( unsigned int  dpiHorizontal,
unsigned int  dpiVertical 
)

Notify the Core about the display's DPI values.

This should be done after the display is initialized and a Core instance is created. The Core will use the DPI values for font rendering. Multi-threading note: this method should be called from the main thread

Parameters
[in]dpiHorizontalHorizontal DPI value.
[in]dpiVerticalVertical DPI value.
void Dali::Internal::Core::SetMinimumFrameTimeInterval ( unsigned int  interval)

void Dali::Internal::Core::SetStereoBase ( float  stereoBase)

Set the stereo base (eye seperation) for stereoscopic 3D.

Parameters
[in]stereoBaseThe stereo base (eye seperation) for stereoscopic 3D (mm)
void Dali::Internal::Core::SetViewMode ( ViewMode  viewMode)

Set the stereoscopic 3D view mode.

Parameters
[in]viewModeThe new view mode
void Dali::Internal::Core::SurfaceResized ( unsigned int  width,
unsigned int  height 
)

Notify the Core that the GL surface has been resized.

This should be done at least once i.e. after the first call to ContextCreated(). The Core will use the surface size for camera calculations, and to set the GL viewport. Multi-threading note: this method should be called from the main thread

Parameters
[in]widthThe new surface width.
[in]heightThe new surface height.
void Dali::Internal::Core::Suspend ( )

Put Core into the suspended state.

Any ongoing event processing will be cancelled, for example multi-touch sequences. The core expects the system has suspended us. Animation time will continue during the suspended state. Multi-threading note: this method should be called from the main thread

Postcondition
The Core is in the suspended state.
void Dali::Internal::Core::Update ( float  elapsedSeconds,
unsigned int  lastVSyncTimeMilliseconds,
unsigned int  nextVSyncTimeMilliseconds,
Integration::UpdateStatus status 
)

Update the scene for the next frame.

This method must be called before each frame is rendered. Multi-threading notes: this method should be called from a dedicated update-thread. The update for frame N+1 may be processed whilst frame N is being rendered. 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.

Parameters
[in]elapsedSecondsNumber of seconds since the last call
[in]lastVSyncTimeMillisecondsThe last vsync time in milliseconds
[in]nextVSyncTimeMillisecondsThe time of the next predicted VSync in milliseconds
[out]statusshowing whether further updates are required. This also shows whether a Notification event should be sent, regardless of whether the multi-threading is used.
void Dali::Internal::Core::UpdateTouchData ( const Integration::TouchData touch)

Update external raw touch data in core.

The core will use the touch data to generate Dali Touch/Gesture events for applications to use in the update thread.

Parameters
[in]touchThe raw touch data.
Note
This can be called from either the event thread OR a dedicated touch thread.

Friends And Related Function Documentation

friend class ThreadLocalStorage
friend

Definition at line 305 of file core-impl.h.

Member Data Documentation

AnimationPlaylistOwner Dali::Internal::Core::mAnimationPlaylist
private

For 'Fire and forget' animation support.

Definition at line 293 of file core-impl.h.

SceneGraph::DiscardQueue* Dali::Internal::Core::mDiscardQueue
private

Used to cleanup nodes & resources when no longer in use.

Definition at line 290 of file core-impl.h.

EventProcessor* Dali::Internal::Core::mEventProcessor
private

The event processor.

Definition at line 287 of file core-impl.h.

GestureEventProcessor* Dali::Internal::Core::mGestureEventProcessor
private

The gesture event processor.

Definition at line 286 of file core-impl.h.

ImageFactory* Dali::Internal::Core::mImageFactory
private

Image resource factory.

Definition at line 295 of file core-impl.h.

bool Dali::Internal::Core::mIsActive
private

Whether Core is active or suspended.

Definition at line 302 of file core-impl.h.

NotificationManager* Dali::Internal::Core::mNotificationManager
private

Notification manager.

Definition at line 292 of file core-impl.h.

Integration::PlatformAbstraction& Dali::Internal::Core::mPlatform
private

The interface providing platform specific services.

Definition at line 283 of file core-impl.h.

bool Dali::Internal::Core::mProcessingEvent
private

True during ProcessEvents()

Definition at line 303 of file core-impl.h.

OwnerPointer<PropertyNotificationManager> Dali::Internal::Core::mPropertyNotificationManager
private

For safe signal emmision of property changed notifications.

Definition at line 294 of file core-impl.h.

IntrusivePtr< RelayoutController > Dali::Internal::Core::mRelayoutController
private

Size negotiation relayout controller.

Definition at line 300 of file core-impl.h.

Integration::RenderController& Dali::Internal::Core::mRenderController
private

Reference to Render controller to tell it to keep rendering.

Definition at line 282 of file core-impl.h.

SceneGraph::RenderManager* Dali::Internal::Core::mRenderManager
private

Render manager.

Definition at line 289 of file core-impl.h.

ResourceClient* Dali::Internal::Core::mResourceClient
private

Asynchronous Resource Loading.

Definition at line 297 of file core-impl.h.

ResourceManager* Dali::Internal::Core::mResourceManager
private

Asynchronous Resource Loading.

Definition at line 298 of file core-impl.h.

ResourcePostProcessList* Dali::Internal::Core::mResourcePostProcessQueue
private

Stores resource ids which require post processing after render.

Definition at line 291 of file core-impl.h.

ShaderFactory* Dali::Internal::Core::mShaderFactory
private

Shader resource factory.

Definition at line 296 of file core-impl.h.

IntrusivePtr<Stage> Dali::Internal::Core::mStage
private

The current stage.

Definition at line 285 of file core-impl.h.

TouchResampler* Dali::Internal::Core::mTouchResampler
private

Resamples touches to correct frame rate.

Definition at line 299 of file core-impl.h.

SceneGraph::UpdateManager* Dali::Internal::Core::mUpdateManager
private

Update manager.

Definition at line 288 of file core-impl.h.


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