Flush update messages for application 30/296630/3
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 2 Aug 2023 09:15:35 +0000 (18:15 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Wed, 16 Aug 2023 06:30:00 +0000 (15:30 +0900)
Make a way to relayout & flush events messages by core API.

Since we cannot access adaptor directly,
let we ask to application to relayout calculation forcibly.

Change-Id: I0dba32b7b136ceefc07b99fc404cf330e5c2dff7
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/devel-api/adaptor-framework/application-devel.cpp
dali/devel-api/adaptor-framework/application-devel.h
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
dali/internal/adaptor/common/application-impl.cpp
dali/internal/adaptor/common/application-impl.h
dali/internal/system/common/core-event-interface.h

index 11ab483..b33f173 100644 (file)
@@ -86,6 +86,11 @@ int32_t GetRenderThreadId(Application application)
   return Internal::Adaptor::GetImplementation(application).GetRenderThreadId();
 }
 
+void FlushUpdateMessages(Application application)
+{
+  Internal::Adaptor::GetImplementation(application).FlushUpdateMessages();
+}
+
 } // namespace DevelApplication
 
 } // namespace Dali
index 19c96d5..0e04b0b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_APPLICATION_DEVEL_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -106,6 +106,12 @@ DALI_ADAPTOR_API CustomCommandReceivedSignalType& CustomCommandReceivedSignal(Ap
  */
 DALI_ADAPTOR_API int32_t GetRenderThreadId(Application application);
 
+/**
+ * @brief Relayout the application and ensure all pending operations are flushed to the update thread.
+ * @param application A handle to the Application
+ */
+DALI_ADAPTOR_API void FlushUpdateMessages(Application application);
+
 } // namespace DevelApplication
 
 } // namespace Dali
index 26deedf..98db7e6 100644 (file)
@@ -399,6 +399,11 @@ public:
   void RenderOnce();
 
   /**
+   * @brief Relayout and ensure all pending operations are flushed to the update thread.
+   */
+  void FlushUpdateMessages();
+
+  /**
    * @brief The log factory allows installation of a logger function in worker threads.
    * @return An interface to a logging factory
    */
index fd8238b..ef0ca77 100644 (file)
@@ -934,6 +934,16 @@ void Adaptor::QueueCoreEvent(const Dali::Integration::Event& event)
   }
 }
 
+void Adaptor::FlushUpdateMessages()
+{
+  if(mCore)
+  {
+    DALI_TRACE_SCOPE(gTraceFilter, "DALI_FLUSH_UPDATE_MESSAGES");
+
+    mCore->ForceRelayout();
+  }
+}
+
 void Adaptor::ProcessCoreEvents()
 {
   if(mCore)
index 2b27610..cced74b 100644 (file)
@@ -562,7 +562,12 @@ public: // Signals
 
 public: // From Dali::Internal::Adaptor::CoreEventInterface
   /**
-   * @copydoc Dali::Internal::Adaptor:CoreEventInterface:::ProcessCoreEvents()
+   * @copydoc Dali::Internal::Adaptor::CoreEventInterface:::FlushUpdateMessages()
+   */
+  void FlushUpdateMessages() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::CoreEventInterface:::ProcessCoreEvents()
    */
   void ProcessCoreEvents() override;
 
index f84547d..c32a2a2 100644 (file)
@@ -225,6 +225,11 @@ void Adaptor::RenderOnce()
   mImpl->RenderOnce();
 }
 
+void Adaptor::FlushUpdateMessages()
+{
+  mImpl->FlushUpdateMessages();
+}
+
 const LogFactoryInterface& Adaptor::GetLogFactory()
 {
   return mImpl->GetLogFactory();
index 13a5fe6..c5d0c23 100644 (file)
@@ -604,6 +604,11 @@ std::string Application::GetDataPath()
   return SystemSettings::GetDataPath();
 }
 
+void Application::FlushUpdateMessages()
+{
+  Internal::Adaptor::Adaptor::GetImplementation(*mAdaptor).FlushUpdateMessages();
+}
+
 void Application::SetStyleSheet(const std::string& stylesheet)
 {
   mStylesheet = stylesheet;
index 26d478f..109b5a9 100644 (file)
@@ -300,6 +300,11 @@ public:
    */
   void SetDefaultWindowType(WindowType type);
 
+  /**
+   * @brief Relayout the application and ensure all pending operations are flushed to the update thread.
+   */
+  void FlushUpdateMessages();
+
 public: // Signals
   /**
    * @copydoc Dali::Application::InitSignal()
index c1c8579..7e4641b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_CORE_EVENT_INTERFACE_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -43,6 +43,11 @@ public:
   virtual void QueueCoreEvent(const Dali::Integration::Event& event) = 0;
 
   /**
+   * Relayout and ensure all pending operations are flushed to the update thread.
+   */
+  virtual void FlushUpdateMessages() = 0;
+
+  /**
    * Process the events queued with QueueEvent().
    */
   virtual void ProcessCoreEvents() = 0;