Implement ProcessorOnce 96/311796/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 28 May 2024 04:40:58 +0000 (13:40 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 28 May 2024 04:40:58 +0000 (13:40 +0900)
Since unregister processor during Process will give overhead,
we'd better make another container to process only once time
during ProcessCoreEvent.

Change-Id: I1725774504ed66c61ba159e843c14e4da953d2d3
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/integration-api/adaptor-framework/adaptor.h
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/common/adaptor.cpp

index ccfaf45..277646b 100644 (file)
@@ -442,6 +442,21 @@ public:
   void UnregisterProcessor(Integration::Processor& processor, bool postProcessor = false);
 
   /**
+   * @brief Register a processor implementing the Integration::Processor interface with dali-core.
+   * @param[in] processor the Processor to register
+   * @param[in] postProcessor set this processor required to be called after size negotiation. Default is false.
+   * @note registered processor will be unregistered automatically after process.
+   */
+  void RegisterProcessorOnce(Integration::Processor& processor, bool postProcessor = false);
+
+  /**
+   * @brief Unregister a previously registered once processor from dali-core.
+   * @param[in] processor the Processor to unregister
+   * @param[in] postProcessor True if the processor to be unregister is for post processor.
+   */
+  void UnregisterProcessorOnce(Integration::Processor& processor, bool postProcessor = false);
+
+  /**
    * @brief Get the list of windows created.
    * @return The list of windows
    */
index 5b1095e..1d73ef7 100644 (file)
@@ -1198,6 +1198,16 @@ void Adaptor::UnregisterProcessor(Integration::Processor& processor, bool postPr
   GetCore().UnregisterProcessor(processor, postProcessor);
 }
 
+void Adaptor::RegisterProcessorOnce(Integration::Processor& processor, bool postProcessor)
+{
+  GetCore().RegisterProcessorOnce(processor, postProcessor);
+}
+
+void Adaptor::UnregisterProcessorOnce(Integration::Processor& processor, bool postProcessor)
+{
+  GetCore().UnregisterProcessorOnce(processor, postProcessor);
+}
+
 bool Adaptor::IsMultipleWindowSupported() const
 {
   return mConfigurationManager->IsMultipleWindowSupported();
index 23459c3..a5badfe 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_IMPL_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -461,6 +461,16 @@ public:
   void UnregisterProcessor(Integration::Processor& processor, bool postProcessor);
 
   /**
+   * @copydoc Dali::Adaptor::RegisterProcessorOnce
+   */
+  void RegisterProcessorOnce(Integration::Processor& processor, bool postProcessor);
+
+  /**
+   * @coydoc Dali::Adaptor::UnregisterProcessorOnce
+   */
+  void UnregisterProcessorOnce(Integration::Processor& processor, bool postProcessor);
+
+  /**
    * Check MultipleWindow is supported
    */
   bool IsMultipleWindowSupported() const;
index 5a2a3e8..0e9a4fc 100644 (file)
@@ -291,6 +291,16 @@ void Adaptor::UnregisterProcessor(Integration::Processor& processor, bool postPr
   mImpl->UnregisterProcessor(processor, postProcessor);
 }
 
+void Adaptor::RegisterProcessorOnce(Integration::Processor& processor, bool postProcessor)
+{
+  mImpl->RegisterProcessorOnce(processor, postProcessor);
+}
+
+void Adaptor::UnregisterProcessorOnce(Integration::Processor& processor, bool postProcessor)
+{
+  mImpl->UnregisterProcessorOnce(processor, postProcessor);
+}
+
 Dali::WindowContainer Adaptor::GetWindows() const
 {
   return mImpl->GetWindows();