X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fcommon%2Fcore-impl.h;h=9272e16bb31971b69dad7409076c0ed13b93faa4;hb=79881246746f65474b24ea4fe14151ccef8df3f4;hp=d4aa55fe7315e85401e0dc10e1e78b6dcb708ef5;hpb=0ba3f763e7369e7b52a12cf759560dc329e14f2e;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/common/core-impl.h b/dali/internal/common/core-impl.h index d4aa55f..9272e16 100644 --- 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) 2020 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,9 +24,12 @@ #include #include #include +#include #include #include #include +#include +#include namespace Dali { @@ -36,9 +39,9 @@ namespace Integration class Processor; class RenderController; class PlatformAbstraction; -class GestureManager; class GlAbstraction; class GlSyncAbstraction; +class GlContextHelperAbstraction; class UpdateStatus; class RenderStatus; struct Event; @@ -56,6 +59,7 @@ class GestureEventProcessor; class ShaderFactory; class TouchResampler; class RelayoutController; +class EventThreadServices; namespace SceneGraph { @@ -68,7 +72,7 @@ class RenderTaskProcessor; /** * Internal class for Dali::Integration::Core */ -class Core +class Core : public EventThreadServices { public: @@ -79,8 +83,7 @@ public: Integration::PlatformAbstraction& platform, Integration::GlAbstraction& glAbstraction, Integration::GlSyncAbstraction& glSyncAbstraction, - Integration::GestureManager& gestureManager, - ResourcePolicy::DataRetention dataRetentionPolicy, + Integration::GlContextHelperAbstraction& glContextHelperAbstraction, Integration::RenderToFrameBuffer renderToFboEnabled, Integration::DepthBufferAvailable depthBufferAvailable, Integration::StencilBufferAvailable stencilBufferAvailable ); @@ -91,6 +94,11 @@ public: ~Core(); /** + * @copydoc Dali::Integration::Core::Initialize() + */ + void Initialize(); + + /** * @copydoc Dali::Integration::Core::GetContextNotifier() */ Integration::ContextNotifierInterface* GetContextNotifier(); @@ -111,34 +119,29 @@ public: void RecoverFromContextLoss(); /** - * @copydoc Dali::Integration::Core::SurfaceResized(uint32_t, uint32_t) - */ - void SurfaceResized(uint32_t width, uint32_t height); - - /** - * @copydoc Dali::Integration::Core::SetTopMargin( uint32_t margin ) + * @copydoc Dali::Integration::Core::SetMinimumFrameTimeInterval(uint32_t) */ - void SetTopMargin( uint32_t margin ); + void SetMinimumFrameTimeInterval(uint32_t interval); /** - * @copydoc Dali::Integration::Core::SetDpi(uint32_t, uint32_t) + * @copydoc Dali::Integration::Core::Update() */ - void SetDpi(uint32_t dpiHorizontal, uint32_t dpiVertical); + void Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo ); /** - * @copydoc Dali::Integration::Core::SetMinimumFrameTimeInterval(uint32_t) + * @copydoc Dali::Integration::Core::Render() */ - void SetMinimumFrameTimeInterval(uint32_t interval); + void PreRender( Integration::RenderStatus& status, bool forceClear, bool uploadOnly ); /** - * @copydoc Dali::Integration::Core::Update() + * @copydoc Dali::Integration::Core::RenderScene() */ - void Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t nextVSyncTimeMilliseconds, Integration::UpdateStatus& status, bool renderToFboEnabled, bool isRenderingToFbo ); + void RenderScene( Integration::Scene& scene, bool renderToFbo ); /** * @copydoc Dali::Integration::Core::Render() */ - void Render( Integration::RenderStatus& status, bool forceClear ); + void PostRender( bool uploadOnly ); /** * @copydoc Dali::Integration::Core::SceneCreated() @@ -170,6 +173,58 @@ public: */ void UnregisterProcessor( Dali::Integration::Processor& processor ); + /** + * @copydoc Dali::Internal::ThreadLocalStorage::AddScene() + */ + void AddScene( Scene* scene ); + + /** + * @copydoc Dali::Internal::ThreadLocalStorage::RemoveScene() + */ + void RemoveScene( Scene* scene ); + +public: // Implementation of EventThreadServices + + /** + * @copydoc EventThreadServices::RegisterObject + */ + void RegisterObject( BaseObject* object) override; + + /** + * @copydoc EventThreadServices::UnregisterObject + */ + void UnregisterObject( BaseObject* object) override; + + /** + * @copydoc EventThreadServices::GetUpdateManager + */ + SceneGraph::UpdateManager& GetUpdateManager() override; + + /** + * @copydoc EventThreadServices::GetRenderController + */ + Integration::RenderController& GetRenderController() override; + + /** + * @copydoc EventThreadServices::ReserveMessageSlot + */ + uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene ) override; + + /** + * @copydoc EventThreadServices::GetEventBufferIndex + */ + BufferIndex GetEventBufferIndex() const override; + + /** + * @copydoc EventThreadServices::ForceNextUpdate + */ + void ForceNextUpdate() override; + + /** + * @copydoc EventThreadServices::IsNextUpdateForced + */ + bool IsNextUpdateForced() override; + private: /** * Run each registered processor @@ -191,12 +246,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. */ @@ -226,13 +275,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 @@ -248,7 +321,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 @@ -257,9 +329,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; };