#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.
*/
// INTERNAL INCLUDES
-#include <dali/public-api/common/dali-vector.h>
-#include <dali/public-api/object/ref-object.h>
+#include <dali/devel-api/common/owner-container.h>
#include <dali/integration-api/context-notifier.h>
#include <dali/integration-api/core-enumerations.h>
+#include <dali/integration-api/resource-policies.h>
#include <dali/internal/common/owner-pointer.h>
-#include <dali/devel-api/common/owner-container.h>
#include <dali/internal/event/animation/animation-playlist-declarations.h>
-#include <dali/internal/event/common/stage-def.h>
-#include <dali/integration-api/resource-policies.h>
-#include <dali/internal/event/common/scene-impl.h>
#include <dali/internal/event/common/object-registry-impl.h>
+#include <dali/internal/event/common/scene-impl.h>
+#include <dali/internal/event/common/stage-def.h>
+#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/object/ref-object.h>
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;
struct Event;
-struct TouchData;
-}
+struct TouchEvent;
+} // namespace Integration
namespace Internal
{
-
class NotificationManager;
class AnimationPlaylist;
class PropertyNotificationManager;
class RenderManager;
class DiscardQueue;
class RenderTaskProcessor;
-}
+} // namespace SceneGraph
/**
* Internal class for Dali::Integration::Core
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 );
+ 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()
/**
* @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::Render()
+ * @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<Rect<int>>& damagedRects);
+
+ /**
+ * @copydoc Dali::Integration::Core::RenderScene()
*/
- void PreRender( Integration::RenderStatus& status, bool forceClear, bool uploadOnly );
+ 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 );
+ void RenderScene(Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo, Rect<int>& clippingRect);
/**
* @copydoc Dali::Integration::Core::Render()
*/
- void PostRender( bool uploadOnly );
+ void PostRender(bool uploadOnly);
/**
* @copydoc Dali::Integration::Core::SceneCreated()
/**
* @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()
/**
* @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
/**
* @copydoc EventThreadServices::ReserveMessageSlot
*/
- uint32_t* ReserveMessageSlot( uint32_t size, bool updateScene ) override;
+ uint32_t* ReserveMessageSlot(uint32_t size, bool updateScene) override;
/**
* @copydoc EventThreadServices::GetEventBufferIndex
*/
void RunProcessors();
+ /**
+ * Run each registered postprocessor
+ */
+ void RunPostProcessors();
+
// for use by ThreadLocalStorage
/**
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
*/
*/
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
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<Stage> mStage; ///< The current stage
AnimationPlaylistOwner mAnimationPlaylist; ///< For 'Fire and forget' animation support
OwnerPointer<PropertyNotificationManager> mPropertyNotificationManager; ///< For safe signal emmision of property changed notifications
- IntrusivePtr< RelayoutController > mRelayoutController; ///< Size negotiation relayout controller
-
- OwnerPointer<SceneGraph::RenderTaskProcessor> mRenderTaskProcessor; ///< Handles the processing of render tasks
- OwnerPointer<SceneGraph::RenderManager> mRenderManager; ///< Render manager
- OwnerPointer<SceneGraph::UpdateManager> mUpdateManager; ///< Update manager
- OwnerPointer<SceneGraph::DiscardQueue> mDiscardQueue; ///< Used to cleanup nodes & resources when no longer in use.
- OwnerPointer<ShaderFactory> mShaderFactory; ///< Shader resource factory
- OwnerPointer<NotificationManager> mNotificationManager; ///< Notification manager
- OwnerPointer<GestureEventProcessor> mGestureEventProcessor; ///< The gesture event processor
- Dali::Vector<Integration::Processor*> mProcessors; ///< Registered processors (not owned)
+ IntrusivePtr<RelayoutController> mRelayoutController; ///< Size negotiation relayout controller
+
+ OwnerPointer<SceneGraph::RenderTaskProcessor> mRenderTaskProcessor; ///< Handles the processing of render tasks
+ OwnerPointer<SceneGraph::RenderManager> mRenderManager; ///< Render manager
+ OwnerPointer<SceneGraph::UpdateManager> mUpdateManager; ///< Update manager
+ OwnerPointer<SceneGraph::DiscardQueue> mDiscardQueue; ///< Used to cleanup nodes & resources when no longer in use.
+ OwnerPointer<ShaderFactory> mShaderFactory; ///< Shader resource factory
+ OwnerPointer<NotificationManager> mNotificationManager; ///< Notification manager
+ OwnerPointer<GestureEventProcessor> mGestureEventProcessor; ///< The gesture event processor
+ Dali::Vector<Integration::Processor*> mProcessors; ///< Registered processors (not owned)
+ Dali::Vector<Integration::Processor*> mPostProcessors; ///< Registered post processors those will called after relayout(not owned)
using SceneContainer = std::vector<ScenePtr>;
- 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