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>
return Internal::Adaptor::GetImplementation(application).GetRenderThreadId();
}
+void FlushUpdateMessages(Application application)
+{
+ Internal::Adaptor::GetImplementation(application).FlushUpdateMessages();
+}
+
} // namespace DevelApplication
} // namespace Dali
#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.
*/
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
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
*/
}
}
+void Adaptor::FlushUpdateMessages()
+{
+ if(mCore)
+ {
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_FLUSH_UPDATE_MESSAGES");
+
+ mCore->ForceRelayout();
+ }
+}
+
void Adaptor::ProcessCoreEvents()
{
if(mCore)
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;
mImpl->RenderOnce();
}
+void Adaptor::FlushUpdateMessages()
+{
+ mImpl->FlushUpdateMessages();
+}
+
const LogFactoryInterface& Adaptor::GetLogFactory()
{
return mImpl->GetLogFactory();
return SystemSettings::GetDataPath();
}
+void Application::FlushUpdateMessages()
+{
+ Internal::Adaptor::Adaptor::GetImplementation(*mAdaptor).FlushUpdateMessages();
+}
+
void Application::SetStyleSheet(const std::string& stylesheet)
{
mStylesheet = stylesheet;
*/
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()
#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.
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;