X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fcommon%2Fcore-impl.h;h=9105f7a62173113aeb837d60ad43829bdc125cd7;hb=2ada356619fc41af1f590e9d471352d8ce475a83;hp=6e88bc4e56181903853f8adb37bd6868062cd137;hpb=6c5bbf8060630f544d3e9031b2127d0c23c40207;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/common/core-impl.h b/dali/internal/common/core-impl.h index 6e88bc4..9105f7a 100644 --- a/dali/internal/common/core-impl.h +++ b/dali/internal/common/core-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_INTERNAL_CORE_H__ -#define __DALI_INTERNAL_CORE_H__ +#ifndef DALI_INTERNAL_CORE_H +#define DALI_INTERNAL_CORE_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -19,28 +19,31 @@ */ // INTERNAL INCLUDES +#include #include #include +#include #include +#include #include #include -#include -#include #include +#include +#include namespace Dali { namespace Integration { +class Processor; class RenderController; class PlatformAbstraction; -class GestureManager; class GlAbstraction; class GlSyncAbstraction; -class SystemOverlay; class UpdateStatus; class RenderStatus; +class RenderSurface; struct Event; struct TouchData; } @@ -51,29 +54,25 @@ namespace Internal class NotificationManager; class AnimationPlaylist; class PropertyNotificationManager; -class Context; class EventProcessor; class GestureEventProcessor; -class ResourceClient; -class ResourceManager; -class FontFactory; -class ImageFactory; -class ModelFactory; class ShaderFactory; class TouchResampler; -class EmojiFactory; +class RelayoutController; +class EventThreadServices; namespace SceneGraph { class UpdateManager; class RenderManager; class DiscardQueue; +class RenderTaskProcessor; } /** * Internal class for Dali::Integration::Core */ -class Core +class Core : public EventThreadServices { public: @@ -84,8 +83,10 @@ public: Integration::PlatformAbstraction& platform, Integration::GlAbstraction& glAbstraction, Integration::GlSyncAbstraction& glSyncAbstraction, - Integration::GestureManager& gestureManager, - ResourcePolicy::DataRetention dataRetentionPolicy ); + ResourcePolicy::DataRetention dataRetentionPolicy, + Integration::RenderToFrameBuffer renderToFboEnabled, + Integration::DepthBufferAvailable depthBufferAvailable, + Integration::StencilBufferAvailable stencilBufferAvailable ); /** * Destructor @@ -93,6 +94,11 @@ public: ~Core(); /** + * @copydoc Dali::Integration::Core::Initialize() + */ + void Initialize(); + + /** * @copydoc Dali::Integration::Core::GetContextNotifier() */ Integration::ContextNotifierInterface* GetContextNotifier(); @@ -113,93 +119,114 @@ public: void RecoverFromContextLoss(); /** - * @copydoc Dali::Integration::Core::SurfaceResized(unsigned int, unsigned int) + * @copydoc Dali::Integration::Core::SurfaceResized(Integration::RenderSurface*) */ - void SurfaceResized(unsigned int width, unsigned int height); + void SurfaceResized( Integration::RenderSurface* surface ); /** - * @copydoc Dali::Integration::Core::SetDpi(unsigned int, unsigned int) + * @copydoc Dali::Integration::Core::SetMinimumFrameTimeInterval(uint32_t) */ - void SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical); + void SetMinimumFrameTimeInterval(uint32_t interval); /** - * @copydoc Dali::Integration::Core::SetMinimumFrameTimeInterval(unsigned int) + * @copydoc Dali::Integration::Core::Update() */ - void SetMinimumFrameTimeInterval(unsigned int interval); + void Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo ); /** - * @copydoc Dali::Integration::Core::Update() + * @copydoc Dali::Integration::Core::Render() */ - void Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, Integration::UpdateStatus& status ); + void Render( Integration::RenderStatus& status, bool forceClear ); /** - * @copydoc Dali::Integration::Core::Render() + * @copydoc Dali::Integration::Core::SceneCreated() */ - void Render( Integration::RenderStatus& status ); + void SceneCreated(); /** - * @copydoc Dali::Integration::Core::Suspend() + * @copydoc Dali::Integration::Core::QueueEvent(const Integration::Event&) */ - void Suspend(); + void QueueEvent( const Integration::Event& event ); /** - * @copydoc Dali::Integration::Core::Resume() + * @copydoc Dali::Integration::Core::ProcessEvents() */ - void Resume(); + void ProcessEvents(); /** - * @copydoc Dali::Integration::Core::SceneCreated() + * @copydoc Dali::Integration::Core::GetMaximumUpdateCount() */ - void SceneCreated(); + uint32_t GetMaximumUpdateCount() const; /** - * @copydoc Dali::Integration::Core::QueueEvent(const Integration::Event&) + * @copydoc Dali::Integration::Core::RegisterProcessor */ - void QueueEvent( const Integration::Event& event ); + void RegisterProcessor( Dali::Integration::Processor& processor ); /** - * @copydoc Dali::Integration::Core::ProcessEvents() + * @copydoc Dali::Integration::Core::UnregisterProcessor */ - void ProcessEvents(); + void UnregisterProcessor( Dali::Integration::Processor& processor ); /** - * @copydoc Dali::Integration::Core::UpdateTouchData(const Integration::TouchData&) + * @copydoc Dali::Internal::ThreadLocalStorage::AddScene() */ - void UpdateTouchData(const Integration::TouchData& touch); + void AddScene( Scene* scene ); /** - * @copydoc Dali::Integration::Core::GetMaximumUpdateCount() + * @copydoc Dali::Internal::ThreadLocalStorage::RemoveScene() + */ + void RemoveScene( Scene* scene ); + +public: // Implementation of EventThreadServices + + /** + * @copydoc EventThreadServices::RegisterObject + */ + void RegisterObject( BaseObject* object) override; + + /** + * @copydoc EventThreadServices::UnregisterObject */ - unsigned int GetMaximumUpdateCount() const; + void UnregisterObject( BaseObject* object) override; /** - * @copydoc Dali::Integration::Core::GetSystemOverlay() + * @copydoc EventThreadServices::GetUpdateManager */ - Integration::SystemOverlay& GetSystemOverlay(); + SceneGraph::UpdateManager& GetUpdateManager() override; - // Stereoscopy + /** + * @copydoc EventThreadServices::GetRenderController + */ + Integration::RenderController& GetRenderController() override; /** - * @copydoc Dali::Integration::Core::SetViewMode() + * @copydoc EventThreadServices::ReserveMessageSlot */ - void SetViewMode( ViewMode viewMode ); + uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene ) override; /** - * @copydoc Dali::Integration::Core::GetViewMode() + * @copydoc EventThreadServices::GetEventBufferIndex */ - ViewMode GetViewMode() const; + BufferIndex GetEventBufferIndex() const override; /** - * @copydoc Dali::Integration::Core::SetStereoBase() + * @copydoc EventThreadServices::ForceNextUpdate */ - void SetStereoBase( float stereoBase ); + void ForceNextUpdate() override; /** - * @copydoc Dali::Integration::Core::GetStereoBase() + * @copydoc EventThreadServices::IsNextUpdateForced */ - float GetStereoBase() const; + bool IsNextUpdateForced() override; -private: // for use by ThreadLocalStorage +private: + /** + * Run each registered processor + */ + void RunProcessors(); + + // for use by ThreadLocalStorage /** * Returns the current stage. @@ -214,12 +241,6 @@ private: // for use by ThreadLocalStorage Integration::PlatformAbstraction& GetPlatform(); /** - * Returns the update manager. - * @return A reference to the update manager. - */ - SceneGraph::UpdateManager& GetUpdateManager(); - - /** * Returns the render manager. * @return A reference to the render manager. */ @@ -232,60 +253,54 @@ private: // for use by ThreadLocalStorage NotificationManager& GetNotificationManager(); /** - * Returns the Resource Manager. - * @return A reference to the Resource Manager. - */ - ResourceManager& GetResourceManager(); - - /** - * Returns the Resource client. - * @return A reference to the Resource Client. + * Returns the Shader factory + * @return A reference to the Shader binary factory. */ - ResourceClient& GetResourceClient(); + ShaderFactory& GetShaderFactory(); /** - * Returns the Font factory - * @return A reference to the Font factory. + * Returns the gesture event processor. + * @return A reference to the gesture event processor. */ - FontFactory& GetFontFactory(); + GestureEventProcessor& GetGestureEventProcessor(); /** - * Returns the Image factory - * @return A reference to the Image factory. + * Return the relayout controller + * @Return Return a reference to the relayout controller */ - ImageFactory& GetImageFactory(); + RelayoutController& GetRelayoutController(); /** - * Returns the Model factory - * @return A reference to the Model factory. + * @brief Gets the Object registry. + * @return A reference to the object registry */ - ModelFactory& GetModelFactory(); + ObjectRegistry& GetObjectRegistry() const; /** - * Returns the Shader factory - * @return A reference to the Shader binary factory. + * @brief Gets the event thread services. + * @return A reference to the event thread services */ - ShaderFactory& GetShaderFactory(); + EventThreadServices& GetEventThreadServices(); /** - * Returns the gesture event processor. - * @return A reference to the gesture event processor. + * @brief Gets the property notification manager. + * @return A reference to the property notification manager */ - GestureEventProcessor& GetGestureEventProcessor(); + PropertyNotificationManager& GetPropertyNotificationManager() const; /** - * Returns the Emoji factory. - * @return a reference to the Emoji factory. + * @brief Gets the animation play list. + * @return A reference to the animation play list */ - EmojiFactory& GetEmojiFactory(); + AnimationPlaylist& GetAnimationPlaylist() const; private: /** * Undefined copy and assignment operators */ - Core(const Core& core); // No definition - Core& operator=(const Core& core); // No definition + Core(const Core& core) = delete; // No definition + Core& operator=(const Core& core) = delete; // No definition /** * Create Thread local storage @@ -298,26 +313,26 @@ private: Integration::PlatformAbstraction& mPlatform; ///< The interface providing platform specific services. IntrusivePtr mStage; ///< The current stage - GestureEventProcessor* mGestureEventProcessor; ///< The gesture event processor - EventProcessor* mEventProcessor; ///< The event processor - SceneGraph::UpdateManager* mUpdateManager; ///< Update manager - SceneGraph::RenderManager* mRenderManager; ///< Render manager - SceneGraph::DiscardQueue* mDiscardQueue; ///< Used to cleanup nodes & resources when no longer in use. - ResourcePostProcessList* mResourcePostProcessQueue; ///< Stores resource ids which require post processing after render - NotificationManager* mNotificationManager; ///< Notification manager AnimationPlaylistOwner mAnimationPlaylist; ///< For 'Fire and forget' animation support OwnerPointer mPropertyNotificationManager; ///< For safe signal emmision of property changed notifications - FontFactory* mFontFactory; ///< font resource factory - ImageFactory* mImageFactory; ///< Image resource factory - ModelFactory* mModelFactory; ///< Model resource factory - ShaderFactory* mShaderFactory; ///< Shader resource factory - ResourceClient* mResourceClient; ///< Asynchronous Resource Loading - ResourceManager* mResourceManager; ///< Asynchronous Resource Loading - TouchResampler* mTouchResampler; ///< Resamples touches to correct frame rate. - EmojiFactory* mEmojiFactory; ///< Emoji resource factory. - - bool mIsActive : 1; ///< Whether Core is active or suspended + IntrusivePtr< RelayoutController > mRelayoutController; ///< Size negotiation relayout controller + + OwnerPointer mRenderTaskProcessor; ///< Handles the processing of render tasks + OwnerPointer mRenderManager; ///< Render manager + OwnerPointer mUpdateManager; ///< Update manager + OwnerPointer mDiscardQueue; ///< Used to cleanup nodes & resources when no longer in use. + OwnerPointer mShaderFactory; ///< Shader resource factory + OwnerPointer mNotificationManager; ///< Notification manager + OwnerPointer mGestureEventProcessor; ///< The gesture event processor + Dali::Vector mProcessors; ///< Registered processors (not owned) + + std::vector mScenes; ///< A container of scenes that bound to a surface for rendering, owned by Core + + // The object registry + ObjectRegistryPtr mObjectRegistry; + bool mProcessingEvent : 1; ///< True during ProcessEvents() + bool mForceNextUpdate:1; ///< True if the next rendering is really required. friend class ThreadLocalStorage; @@ -327,4 +342,4 @@ private: } // namespace Dali -#endif // __DALI_INTERNAL_CORE_H__ +#endif // DALI_INTERNAL_CORE_H