/*
- * 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.
#include <dali/internal/system/common/thread-controller.h>
// INTERNAL INCLUDES
-#include <dali/internal/system/common/environment-options.h>
-#include <dali/internal/adaptor/common/thread-controller-interface.h>
#include <dali/internal/adaptor/common/combined-update-render-controller.h>
+#include <dali/internal/adaptor/common/thread-controller-interface.h>
+#include <dali/internal/system/common/environment-options.h>
namespace Dali
{
-
namespace Internal
{
-
namespace Adaptor
{
-
-ThreadController::ThreadController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions )
-: mThreadControllerInterface( NULL )
+ThreadController::ThreadController(AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions, ThreadMode threadMode)
+: mThreadControllerInterface(NULL)
{
- switch( environmentOptions.GetThreadingMode() )
+ switch(environmentOptions.GetThreadingMode())
{
case ThreadingMode::COMBINED_UPDATE_RENDER:
{
- mThreadControllerInterface = new CombinedUpdateRenderController( adaptorInterfaces, environmentOptions );
+ mThreadControllerInterface = new CombinedUpdateRenderController(adaptorInterfaces, environmentOptions, threadMode);
break;
}
}
mThreadControllerInterface->RequestUpdate();
}
-void ThreadController::RequestUpdateOnce()
+void ThreadController::RequestUpdateOnce(UpdateMode updateMode)
{
- mThreadControllerInterface->RequestUpdateOnce();
+ mThreadControllerInterface->RequestUpdateOnce(updateMode);
}
-void ThreadController::ReplaceSurface( RenderSurface* newSurface )
+void ThreadController::ReplaceSurface(Dali::RenderSurfaceInterface* newSurface)
{
- mThreadControllerInterface->ReplaceSurface( newSurface );
+ mThreadControllerInterface->ReplaceSurface(newSurface);
+}
+
+void ThreadController::DeleteSurface(Dali::RenderSurfaceInterface* surface)
+{
+ mThreadControllerInterface->DeleteSurface(surface);
}
void ThreadController::ResizeSurface()
mThreadControllerInterface->ResizeSurface();
}
-void ThreadController::SetRenderRefreshRate(unsigned int numberOfVSyncsPerRender )
+void ThreadController::WaitForGraphicsInitialization()
+{
+ mThreadControllerInterface->WaitForGraphicsInitialization();
+}
+
+void ThreadController::SetRenderRefreshRate(unsigned int numberOfVSyncsPerRender)
+{
+ mThreadControllerInterface->SetRenderRefreshRate(numberOfVSyncsPerRender);
+}
+
+void ThreadController::SetPreRenderCallback(CallbackBase* callback)
+{
+ mThreadControllerInterface->SetPreRenderCallback(callback);
+}
+
+void ThreadController::AddSurface(Dali::RenderSurfaceInterface* newSurface)
+{
+ mThreadControllerInterface->AddSurface(newSurface);
+}
+
+int32_t ThreadController::GetThreadId() const
{
- mThreadControllerInterface->SetRenderRefreshRate( numberOfVSyncsPerRender );
+ return mThreadControllerInterface->GetThreadId();
}
} // namespace Adaptor