X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fcommon%2Fcore-impl.h;h=5c21a44f66a220a5d308266af4c928498cf3ec92;hb=c8e0d2807617b0ba441ae67e735512bf6f3c1c68;hp=f596ae9baa22f881e909de92a381db54bce5207b;hpb=31d9a2df58c30e4661e245da1fc9f24973a3d72c;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/common/core-impl.h b/dali/internal/common/core-impl.h index f596ae9..5c21a44 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) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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,38 +19,39 @@ */ // INTERNAL INCLUDES -#include -#include +#include #include #include +#include #include -#include #include -#include -#include -#include #include +#include +#include +#include +#include namespace Dali { +namespace Graphics +{ +class Controller; +} namespace Integration { class Processor; class RenderController; -class PlatformAbstraction; class GlAbstraction; -class GlSyncAbstraction; +class PlatformAbstraction; class UpdateStatus; class RenderStatus; -class RenderSurface; struct Event; -struct TouchData; -} +struct TouchEvent; +} // namespace Integration namespace Internal { - class NotificationManager; class AnimationPlaylist; class PropertyNotificationManager; @@ -67,7 +68,7 @@ class UpdateManager; class RenderManager; class DiscardQueue; class RenderTaskProcessor; -} +} // namespace SceneGraph /** * Internal class for Dali::Integration::Core @@ -75,23 +76,21 @@ class RenderTaskProcessor; class Core : public EventThreadServices { public: - /** * Create and initialise a new Core instance */ - Core( Integration::RenderController& renderController, - Integration::PlatformAbstraction& platform, - Integration::GlAbstraction& glAbstraction, - Integration::GlSyncAbstraction& glSyncAbstraction, - ResourcePolicy::DataRetention dataRetentionPolicy, - Integration::RenderToFrameBuffer renderToFboEnabled, - Integration::DepthBufferAvailable depthBufferAvailable, - Integration::StencilBufferAvailable stencilBufferAvailable ); + Core(Integration::RenderController& renderController, + Integration::PlatformAbstraction& platform, + Graphics::Controller& graphicsController, + Integration::RenderToFrameBuffer renderToFboEnabled, + Integration::DepthBufferAvailable depthBufferAvailable, + Integration::StencilBufferAvailable stencilBufferAvailable, + Integration::PartialUpdateAvailable partialUpdateAvailable); /** * Destructor */ - ~Core(); + ~Core() override; /** * @copydoc Dali::Integration::Core::Initialize() @@ -119,11 +118,6 @@ public: void RecoverFromContextLoss(); /** - * @copydoc Dali::Integration::Core::SurfaceResized(Integration::RenderSurface*) - */ - void SurfaceResized( Integration::RenderSurface* surface ); - - /** * @copydoc Dali::Integration::Core::SetMinimumFrameTimeInterval(uint32_t) */ void SetMinimumFrameTimeInterval(uint32_t interval); @@ -131,12 +125,32 @@ public: /** * @copydoc Dali::Integration::Core::Update() */ - void Update( float elapsedSeconds, uint32_t lastVSyncTimeMilliseconds, uint32_t 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, bool uploadOnly); + + /** + * @copydoc Dali::Integration::Core::PreRender() + */ + void PreRender(Integration::RenderStatus& status, bool forceClear); + + /** + * @copydoc Dali::Integration::Core::PreRender() + */ + void PreRender(Integration::Scene& scene, std::vector>& damagedRects); + + /** + * @copydoc Dali::Integration::Core::RenderScene() + */ + void RenderScene(Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo); + + /** + * @copydoc Dali::Integration::Core::RenderScene() + */ + void RenderScene(Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect& clippingRect); /** * @copydoc Dali::Integration::Core::Render() */ - void Render( Integration::RenderStatus& status, bool forceClear ); + void PostRender(); /** * @copydoc Dali::Integration::Core::SceneCreated() @@ -146,7 +160,7 @@ public: /** * @copydoc Dali::Integration::Core::QueueEvent(const Integration::Event&) */ - void QueueEvent( const Integration::Event& event ); + void QueueEvent(const Integration::Event& event); /** * @copydoc Dali::Integration::Core::ProcessEvents() @@ -161,34 +175,44 @@ public: /** * @copydoc Dali::Integration::Core::RegisterProcessor */ - void RegisterProcessor( Dali::Integration::Processor& processor ); + void RegisterProcessor(Integration::Processor& processor, bool postProcessor = false); /** * @copydoc Dali::Integration::Core::UnregisterProcessor */ - void UnregisterProcessor( Dali::Integration::Processor& processor ); + void UnregisterProcessor(Dali::Integration::Processor& processor, bool postProcessor = false); /** * @copydoc Dali::Internal::ThreadLocalStorage::AddScene() */ - void AddScene( Scene* scene ); + void AddScene(Scene* scene); /** * @copydoc Dali::Internal::ThreadLocalStorage::RemoveScene() */ - void RemoveScene( Scene* scene ); + void RemoveScene(Scene* scene); -public: // Implementation of EventThreadServices + /** + * @brief Gets the Object registry. + * @return A reference to the object registry + */ + ObjectRegistry& GetObjectRegistry() const; + + /** + * Log the capacity of DALi memory pools + */ + void LogMemoryPools() const; +public: // Implementation of EventThreadServices /** * @copydoc EventThreadServices::RegisterObject */ - void RegisterObject( BaseObject* object) override; + void RegisterObject(BaseObject* object) override; /** * @copydoc EventThreadServices::UnregisterObject */ - void UnregisterObject( BaseObject* object) override; + void UnregisterObject(BaseObject* object) override; /** * @copydoc EventThreadServices::GetUpdateManager @@ -203,7 +227,7 @@ public: // Implementation of EventThreadServices /** * @copydoc EventThreadServices::ReserveMessageSlot */ - uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene ) override; + uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene) override; /** * @copydoc EventThreadServices::GetEventBufferIndex @@ -226,6 +250,11 @@ private: */ void RunProcessors(); + /** + * Run each registered postprocessor + */ + void RunPostProcessors(); + // for use by ThreadLocalStorage /** @@ -271,12 +300,6 @@ 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 */ @@ -294,13 +317,19 @@ private: */ AnimationPlaylist& GetAnimationPlaylist() const; -private: + /** + * @brief Returns GlAbstraction. + * @note Use only for the capability. Do not use this for bypass context + * @return GlAbstraction + */ + Integration::GlAbstraction& GetGlAbstraction() const; +private: /** * Undefined copy and assignment operators */ - Core(const Core& core) = delete; // No definition - Core& operator=(const Core& core) = delete; // No definition + Core(const Core& core) = delete; // No definition + Core& operator=(const Core& core) = delete; // No definition /** * Create Thread local storage @@ -308,35 +337,38 @@ private: void CreateThreadLocalStorage(); private: - - Integration::RenderController& mRenderController; ///< Reference to Render controller to tell it to keep rendering - Integration::PlatformAbstraction& mPlatform; ///< The interface providing platform specific services. + Integration::RenderController& mRenderController; ///< Reference to Render controller to tell it to keep rendering + Integration::PlatformAbstraction& mPlatform; ///< The interface providing platform specific services. IntrusivePtr mStage; ///< The current stage 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 - - 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) + IntrusivePtr 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) + Dali::Vector mPostProcessors; ///< Registered post processors those will called after relayout(not owned) using SceneContainer = std::vector; - SceneContainer mScenes; ///< A container of scenes that bound to a surface for rendering, owned by Core + SceneContainer mScenes; ///< A container of scenes that bound to a surface for rendering, owned by Core // The object registry - ObjectRegistryPtr mObjectRegistry; + ObjectRegistryPtr mObjectRegistry; - bool mProcessingEvent : 1; ///< True during ProcessEvents() - bool mForceNextUpdate:1; ///< True if the next rendering is really required. + Graphics::Controller& mGraphicsController; - friend class ThreadLocalStorage; + bool mProcessingEvent : 1; ///< True during ProcessEvents() + bool mForceNextUpdate : 1; ///< True if the next rendering is really required. + bool mProcessorUnregistered : 1; ///< True if the processor is unregistered during RunProcessors() + bool mPostProcessorUnregistered : 1; ///< True if the post-processor is unregistered during RunPostProcessors() + friend class ThreadLocalStorage; }; } // namespace Internal