From: Eunki, Hong Date: Thu, 30 Dec 2021 09:31:47 +0000 (+0900) Subject: Add Awake API in ProcessController to call Process hard. X-Git-Tag: dali_2.1.4~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca1a242c98485dc70f2db2479ff84c423f8a2901;p=platform%2Fcore%2Fuifw%2Fdali-csharp-binder.git Add Awake API in ProcessController to call Process hard. When DALi-related API doesn't called, DALi think there is nothing to update --> ProcessController doesn't call the callback functions. This patch make Awake API so NUI can awak DALi event & update thread hardly. Change-Id: Ia21ffd48c5ae46ae6f6c58b5baa0261e2563f4da Signed-off-by: Eunki, Hong --- diff --git a/dali-csharp-binder/src/processor-controller.cpp b/dali-csharp-binder/src/processor-controller.cpp index a355aae..cceb87c 100644 --- a/dali-csharp-binder/src/processor-controller.cpp +++ b/dali-csharp-binder/src/processor-controller.cpp @@ -19,6 +19,7 @@ #include "processor-controller.h" // EXTERNAL INCLUDES +#include #include #ifdef __cplusplus @@ -26,7 +27,8 @@ extern "C" { #endif ProcessorController::ProcessorController() -: mHandler(nullptr) +: mHandler(nullptr), + mKeepRenderingApplied(false) { { try @@ -51,6 +53,7 @@ ProcessorController::~ProcessorController() void ProcessorController::Process(bool postProcessor) { mHandler(); + mKeepRenderingApplied = false; } void ProcessorController::SetCallback( ProcessorControllerProcessCallback callback ) @@ -63,6 +66,19 @@ void ProcessorController::RemoveCallback( ProcessorControllerProcessCallback ca mHandler = nullptr; } +void ProcessorController::Awake() +{ + if(DALI_UNLIKELY(!mKeepRenderingApplied)) + { + if(DALI_LIKELY(Dali::Stage::IsInstalled())) + { + auto stage = Dali::Stage::GetCurrent(); + stage.KeepRendering(0.0f); + mKeepRenderingApplied = true; + } + } +} + // ProcessorController Bindings SWIGEXPORT void * SWIGSTDCALL CSharp_Dali_new_ProcessorController() { @@ -107,6 +123,16 @@ SWIGEXPORT void SWIGSTDCALL CSharp_Dali_ProcessorController_RemoveCallback( void } } +SWIGEXPORT void SWIGSTDCALL CSharp_Dali_ProcessorController_Awake( void* jarg1 ) +{ + ProcessorController* processorController = (ProcessorController *) jarg1; + + if( processorController ) + { + processorController->Awake(); + } +} + #ifdef __cplusplus } #endif \ No newline at end of file diff --git a/dali-csharp-binder/src/processor-controller.h b/dali-csharp-binder/src/processor-controller.h index 807e479..ddeef5a 100644 --- a/dali-csharp-binder/src/processor-controller.h +++ b/dali-csharp-binder/src/processor-controller.h @@ -66,9 +66,15 @@ public: */ void RemoveCallback( ProcessorControllerProcessCallback callback ); + /** + * @brief Awake update thread so dali-core calls the overriden Process() api. + */ + void Awake(); + private: ProcessorControllerProcessCallback mHandler; + bool mKeepRenderingApplied; ///< True if we call Stage::KeepRendering(0.0f). It need to avoid duplicated keep rendering call }; #endif // CSHARP_PROCESSOR_CONTROLLER_H \ No newline at end of file