X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fcommon%2Fcore-impl.h;h=9744d0dfccdc19bfe29e84bd8c66cdaadf2c2ad6;hb=25c956766ad187b49a8539bee3bab95627f3593f;hp=47c7d1b07a5640fd91072bdb27b11991bf385e14;hpb=0b3c34fac06b29c53c88d3f843a3f63f8c446acc;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 100755 new mode 100644 index 47c7d1b..9744d0d --- 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) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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,39 +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 GlContextHelperAbstraction; +class PlatformAbstraction; class UpdateStatus; class RenderStatus; -class RenderSurface; struct Event; -struct TouchData; -} +struct TouchEvent; +} // namespace Integration namespace Internal { - class NotificationManager; class AnimationPlaylist; class PropertyNotificationManager; @@ -68,7 +68,7 @@ class UpdateManager; class RenderManager; class DiscardQueue; class RenderTaskProcessor; -} +} // namespace SceneGraph /** * Internal class for Dali::Integration::Core @@ -76,24 +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, - Integration::GlContextHelperAbstraction& glContextHelperAbstraction, - Integration::RenderToFrameBuffer renderToFboEnabled, - Integration::DepthBufferAvailable depthBufferAvailable, - Integration::StencilBufferAvailable stencilBufferAvailable, - Integration::PartialUpdateAvailable partialUpdateAvailable ); + 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() @@ -121,11 +118,6 @@ public: void RecoverFromContextLoss(); /** - * @copydoc Dali::Integration::Core::SurfaceDeleted(Integration::RenderSurface*) - */ - void SurfaceDeleted( Integration::RenderSurface* surface ); - - /** * @copydoc Dali::Integration::Core::SetMinimumFrameTimeInterval(uint32_t) */ void SetMinimumFrameTimeInterval(uint32_t interval); @@ -133,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); + + /** + * @copydoc Dali::Integration::Core::PreRender() + */ + void PreRender(Integration::RenderStatus& status, bool forceClear, bool uploadOnly); + + /** + * @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, bool uploadOnly ); + void PostRender(bool uploadOnly); /** * @copydoc Dali::Integration::Core::SceneCreated() @@ -148,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() @@ -163,34 +175,39 @@ 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; +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 @@ -205,7 +222,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 @@ -228,6 +245,11 @@ private: */ void RunProcessors(); + /** + * Run each registered postprocessor + */ + void RunPostProcessors(); + // for use by ThreadLocalStorage /** @@ -273,12 +295,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 */ @@ -296,13 +312,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 @@ -310,35 +332,36 @@ 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. + friend class ThreadLocalStorage; }; } // namespace Internal