X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fcommon%2Fcore-impl.h;h=6e02bb4876f5620474161db4c3c140ae18e9127e;hb=b43741a90b40ca9dfbd33d6a9d390d3c09230e89;hp=d4d19e2f69b5b6fca3937e4fe2faa9b48dd13538;hpb=b9455f1f8798591d4a67c7ac116c67c65c2efe62;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/common/core-impl.h b/dali/internal/common/core-impl.h old mode 100644 new mode 100755 index d4d19e2..6e02bb4 --- a/dali/internal/common/core-impl.h +++ b/dali/internal/common/core-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_CORE_H /* - * Copyright (c) 2018 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. @@ -24,10 +24,12 @@ #include #include #include +#include #include #include -#include #include +#include +#include namespace Dali { @@ -37,12 +39,12 @@ namespace Integration class Processor; class RenderController; class PlatformAbstraction; -class GestureManager; class GlAbstraction; class GlSyncAbstraction; -class SystemOverlay; +class GlContextHelperAbstraction; class UpdateStatus; class RenderStatus; +class RenderSurface; struct Event; struct TouchData; } @@ -58,6 +60,7 @@ class GestureEventProcessor; class ShaderFactory; class TouchResampler; class RelayoutController; +class EventThreadServices; namespace SceneGraph { @@ -70,7 +73,7 @@ class RenderTaskProcessor; /** * Internal class for Dali::Integration::Core */ -class Core +class Core : public EventThreadServices { public: @@ -81,11 +84,12 @@ public: Integration::PlatformAbstraction& platform, Integration::GlAbstraction& glAbstraction, Integration::GlSyncAbstraction& glSyncAbstraction, - Integration::GestureManager& gestureManager, + Integration::GlContextHelperAbstraction& glContextHelperAbstraction, ResourcePolicy::DataRetention dataRetentionPolicy, Integration::RenderToFrameBuffer renderToFboEnabled, Integration::DepthBufferAvailable depthBufferAvailable, - Integration::StencilBufferAvailable stencilBufferAvailable ); + Integration::StencilBufferAvailable stencilBufferAvailable, + Integration::PartialUpdateAvailable partialUpdateAvailable ); /** * Destructor @@ -93,6 +97,11 @@ public: ~Core(); /** + * @copydoc Dali::Integration::Core::Initialize() + */ + void Initialize(); + + /** * @copydoc Dali::Integration::Core::GetContextNotifier() */ Integration::ContextNotifierInterface* GetContextNotifier(); @@ -113,29 +122,19 @@ public: void RecoverFromContextLoss(); /** - * @copydoc Dali::Integration::Core::SurfaceResized(unsigned int, unsigned int) + * @copydoc Dali::Integration::Core::SurfaceDeleted(Integration::RenderSurface*) */ - void SurfaceResized(unsigned int width, unsigned int height); + void SurfaceDeleted( Integration::RenderSurface* surface ); /** - * @copydoc Dali::Integration::Core::SetTopMargin( unsigned int margin ) + * @copydoc Dali::Integration::Core::SetMinimumFrameTimeInterval(uint32_t) */ - void SetTopMargin( unsigned int margin ); - - /** - * @copydoc Dali::Integration::Core::SetDpi(unsigned int, unsigned int) - */ - void SetDpi(unsigned int dpiHorizontal, unsigned int dpiVertical); - - /** - * @copydoc Dali::Integration::Core::SetMinimumFrameTimeInterval(unsigned int) - */ - void SetMinimumFrameTimeInterval(unsigned int interval); + void SetMinimumFrameTimeInterval(uint32_t interval); /** * @copydoc Dali::Integration::Core::Update() */ - void Update( float elapsedSeconds, unsigned int lastVSyncTimeMilliseconds, unsigned int nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo ); + void Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo ); /** * @copydoc Dali::Integration::Core::Render() @@ -160,45 +159,69 @@ public: /** * @copydoc Dali::Integration::Core::GetMaximumUpdateCount() */ - unsigned int GetMaximumUpdateCount() const; + uint32_t GetMaximumUpdateCount() const; + + /** + * @copydoc Dali::Integration::Core::RegisterProcessor + */ + void RegisterProcessor( Dali::Integration::Processor& processor ); /** - * @copydoc Dali::Integration::Core::GetSystemOverlay() + * @copydoc Dali::Integration::Core::UnregisterProcessor */ - Integration::SystemOverlay& GetSystemOverlay(); + void UnregisterProcessor( Dali::Integration::Processor& processor ); - // Stereoscopy + /** + * @copydoc Dali::Internal::ThreadLocalStorage::AddScene() + */ + void AddScene( Scene* scene ); /** - * @copydoc Dali::Integration::Core::SetViewMode() + * @copydoc Dali::Internal::ThreadLocalStorage::RemoveScene() */ - void SetViewMode( ViewMode viewMode ); + void RemoveScene( Scene* scene ); + +public: // Implementation of EventThreadServices /** - * @copydoc Dali::Integration::Core::GetViewMode() + * @copydoc EventThreadServices::RegisterObject */ - ViewMode GetViewMode() const; + void RegisterObject( BaseObject* object) override; /** - * @copydoc Dali::Integration::Core::SetStereoBase() + * @copydoc EventThreadServices::UnregisterObject */ - void SetStereoBase( float stereoBase ); + void UnregisterObject( BaseObject* object) override; /** - * @copydoc Dali::Integration::Core::GetStereoBase() + * @copydoc EventThreadServices::GetUpdateManager */ - float GetStereoBase() const; + SceneGraph::UpdateManager& GetUpdateManager() override; + /** + * @copydoc EventThreadServices::GetRenderController + */ + Integration::RenderController& GetRenderController() override; /** - * @copydoc Dali::Integration::Core::RegisterProcessor + * @copydoc EventThreadServices::ReserveMessageSlot */ - void RegisterProcessor( Dali::Integration::Processor& processor ); + uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene ) override; /** - * @copydoc Dali::Integration::Core::UnregisterProcessor + * @copydoc EventThreadServices::GetEventBufferIndex */ - void UnregisterProcessor( Dali::Integration::Processor& processor ); + BufferIndex GetEventBufferIndex() const override; + + /** + * @copydoc EventThreadServices::ForceNextUpdate + */ + void ForceNextUpdate() override; + + /** + * @copydoc EventThreadServices::IsNextUpdateForced + */ + bool IsNextUpdateForced() override; private: /** @@ -221,12 +244,6 @@ private: 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. */ @@ -256,13 +273,37 @@ private: */ RelayoutController& GetRelayoutController(); + /** + * @brief Gets the Object registry. + * @return A reference to the object registry + */ + ObjectRegistry& GetObjectRegistry() const; + + /** + * @brief Gets the event thread services. + * @return A reference to the event thread services + */ + EventThreadServices& GetEventThreadServices(); + + /** + * @brief Gets the property notification manager. + * @return A reference to the property notification manager + */ + PropertyNotificationManager& GetPropertyNotificationManager() const; + + /** + * @brief Gets the animation play list. + * @return A reference to the animation play list + */ + 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 @@ -278,7 +319,6 @@ private: AnimationPlaylistOwner mAnimationPlaylist; ///< For 'Fire and forget' animation support OwnerPointer mPropertyNotificationManager; ///< For safe signal emmision of property changed notifications IntrusivePtr< RelayoutController > mRelayoutController; ///< Size negotiation relayout controller - bool mProcessingEvent : 1; ///< True during ProcessEvents() OwnerPointer mRenderTaskProcessor; ///< Handles the processing of render tasks OwnerPointer mRenderManager; ///< Render manager @@ -287,9 +327,17 @@ private: OwnerPointer mShaderFactory; ///< Shader resource factory OwnerPointer mNotificationManager; ///< Notification manager OwnerPointer mGestureEventProcessor; ///< The gesture event processor - OwnerPointer mEventProcessor; ///< The event processor Dali::Vector mProcessors; ///< Registered processors (not owned) + using SceneContainer = std::vector; + SceneContainer 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; };