From 1752618211be76eac4a86493057c36e8d14e7c0e Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Thu, 29 Jun 2023 19:05:52 +0900 Subject: [PATCH] Use another framework in OffscreenApplication Use glib main loop in OffscreenApplication In the case, ecore APIs should not be called. Change-Id: I18b327cce8a8b5973124042207210b40df9707ad --- .../adaptor-framework/offscreen-application.cpp | 10 +-- .../adaptor-framework/offscreen-application.h | 10 +-- .../adaptor/android/framework-factory-android.cpp | 12 +++- .../adaptor/android/framework-factory-android.h | 2 +- .../androidjni/framework-factory-androidjni.cpp | 12 +++- .../androidjni/framework-factory-androidjni.h | 2 +- dali/internal/adaptor/common/application-impl.cpp | 2 +- dali/internal/adaptor/common/framework-factory.h | 14 +++- dali/internal/adaptor/file.list | 2 + .../adaptor/glib/framework-factory-glib.cpp | 12 +++- .../internal/adaptor/glib/framework-factory-glib.h | 2 +- dali/internal/adaptor/glib/framework-glib.cpp | 4 +- .../adaptor/libuv/framework-factory-libuv.cpp | 12 +++- .../adaptor/libuv/framework-factory-libuv.h | 2 +- .../internal/adaptor/macos/framework-factory-mac.h | 2 +- .../adaptor/macos/framework-factory-mac.mm | 12 +++- .../tizen-wayland/framework-factory-tizen.cpp | 23 ++++-- .../tizen-wayland/framework-factory-tizen.h | 10 ++- .../adaptor/ubuntu/framework-factory-ubuntu.cpp | 12 +++- .../adaptor/ubuntu/framework-factory-ubuntu.h | 2 +- .../adaptor/windows/framework-factory-win.cpp | 12 +++- .../adaptor/windows/framework-factory-win.h | 2 +- .../common/offscreen-application-impl.cpp | 52 ++++++++++---- .../offscreen/common/offscreen-application-impl.h | 29 ++++++-- dali/internal/system/file.list | 7 +- .../internal/system/glib/callback-manager-glib.cpp | 22 +++--- dali/internal/system/glib/callback-manager-glib.h | 6 +- .../system/linux/callback-manager-ecore.cpp | 22 +++--- .../internal/system/linux/callback-manager-ecore.h | 8 +-- .../internal/system/linux/system-factory-ecore.cpp | 34 ++++++++- .../ecore-wl2/window-system-ecore-wl2.cpp | 82 ++++++++++++++-------- .../native-render-surface-ecore-wl.cpp | 12 ---- 32 files changed, 307 insertions(+), 140 deletions(-) diff --git a/dali/devel-api/adaptor-framework/offscreen-application.cpp b/dali/devel-api/adaptor-framework/offscreen-application.cpp index 30d2c96..0ad6713 100644 --- a/dali/devel-api/adaptor-framework/offscreen-application.cpp +++ b/dali/devel-api/adaptor-framework/offscreen-application.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 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. @@ -50,14 +50,14 @@ OffscreenApplication& OffscreenApplication::operator=(const OffscreenApplication OffscreenApplication::~OffscreenApplication() = default; -void OffscreenApplication::Start() +void OffscreenApplication::MainLoop() { - Internal::GetImplementation(*this).Start(); + Internal::GetImplementation(*this).MainLoop(); } -void OffscreenApplication::Stop() +void OffscreenApplication::Quit() { - Internal::GetImplementation(*this).Stop(); + Internal::GetImplementation(*this).Quit(); } Dali::OffscreenWindow OffscreenApplication::GetWindow() diff --git a/dali/devel-api/adaptor-framework/offscreen-application.h b/dali/devel-api/adaptor-framework/offscreen-application.h index d03d99b..d7b6249 100644 --- a/dali/devel-api/adaptor-framework/offscreen-application.h +++ b/dali/devel-api/adaptor-framework/offscreen-application.h @@ -2,7 +2,7 @@ #define DALI_OFFSCREEN_APPLICATION_H /* - * Copyright (c) 2020 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. @@ -104,14 +104,14 @@ public: public: /** - * @brief Starts the OffscreenApplication (rendering, event handling, etc) + * @brief This starts the application. */ - void Start(); + void MainLoop(); /** - * @brief Stops the OffscreenApplication + * @brief This quits the application. */ - void Stop(); + void Quit(); /** * @brief Get the default OffscreenWindow handle diff --git a/dali/internal/adaptor/android/framework-factory-android.cpp b/dali/internal/adaptor/android/framework-factory-android.cpp index baec498..29acd0b 100644 --- a/dali/internal/adaptor/android/framework-factory-android.cpp +++ b/dali/internal/adaptor/android/framework-factory-android.cpp @@ -28,14 +28,20 @@ namespace Internal { namespace Adaptor { -std::unique_ptr FrameworkFactoryAndroid::CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) +std::unique_ptr FrameworkFactoryAndroid::CreateFramework(FrameworkBackend backend, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) { return Utils::MakeUnique(observer, taskObserver, argc, argv, type, useUiThread); } -std::unique_ptr GetFrameworkFactory() +FrameworkFactory* GetFrameworkFactory() { - return Utils::MakeUnique(); + static std::unique_ptr frameworkFactory = nullptr; + + if(!frameworkFactory) + { + frameworkFactory = Utils::MakeUnique(); + } + return frameworkFactory.get(); } } // namespace Adaptor diff --git a/dali/internal/adaptor/android/framework-factory-android.h b/dali/internal/adaptor/android/framework-factory-android.h index 99b4caa..4b3b9e6 100644 --- a/dali/internal/adaptor/android/framework-factory-android.h +++ b/dali/internal/adaptor/android/framework-factory-android.h @@ -29,7 +29,7 @@ namespace Adaptor class FrameworkFactoryAndroid : public FrameworkFactory { public: - std::unique_ptr CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; + std::unique_ptr CreateFramework(FrameworkBackend frameworkType, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; }; } // namespace Adaptor diff --git a/dali/internal/adaptor/androidjni/framework-factory-androidjni.cpp b/dali/internal/adaptor/androidjni/framework-factory-androidjni.cpp index 6573eb5..d4dd93c 100644 --- a/dali/internal/adaptor/androidjni/framework-factory-androidjni.cpp +++ b/dali/internal/adaptor/androidjni/framework-factory-androidjni.cpp @@ -28,14 +28,20 @@ namespace Internal { namespace Adaptor { -std::unique_ptr FrameworkFactoryAndroidJni::CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) +std::unique_ptr FrameworkFactoryAndroidJni::CreateFramework(FrameworkBackend backend, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) { return Utils::MakeUnique(observer, taskObserver, argc, argv, type, useUiThread); } -std::unique_ptr GetFrameworkFactory() +FrameworkFactory* GetFrameworkFactory() { - return Utils::MakeUnique(); + static std::unique_ptr frameworkFactory = nullptr; + + if(!frameworkFactory) + { + frameworkFactory = Utils::MakeUnique(); + } + return frameworkFactory.get(); } } // namespace Adaptor diff --git a/dali/internal/adaptor/androidjni/framework-factory-androidjni.h b/dali/internal/adaptor/androidjni/framework-factory-androidjni.h index a4dac3c..782ed97 100644 --- a/dali/internal/adaptor/androidjni/framework-factory-androidjni.h +++ b/dali/internal/adaptor/androidjni/framework-factory-androidjni.h @@ -29,7 +29,7 @@ namespace Adaptor class FrameworkFactoryAndroidJni : public FrameworkFactory { public: - std::unique_ptr CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; + std::unique_ptr CreateFramework(FrameworkBackend frameworkType, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; }; } // namespace Adaptor diff --git a/dali/internal/adaptor/common/application-impl.cpp b/dali/internal/adaptor/common/application-impl.cpp index 602c4f9..3efd7a5 100644 --- a/dali/internal/adaptor/common/application-impl.cpp +++ b/dali/internal/adaptor/common/application-impl.cpp @@ -126,7 +126,7 @@ Application::Application(int* argc, char** argv[], const std::string& stylesheet } mCommandLineOptions = new CommandLineOptions(argc, argv); - mFramework = Dali::Internal::Adaptor::GetFrameworkFactory()->CreateFramework(*this, *this, argc, argv, applicationType, mUseUiThread); + mFramework = Dali::Internal::Adaptor::GetFrameworkFactory()->CreateFramework(FrameworkBackend::DEFAULT, *this, *this, argc, argv, applicationType, mUseUiThread); mUseRemoteSurface = (applicationType == Framework::WATCH); } diff --git a/dali/internal/adaptor/common/framework-factory.h b/dali/internal/adaptor/common/framework-factory.h index 8437474..885cdb1 100644 --- a/dali/internal/adaptor/common/framework-factory.h +++ b/dali/internal/adaptor/common/framework-factory.h @@ -27,16 +27,26 @@ namespace Internal { namespace Adaptor { +enum class FrameworkBackend +{ + DEFAULT, + GLIB +}; + class FrameworkFactory { public: FrameworkFactory() = default; virtual ~FrameworkFactory() = default; - virtual std::unique_ptr CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) = 0; + virtual std::unique_ptr CreateFramework(FrameworkBackend backend, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) = 0; + virtual FrameworkBackend GetFrameworkBackend() const + { + return FrameworkBackend::DEFAULT; + } }; -extern std::unique_ptr GetFrameworkFactory(); +extern FrameworkFactory* GetFrameworkFactory(); } // namespace Adaptor } // namespace Internal diff --git a/dali/internal/adaptor/file.list b/dali/internal/adaptor/file.list index a313acb..95b6f58 100644 --- a/dali/internal/adaptor/file.list +++ b/dali/internal/adaptor/file.list @@ -13,6 +13,7 @@ SET( adaptor_adaptor_common_src_files # module: adaptor, backend: tizen-wayland SET( adaptor_adaptor_tizen_wayland_src_files + ${adaptor_adaptor_dir}/glib/framework-glib.cpp ${adaptor_adaptor_dir}/tizen-wayland/adaptor-impl-tizen.cpp ${adaptor_adaptor_dir}/tizen-wayland/framework-factory-tizen.cpp ${adaptor_adaptor_dir}/tizen-wayland/framework-tizen.cpp @@ -41,6 +42,7 @@ SET( adaptor_adaptor_tizen_wearable_src_files # module: adaptor, backend: ubuntu SET( adaptor_adaptor_ubuntu_src_files ${adaptor_adaptor_dir}/generic/adaptor-impl-generic.cpp + ${adaptor_adaptor_dir}/glib/framework-glib.cpp ${adaptor_adaptor_dir}/ubuntu/framework-factory-ubuntu.cpp ${adaptor_adaptor_dir}/ubuntu/framework-ubuntu.cpp ) diff --git a/dali/internal/adaptor/glib/framework-factory-glib.cpp b/dali/internal/adaptor/glib/framework-factory-glib.cpp index 50e1704..baf5954 100644 --- a/dali/internal/adaptor/glib/framework-factory-glib.cpp +++ b/dali/internal/adaptor/glib/framework-factory-glib.cpp @@ -28,14 +28,20 @@ namespace Internal { namespace Adaptor { -std::unique_ptr FrameworkFactoryGlib::CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) +std::unique_ptr FrameworkFactoryGlib::CreateFramework(FrameworkBackend backend, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) { return Utils::MakeUnique(observer, taskObserver, argc, argv, type, useUiThread); } -std::unique_ptr GetFrameworkFactory() +FrameworkFactory* GetFrameworkFactory() { - return Utils::MakeUnique(); + static std::unique_ptr frameworkFactory = nullptr; + + if(!frameworkFactory) + { + frameworkFactory = Utils::MakeUnique(); + } + return frameworkFactory.get(); } } // namespace Adaptor diff --git a/dali/internal/adaptor/glib/framework-factory-glib.h b/dali/internal/adaptor/glib/framework-factory-glib.h index eef7081..5969b3b 100644 --- a/dali/internal/adaptor/glib/framework-factory-glib.h +++ b/dali/internal/adaptor/glib/framework-factory-glib.h @@ -29,7 +29,7 @@ namespace Adaptor class FrameworkFactoryGlib : public FrameworkFactory { public: - std::unique_ptr CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; + std::unique_ptr CreateFramework(FrameworkBackend frameworkType, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; }; } // namespace Adaptor diff --git a/dali/internal/adaptor/glib/framework-glib.cpp b/dali/internal/adaptor/glib/framework-glib.cpp index 90859dc..5123131 100644 --- a/dali/internal/adaptor/glib/framework-glib.cpp +++ b/dali/internal/adaptor/glib/framework-glib.cpp @@ -47,8 +47,8 @@ struct FrameworkGlib::Impl // Constructor Impl(void* data) { - // In future, may need to change this to have own context or use Tizen context - gMainLoop = mMainLoop = g_main_loop_new(nullptr, false); + GMainContext* context = g_main_context_new(); + gMainLoop = mMainLoop = g_main_loop_new(context, false); } ~Impl() diff --git a/dali/internal/adaptor/libuv/framework-factory-libuv.cpp b/dali/internal/adaptor/libuv/framework-factory-libuv.cpp index d3cb580..b608d45 100644 --- a/dali/internal/adaptor/libuv/framework-factory-libuv.cpp +++ b/dali/internal/adaptor/libuv/framework-factory-libuv.cpp @@ -28,14 +28,20 @@ namespace Internal { namespace Adaptor { -std::unique_ptr FrameworkFactoryLibuv::CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) +std::unique_ptr FrameworkFactoryLibuv::CreateFramework(FrameworkBackend backend, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) { return Utils::MakeUnique(observer, taskObserver, argc, argv, type, useUiThread); } -std::unique_ptr GetFrameworkFactory() +FrameworkFactory* GetFrameworkFactory() { - return Utils::MakeUnique(); + static std::unique_ptr frameworkFactory = nullptr; + + if(!frameworkFactory) + { + frameworkFactory = Utils::MakeUnique(); + } + return frameworkFactory.get(); } } // namespace Adaptor diff --git a/dali/internal/adaptor/libuv/framework-factory-libuv.h b/dali/internal/adaptor/libuv/framework-factory-libuv.h index 1b5a4ba..2b4d0ae 100644 --- a/dali/internal/adaptor/libuv/framework-factory-libuv.h +++ b/dali/internal/adaptor/libuv/framework-factory-libuv.h @@ -29,7 +29,7 @@ namespace Adaptor class FrameworkFactoryLibuv : public FrameworkFactory { public: - std::unique_ptr CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; + std::unique_ptr CreateFramework(FrameworkBackend frameworkType, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; }; } // namespace Adaptor diff --git a/dali/internal/adaptor/macos/framework-factory-mac.h b/dali/internal/adaptor/macos/framework-factory-mac.h index 4710077..1778d70 100644 --- a/dali/internal/adaptor/macos/framework-factory-mac.h +++ b/dali/internal/adaptor/macos/framework-factory-mac.h @@ -29,7 +29,7 @@ namespace Adaptor class FrameworkFactoryMac : public FrameworkFactory { public: - std::unique_ptr CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; + std::unique_ptr CreateFramework(FrameworkBackend frameworkType, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; }; } // namespace Adaptor diff --git a/dali/internal/adaptor/macos/framework-factory-mac.mm b/dali/internal/adaptor/macos/framework-factory-mac.mm index 9de706e..8deb80e 100644 --- a/dali/internal/adaptor/macos/framework-factory-mac.mm +++ b/dali/internal/adaptor/macos/framework-factory-mac.mm @@ -28,14 +28,20 @@ namespace Internal { namespace Adaptor { -std::unique_ptr FrameworkFactoryMac::CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) +std::unique_ptr FrameworkFactoryMac::CreateFramework(FrameworkBackend backend, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) { return Utils::MakeUnique(observer, taskObserver, argc, argv, type, useUiThread); } -std::unique_ptr GetFrameworkFactory() +FrameworkFactory* GetFrameworkFactory() { - return Utils::MakeUnique(); + static std::unique_ptr frameworkFactory = nullptr; + + if(!frameworkFactory) + { + frameworkFactory = Utils::MakeUnique(); + } + return frameworkFactory.get(); } } // namespace Adaptor diff --git a/dali/internal/adaptor/tizen-wayland/framework-factory-tizen.cpp b/dali/internal/adaptor/tizen-wayland/framework-factory-tizen.cpp index 75872a6..d466db1 100644 --- a/dali/internal/adaptor/tizen-wayland/framework-factory-tizen.cpp +++ b/dali/internal/adaptor/tizen-wayland/framework-factory-tizen.cpp @@ -19,6 +19,7 @@ #include // INTERNAL HEADERS +#include #include #include @@ -28,14 +29,28 @@ namespace Internal { namespace Adaptor { -std::unique_ptr FrameworkFactoryTizen::CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) +std::unique_ptr FrameworkFactoryTizen::CreateFramework(FrameworkBackend backend, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) { - return Utils::MakeUnique(observer, taskObserver, argc, argv, type, useUiThread); + mBackend = backend; + if(mBackend == FrameworkBackend::GLIB) + { + return Utils::MakeUnique(observer, taskObserver, argc, argv, type, useUiThread); + } + else + { + return Utils::MakeUnique(observer, taskObserver, argc, argv, type, useUiThread); + } } -std::unique_ptr GetFrameworkFactory() +FrameworkFactory* GetFrameworkFactory() { - return Utils::MakeUnique(); + static std::unique_ptr frameworkFactory = nullptr; + + if(!frameworkFactory) + { + frameworkFactory = Utils::MakeUnique(); + } + return frameworkFactory.get(); } } // namespace Adaptor diff --git a/dali/internal/adaptor/tizen-wayland/framework-factory-tizen.h b/dali/internal/adaptor/tizen-wayland/framework-factory-tizen.h index d56db17..68879fb 100644 --- a/dali/internal/adaptor/tizen-wayland/framework-factory-tizen.h +++ b/dali/internal/adaptor/tizen-wayland/framework-factory-tizen.h @@ -29,7 +29,15 @@ namespace Adaptor class FrameworkFactoryTizen : public FrameworkFactory { public: - std::unique_ptr CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; + std::unique_ptr CreateFramework(FrameworkBackend frameworkType, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; + + FrameworkBackend GetFrameworkBackend() const override + { + return mBackend; + } + +private: + FrameworkBackend mBackend; }; } // namespace Adaptor diff --git a/dali/internal/adaptor/ubuntu/framework-factory-ubuntu.cpp b/dali/internal/adaptor/ubuntu/framework-factory-ubuntu.cpp index f8bcc62..ae2c084 100644 --- a/dali/internal/adaptor/ubuntu/framework-factory-ubuntu.cpp +++ b/dali/internal/adaptor/ubuntu/framework-factory-ubuntu.cpp @@ -28,14 +28,20 @@ namespace Internal { namespace Adaptor { -std::unique_ptr FrameworkFactoryUbuntu::CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) +std::unique_ptr FrameworkFactoryUbuntu::CreateFramework(FrameworkBackend backend, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) { return Utils::MakeUnique(observer, taskObserver, argc, argv, type, useUiThread); } -std::unique_ptr GetFrameworkFactory() +FrameworkFactory* GetFrameworkFactory() { - return Utils::MakeUnique(); + static std::unique_ptr frameworkFactory = nullptr; + + if(!frameworkFactory) + { + frameworkFactory = Utils::MakeUnique(); + } + return frameworkFactory.get(); } } // namespace Adaptor diff --git a/dali/internal/adaptor/ubuntu/framework-factory-ubuntu.h b/dali/internal/adaptor/ubuntu/framework-factory-ubuntu.h index c765922..f7d6b2a 100644 --- a/dali/internal/adaptor/ubuntu/framework-factory-ubuntu.h +++ b/dali/internal/adaptor/ubuntu/framework-factory-ubuntu.h @@ -29,7 +29,7 @@ namespace Adaptor class FrameworkFactoryUbuntu : public FrameworkFactory { public: - std::unique_ptr CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; + std::unique_ptr CreateFramework(FrameworkBackend frameworkType, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; }; } // namespace Adaptor diff --git a/dali/internal/adaptor/windows/framework-factory-win.cpp b/dali/internal/adaptor/windows/framework-factory-win.cpp index 6d45a3e..e94a561 100644 --- a/dali/internal/adaptor/windows/framework-factory-win.cpp +++ b/dali/internal/adaptor/windows/framework-factory-win.cpp @@ -28,14 +28,20 @@ namespace Internal { namespace Adaptor { -std::unique_ptr FrameworkFactoryWin::CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) +std::unique_ptr FrameworkFactoryWin::CreateFramework(FrameworkBackend backend, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) { return Utils::MakeUnique(observer, taskObserver, argc, argv, type, useUiThread); } -std::unique_ptr GetFrameworkFactory() +FrameworkFactory* GetFrameworkFactory() { - return Utils::MakeUnique(); + static std::unique_ptr frameworkFactory = nullptr; + + if(!frameworkFactory) + { + frameworkFactory = Utils::MakeUnique(); + } + return frameworkFactory.get(); } } // namespace Adaptor diff --git a/dali/internal/adaptor/windows/framework-factory-win.h b/dali/internal/adaptor/windows/framework-factory-win.h index 1fe335a..039e3fa 100644 --- a/dali/internal/adaptor/windows/framework-factory-win.h +++ b/dali/internal/adaptor/windows/framework-factory-win.h @@ -29,7 +29,7 @@ namespace Adaptor class FrameworkFactoryWin : public FrameworkFactory { public: - std::unique_ptr CreateFramework(Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; + std::unique_ptr CreateFramework(FrameworkBackend frameworkType, Framework::Observer& observer, Framework::TaskObserver& taskObserver, int* argc, char*** argv, Framework::Type type, bool useUiThread) override; }; } // namespace Adaptor diff --git a/dali/internal/offscreen/common/offscreen-application-impl.cpp b/dali/internal/offscreen/common/offscreen-application-impl.cpp index 6e6ee05..394b637 100644 --- a/dali/internal/offscreen/common/offscreen-application-impl.cpp +++ b/dali/internal/offscreen/common/offscreen-application-impl.cpp @@ -19,10 +19,12 @@ #include // INTERNAL INCLUDES +#include #include #include #include #include +#include #include #include #include @@ -45,7 +47,11 @@ OffscreenApplication::OffscreenApplication(uint16_t width, uint16_t height, Dali // Disable partial update EnvironmentVariable::SetEnvironmentVariable(DALI_ENV_DISABLE_PARTIAL_UPDATE, "1"); - Dali::Internal::Adaptor::WindowSystem::Initialize(); + // Disable ATSPI + Dali::Accessibility::Bridge::DisableAutoInit(); + + // Now we assume separated main loop for the offscreen application + mFramework = Internal::Adaptor::GetFrameworkFactory()->CreateFramework(Internal::Adaptor::FrameworkBackend::GLIB, *this, *this, nullptr, nullptr, Adaptor::Framework::NORMAL, false); // Generate a default window IntrusivePtr impl = Internal::OffscreenWindow::New(width, height, surface, isTranslucent); @@ -59,36 +65,56 @@ OffscreenApplication::OffscreenApplication(uint16_t width, uint16_t height, Dali OffscreenApplication::~OffscreenApplication() { - Dali::Internal::Adaptor::WindowSystem::Shutdown(); } -void OffscreenApplication::Start() +void OffscreenApplication::MainLoop() +{ + mFramework->Run(); +} + +void OffscreenApplication::Quit() +{ + // Actually quit the application. + // Force a call to Quit even if adaptor is not running. + Internal::Adaptor::Adaptor::GetImplementation(*mAdaptor).AddIdle(MakeCallback(this, &OffscreenApplication::QuitFromMainLoop), false, true); +} + +Dali::OffscreenWindow OffscreenApplication::GetWindow() +{ + return mDefaultWindow; +} + +void OffscreenApplication::RenderOnce() +{ + mAdaptor->RenderOnce(); +} + +void OffscreenApplication::OnInit() { // Start the adaptor mAdaptor->Start(); - Dali::OffscreenApplication handle(this); mInitSignal.Emit(); + mAdaptor->NotifySceneCreated(); } -void OffscreenApplication::Stop() +void OffscreenApplication::OnTerminate() { + mTerminateSignal.Emit(); + // Stop the adaptor mAdaptor->Stop(); - Dali::OffscreenApplication handle(this); - mTerminateSignal.Emit(); + mDefaultWindow.Reset(); } -Dali::OffscreenWindow OffscreenApplication::GetWindow() +void OffscreenApplication::QuitFromMainLoop() { - return mDefaultWindow; -} + mAdaptor->Stop(); -void OffscreenApplication::RenderOnce() -{ - mAdaptor->RenderOnce(); + mFramework->Quit(); + // This will trigger OnTerminate(), below, after the main loop has completed. } } // namespace Internal diff --git a/dali/internal/offscreen/common/offscreen-application-impl.h b/dali/internal/offscreen/common/offscreen-application-impl.h index 6a868ca..48dc0e3 100644 --- a/dali/internal/offscreen/common/offscreen-application-impl.h +++ b/dali/internal/offscreen/common/offscreen-application-impl.h @@ -27,6 +27,7 @@ #include #include #include +#include namespace Dali { @@ -37,7 +38,7 @@ namespace Internal /** * Implementation of the OffscreenApplication class. */ -class OffscreenApplication : public BaseObject +class OffscreenApplication : public BaseObject, public Adaptor::Framework::Observer, public Adaptor::Framework::TaskObserver { public: using OffscreenApplicationSignalType = Dali::OffscreenApplication::OffscreenApplicationSignalType; @@ -59,14 +60,14 @@ public: virtual ~OffscreenApplication(); /** - * @copydoc Dali::OffscreenApplication::Start() + * @copydoc Dali::OffscreenApplication::MainLoop() */ - void Start(); + void MainLoop(); /** - * @copydoc Dali::OffscreenApplication::Stop() + * @copydoc Dali::OffscreenApplication::Quit() */ - void Stop(); + void Quit(); /** * @copydoc Dali::OffscreenApplication::GetDefaultWindow() @@ -95,6 +96,17 @@ public: // Signals return mTerminateSignal; } +public: // From Framework::Observer + /** + * Called when the framework is initialised. + */ + void OnInit() override; + + /** + * Called when the framework is terminated. + */ + void OnTerminate() override; + private: /** * Private constructor @@ -106,6 +118,11 @@ private: */ OffscreenApplication(uint16_t width, uint16_t height, Dali::Any surface, bool isTranslucent, Dali::OffscreenApplication::RenderMode renderMode); + /** + * Quits from the main loop + */ + void QuitFromMainLoop(); + // Undefined OffscreenApplication(const OffscreenApplication&) = delete; OffscreenApplication& operator=(OffscreenApplication&) = delete; @@ -116,6 +133,8 @@ private: std::unique_ptr mAdaptor; Dali::OffscreenWindow mDefaultWindow; + std::unique_ptr mFramework; + OffscreenApplicationSignalType mInitSignal; OffscreenApplicationSignalType mTerminateSignal; }; diff --git a/dali/internal/system/file.list b/dali/internal/system/file.list index a8f439a..898d703 100644 --- a/dali/internal/system/file.list +++ b/dali/internal/system/file.list @@ -31,10 +31,13 @@ SET( adaptor_system_linux_src_files ${adaptor_system_dir}/common/shared-file.cpp ${adaptor_system_dir}/common/trigger-event.cpp ${adaptor_system_dir}/common/trigger-event-factory.cpp + ${adaptor_system_dir}/common/time-service.cpp + ${adaptor_system_dir}/generic/shared-file-operations-generic.cpp + ${adaptor_system_dir}/glib/callback-manager-glib.cpp + ${adaptor_system_dir}/glib/file-descriptor-monitor-glib.cpp + ${adaptor_system_dir}/glib/timer-impl-glib.cpp ${adaptor_system_dir}/linux/callback-manager-ecore.cpp ${adaptor_system_dir}/linux/file-descriptor-monitor-ecore.cpp - ${adaptor_system_dir}/generic/shared-file-operations-generic.cpp - ${adaptor_system_dir}/common/time-service.cpp ${adaptor_system_dir}/linux/system-factory-ecore.cpp ${adaptor_system_dir}/linux/timer-impl-ecore.cpp ) diff --git a/dali/internal/system/glib/callback-manager-glib.cpp b/dali/internal/system/glib/callback-manager-glib.cpp index 4b25bd3..1dcb589 100644 --- a/dali/internal/system/glib/callback-manager-glib.cpp +++ b/dali/internal/system/glib/callback-manager-glib.cpp @@ -35,14 +35,14 @@ extern GMainContext* GetMainLoopContext(); /** * Structure contains the callback function and control options */ -struct CallbackData +struct GlibCallbackData { typedef gboolean (*CallbackFunction)(gpointer userData); /** * Constructor */ - CallbackData(CallbackBase* callback, bool hasReturnValue) + GlibCallbackData(CallbackBase* callback, bool hasReturnValue) : mCallback(callback), mHasReturnValue(hasReturnValue) { @@ -58,7 +58,7 @@ struct CallbackData { mSource = g_idle_source_new(); g_source_set_priority(mSource, G_PRIORITY_HIGH_IDLE); - g_source_set_callback(mSource, &CallbackData::IdleCallback, this, nullptr); // No destroyNotify + g_source_set_callback(mSource, &GlibCallbackData::IdleCallback, this, nullptr); // No destroyNotify g_source_attach(mSource, context); } } @@ -66,7 +66,7 @@ struct CallbackData /** * Destructor */ - ~CallbackData() + ~GlibCallbackData() { g_source_destroy(mSource); g_source_unref(mSource); @@ -78,8 +78,8 @@ struct CallbackData static gboolean IdleCallback(gpointer userData) { - gboolean retValue = G_SOURCE_REMOVE; - CallbackData* callbackData = static_cast(userData); + gboolean retValue = G_SOURCE_REMOVE; + GlibCallbackData* callbackData = static_cast(userData); if(callbackData->mHasReturnValue) { @@ -139,7 +139,7 @@ void GlibCallbackManager::Stop() for(CallbackList::iterator iter = mCallbackContainer.begin(); iter != mCallbackContainer.end(); ++iter) { - CallbackData* data = (*iter); + GlibCallbackData* data = (*iter); delete data; } @@ -153,7 +153,7 @@ bool GlibCallbackManager::AddIdleCallback(CallbackBase* callback, bool hasReturn return false; } - CallbackData* callbackData = new CallbackData(callback, hasReturnValue); + GlibCallbackData* callbackData = new GlibCallbackData(callback, hasReturnValue); // To inform the manager a callback has finished, we get it to call RemoveCallbackFromContainer callbackData->mRemoveFromContainerFunction = MakeCallback(this, &GlibCallbackManager::RemoveCallbackFromContainer); @@ -174,7 +174,7 @@ void GlibCallbackManager::RemoveIdleCallback(CallbackBase* callback) it != endIt; ++it) { - CallbackData* data = *it; + GlibCallbackData* data = *it; if(data->mCallback == callback) { @@ -204,7 +204,7 @@ bool GlibCallbackManager::AddIdleEntererCallback(CallbackBase* callback) return false; } - CallbackData* callbackData = new CallbackData(callback, true); + GlibCallbackData* callbackData = new GlibCallbackData(callback, true); // To inform the manager a callback has finished, we get it to call RemoveCallbackFromContainer callbackData->mRemoveFromContainerFunction = MakeCallback(this, &GlibCallbackManager::RemoveCallbackFromContainer); @@ -223,7 +223,7 @@ void GlibCallbackManager::RemoveIdleEntererCallback(CallbackBase* callback) RemoveIdleCallback(callback); } -void GlibCallbackManager::RemoveCallbackFromContainer(CallbackData* callbackData) +void GlibCallbackManager::RemoveCallbackFromContainer(GlibCallbackData* callbackData) { mCallbackContainer.remove(callbackData); } diff --git a/dali/internal/system/glib/callback-manager-glib.h b/dali/internal/system/glib/callback-manager-glib.h index fb3a2c0..4d0c865 100644 --- a/dali/internal/system/glib/callback-manager-glib.h +++ b/dali/internal/system/glib/callback-manager-glib.h @@ -30,7 +30,7 @@ namespace Internal { namespace Adaptor { -struct CallbackData; +struct GlibCallbackData; /** * @brief Glib callback manager used to install call backs in the applications main loop. @@ -95,14 +95,14 @@ private: * Always called from main thread * @param callbackData callback data */ - void RemoveCallbackFromContainer(CallbackData* callbackData); + void RemoveCallbackFromContainer(GlibCallbackData* callbackData); // Undefined GlibCallbackManager(const GlibCallbackManager&) = delete; GlibCallbackManager& operator=(GlibCallbackManager&) = delete; private: - typedef std::list CallbackList; ///< list of callbacks installed + typedef std::list CallbackList; ///< list of callbacks installed bool mRunning; ///< flag is set to true if when running CallbackList mCallbackContainer; ///< container of live callbacks diff --git a/dali/internal/system/linux/callback-manager-ecore.cpp b/dali/internal/system/linux/callback-manager-ecore.cpp index e7ea2d5..367b186 100644 --- a/dali/internal/system/linux/callback-manager-ecore.cpp +++ b/dali/internal/system/linux/callback-manager-ecore.cpp @@ -34,12 +34,12 @@ namespace Adaptor /** * Structure contains the callback function and control options */ -struct CallbackData +struct EcoreCallbackData { /** * Constructor */ - CallbackData(CallbackBase* callback, bool hasReturnValue) + EcoreCallbackData(CallbackBase* callback, bool hasReturnValue) : mCallback(callback), mRemoveFromContainerFunction(NULL), mIdler(NULL), @@ -50,7 +50,7 @@ struct CallbackData /** * Destructor */ - ~CallbackData() + ~EcoreCallbackData() { delete mCallback; delete mRemoveFromContainerFunction; @@ -70,8 +70,8 @@ namespace */ Eina_Bool IdleCallback(void* data) { - Eina_Bool ret = ECORE_CALLBACK_CANCEL; // CALLBACK Cancel will delete the idler so we don't need to call ecore_idler_del - CallbackData* callbackData = static_cast(data); + Eina_Bool ret = ECORE_CALLBACK_CANCEL; // CALLBACK Cancel will delete the idler so we don't need to call ecore_idler_del + EcoreCallbackData* callbackData = static_cast(data); if(callbackData->mHasReturnValue) { @@ -137,7 +137,7 @@ bool EcoreCallbackManager::AddIdleCallback(CallbackBase* callback, bool hasRetur return false; } - CallbackData* callbackData = new CallbackData(callback, hasReturnValue); + EcoreCallbackData* callbackData = new EcoreCallbackData(callback, hasReturnValue); callbackData->mRemoveFromContainerFunction = MakeCallback(this, &EcoreCallbackManager::RemoveCallbackFromContainer); @@ -159,7 +159,7 @@ void EcoreCallbackManager::RemoveIdleCallback(CallbackBase* callback) it != endIt; ++it) { - CallbackData* data = *it; + EcoreCallbackData* data = *it; if(data->mCallback == callback) { @@ -194,7 +194,7 @@ bool EcoreCallbackManager::AddIdleEntererCallback(CallbackBase* callback) return false; } - CallbackData* callbackData = new CallbackData(callback, true); + EcoreCallbackData* callbackData = new EcoreCallbackData(callback, true); callbackData->mRemoveFromContainerFunction = MakeCallback(this, &EcoreCallbackManager::RemoveCallbackFromContainer); @@ -216,7 +216,7 @@ void EcoreCallbackManager::RemoveIdleEntererCallback(CallbackBase* callback) it != endIt; ++it) { - CallbackData* data = *it; + EcoreCallbackData* data = *it; if(data->mCallback == callback) { @@ -233,7 +233,7 @@ void EcoreCallbackManager::RemoveIdleEntererCallback(CallbackBase* callback) } } -void EcoreCallbackManager::RemoveCallbackFromContainer(CallbackData* callbackData) +void EcoreCallbackManager::RemoveCallbackFromContainer(EcoreCallbackData* callbackData) { mCallbackContainer.remove(callbackData); } @@ -243,7 +243,7 @@ void EcoreCallbackManager::RemoveAllCallbacks() // always called from main thread for(CallbackList::iterator iter = mCallbackContainer.begin(); iter != mCallbackContainer.end(); ++iter) { - CallbackData* data = (*iter); + EcoreCallbackData* data = (*iter); if(data->mIdler) { diff --git a/dali/internal/system/linux/callback-manager-ecore.h b/dali/internal/system/linux/callback-manager-ecore.h index 214e153..c756f51 100644 --- a/dali/internal/system/linux/callback-manager-ecore.h +++ b/dali/internal/system/linux/callback-manager-ecore.h @@ -30,7 +30,7 @@ namespace Internal { namespace Adaptor { -struct CallbackData; +struct EcoreCallbackData; /** * Ecore interface to install call backs in the applications main loop. @@ -103,21 +103,21 @@ private: * Always called from main thread * @param callbackData callback data */ - void RemoveCallbackFromContainer(CallbackData* callbackData); + void RemoveCallbackFromContainer(EcoreCallbackData* callbackData); /** * @brief Remove a standard call back from ecore * Always called from main thread * @param callbackData callback data */ - void RemoveStandardCallback(CallbackData* callbackData); + void RemoveStandardCallback(EcoreCallbackData* callbackData); // Undefined EcoreCallbackManager(const EcoreCallbackManager&) = delete; EcoreCallbackManager& operator=(EcoreCallbackManager&) = delete; private: - typedef std::list CallbackList; + typedef std::list CallbackList; bool mRunning; ///< flag is set to true if when running CallbackList mCallbackContainer; ///< container of live idle callbacks diff --git a/dali/internal/system/linux/system-factory-ecore.cpp b/dali/internal/system/linux/system-factory-ecore.cpp index 9308f64..8a4b40b 100644 --- a/dali/internal/system/linux/system-factory-ecore.cpp +++ b/dali/internal/system/linux/system-factory-ecore.cpp @@ -18,6 +18,10 @@ #include // INTERNAL HEADERS +#include +#include +#include +#include #include #include #include @@ -31,17 +35,41 @@ namespace Adaptor { std::unique_ptr SystemFactoryEcore::CreateCallbackManager() { - return Utils::MakeUnique(); + auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); + if(backend == FrameworkBackend::GLIB) + { + return Utils::MakeUnique(); + } + else + { + return Utils::MakeUnique(); + } } std::unique_ptr SystemFactoryEcore::CreateFileDescriptorMonitor(int fileDescriptor, CallbackBase* callback, int eventBitmask) { - return Utils::MakeUnique(fileDescriptor, callback, eventBitmask); + auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); + if(backend == FrameworkBackend::GLIB) + { + return Utils::MakeUnique(fileDescriptor, callback, eventBitmask); + } + else + { + return Utils::MakeUnique(fileDescriptor, callback, eventBitmask); + } } TimerPtr SystemFactoryEcore::CreateTimer(uint32_t milliSec) { - return TimerEcore::New(milliSec); + auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); + if(backend == FrameworkBackend::GLIB) + { + return TimerGlib::New(milliSec); + } + else + { + return TimerEcore::New(milliSec); + } } std::unique_ptr GetSystemFactory() diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp index 4b3eb66..21a7fc5 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-system-ecore-wl2.cpp @@ -15,15 +15,16 @@ * */ +// EXTERNAL_HEADERS +#include +#include + // INTERNAL HEADERS #include +#include #include #include -// EXTERNAL_HEADERS -#include -#include - #define START_DURATION_CHECK() \ uint32_t durationMilliSeconds = static_cast(-1); \ uint32_t startTime, endTime; \ @@ -53,27 +54,39 @@ static int32_t gScreenHeight = 0; void Initialize() { - ecore_wl2_init(); + auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); + if(backend == FrameworkBackend::DEFAULT) + { + ecore_wl2_init(); + } } void Shutdown() { - ecore_wl2_shutdown(); + auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); + if(backend == FrameworkBackend::DEFAULT) + { + ecore_wl2_shutdown(); + } } void GetScreenSize(int32_t& width, int32_t& height) { - if(gScreenWidth == 0 || gScreenHeight == 0) + auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); + if(backend == FrameworkBackend::DEFAULT) { - Ecore_Wl2_Display* display = ecore_wl2_display_connect(NULL); - if(display) + if(gScreenWidth == 0 || gScreenHeight == 0) { - START_DURATION_CHECK(); - ecore_wl2_display_screen_size_get(display, &gScreenWidth, &gScreenHeight); - FINISH_DURATION_CHECK("ecore_wl2_display_screen_size_get"); - - DALI_ASSERT_ALWAYS((gScreenWidth > 0) && "screen width is 0"); - DALI_ASSERT_ALWAYS((gScreenHeight > 0) && "screen height is 0"); + Ecore_Wl2_Display* display = ecore_wl2_display_connect(NULL); + if(display) + { + START_DURATION_CHECK(); + ecore_wl2_display_screen_size_get(display, &gScreenWidth, &gScreenHeight); + FINISH_DURATION_CHECK("ecore_wl2_display_screen_size_get"); + + DALI_ASSERT_ALWAYS((gScreenWidth > 0) && "screen width is 0"); + DALI_ASSERT_ALWAYS((gScreenHeight > 0) && "screen height is 0"); + } } } width = gScreenWidth; @@ -82,30 +95,43 @@ void GetScreenSize(int32_t& width, int32_t& height) void UpdateScreenSize() { - Ecore_Wl2_Display* display = ecore_wl2_display_connect(NULL); - if(display) + auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); + if(backend == FrameworkBackend::DEFAULT) { - START_DURATION_CHECK(); - ecore_wl2_display_screen_size_get(display, &gScreenWidth, &gScreenHeight); - FINISH_DURATION_CHECK("ecore_wl2_display_screen_size_get"); + Ecore_Wl2_Display* display = ecore_wl2_display_connect(NULL); + if(display) + { + START_DURATION_CHECK(); + ecore_wl2_display_screen_size_get(display, &gScreenWidth, &gScreenHeight); + FINISH_DURATION_CHECK("ecore_wl2_display_screen_size_get"); + } } } bool SetKeyboardRepeatInfo(float rate, float delay) { - Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(ecore_wl2_connected_display_get(NULL)); - return ecore_wl2_input_keyboard_repeat_set(input, static_cast(rate), static_cast(delay)); + auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); + if(backend == FrameworkBackend::DEFAULT) + { + Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(ecore_wl2_connected_display_get(NULL)); + return ecore_wl2_input_keyboard_repeat_set(input, static_cast(rate), static_cast(delay)); + } } bool GetKeyboardRepeatInfo(float& rate, float& delay) { - Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(ecore_wl2_connected_display_get(NULL)); - double rateVal, delayVal; - bool ret = ecore_wl2_input_keyboard_repeat_get(input, &rateVal, &delayVal); - rate = static_cast(rateVal); - delay = static_cast(delayVal); + auto backend = Dali::Internal::Adaptor::GetFrameworkFactory()->GetFrameworkBackend(); + if(backend == FrameworkBackend::DEFAULT) + { + Ecore_Wl2_Input* input = ecore_wl2_input_default_input_get(ecore_wl2_connected_display_get(NULL)); + double rateVal, delayVal; + bool ret = ecore_wl2_input_keyboard_repeat_get(input, &rateVal, &delayVal); + rate = static_cast(rateVal); + delay = static_cast(delayVal); - return ret; + return ret; + } + return false; } } // namespace WindowSystem diff --git a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp index 18a5a59..1d8a871 100644 --- a/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp @@ -22,12 +22,6 @@ #include #include -#ifdef ECORE_WAYLAND2 -#include -#else -#include -#endif - #include #include @@ -150,14 +144,8 @@ void NativeRenderSurfaceEcoreWl::GetDpi(unsigned int& dpiHorizontal, unsigned in float xres, yres; // 1 inch = 25.4 millimeters -#ifdef ECORE_WAYLAND2 - // TODO: Application should set dpi value in wayland2 xres = 96; yres = 96; -#else - xres = ecore_wl_dpi_get(); - yres = ecore_wl_dpi_get(); -#endif dpiHorizontal = int(xres + 0.5f); // rounding dpiVertical = int(yres + 0.5f); -- 2.7.4