-#ifndef __DALI_INTERNAL_THREAD_CONTROLLER_H__
-#define __DALI_INTERNAL_THREAD_CONTROLLER_H__
+#ifndef DALI_INTERNAL_THREAD_CONTROLLER_H
+#define DALI_INTERNAL_THREAD_CONTROLLER_H
/*
- * Copyright (c) 2017 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.
* limitations under the License.
*
*/
+#include <dali/public-api/signals/callback.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/display-connection.h>
namespace Dali
{
-
-class RenderSurface;
+class RenderSurfaceInterface;
namespace Internal
{
-
namespace Adaptor
{
+enum class UpdateMode;
+enum class ThreadMode;
class AdaptorInternalServices;
class EnvironmentOptions;
class ThreadController
{
public:
-
/**
* Constructor
*/
- ThreadController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions );
+ ThreadController(AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions, ThreadMode threadMode);
/**
* Non virtual destructor. Not intended as base class.
* @brief Called by the adaptor when core requires one update
*
* @note If Adaptor is paused, we do one update/render only
+ *
+ * @param updateMode The update mode (i.e. either update and render, or update and upload without rendering)
*/
- void RequestUpdateOnce();
+ void RequestUpdateOnce(UpdateMode updateMode);
/**
* @brief Replaces the surface.
*
* @param surface new surface
*/
- void ReplaceSurface( RenderSurface* surface );
+ void ReplaceSurface(Dali::RenderSurfaceInterface* surface);
+
+ /**
+ * Deletes the surface.
+ * @param surface The surface to be deleted
+ */
+ void DeleteSurface(Dali::RenderSurfaceInterface* surface);
/**
* Resize the surface.
void ResizeSurface();
/**
+ * Wait until the graphics is initialised.
+ */
+ void WaitForGraphicsInitialization();
+
+ /**
* @copydoc Dali::Adaptor::SetRenderRefreshRate()
*/
- void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender );
+ void SetRenderRefreshRate(unsigned int numberOfVSyncsPerRender);
-private:
+ /**
+ * @copydoc Dali::Adaptor::SetPreRenderCallback
+ */
+ void SetPreRenderCallback(CallbackBase* callback);
+
+ /**
+ * @brief Adds the new surface.
+ *
+ * @param surface new surface
+ */
+ void AddSurface(Dali::RenderSurfaceInterface* surface);
+
+ /**
+ * @brief Gets the thread id.
+ * @note If thread id getter doesn't supported, it will return 0 as default.
+ * @return The thread id.
+ */
+ int32_t GetThreadId() const;
+private:
// Undefined copy constructor.
- ThreadController( const ThreadController& );
+ ThreadController(const ThreadController&) = delete;
// Undefined assignment operator.
- ThreadController& operator=( const ThreadController& );
+ ThreadController& operator=(const ThreadController&) = delete;
private:
-
ThreadControllerInterface* mThreadControllerInterface;
};
} // namespace Dali
-#endif // __DALI_INTERNAL_THREAD_CONTROLLER_H__
+#endif // DALI_INTERNAL_THREAD_CONTROLLER_H