Dynamic Graphics Backend 15/317915/16
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 9 Jan 2025 18:35:30 +0000 (18:35 +0000)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Mon, 27 Jan 2025 14:57:21 +0000 (14:57 +0000)
Change-Id: I013ff62b54f2e8badee2c10e91b40d178b6f213c

77 files changed:
automated-tests/src/dali-adaptor-internal/CMakeLists.txt
automated-tests/src/dali-adaptor/CMakeLists.txt
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-addon-manager.cpp [new file with mode: 0644]
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-addon-manager.h [new file with mode: 0644]
automated-tests/src/dali-adaptor/utc-Dali-Gl-Window.cpp
automated-tests/src/dali-egl-graphics/CMakeLists.txt
build/tizen/.gitignore
build/tizen/CMakeLists.txt
build/tizen/deps-check.cmake
build/tizen/linker-test-graphics-library.cpp [new file with mode: 0644]
build/tizen/profiles/android-profile.cmake
build/tizen/profiles/common-profile.cmake
build/tizen/profiles/glib-x11-profile.cmake
build/tizen/profiles/ivi-profile.cmake
build/tizen/profiles/libuv-x11-profile.cmake
build/tizen/profiles/macos-profile.cmake
build/tizen/profiles/mobile-profile.cmake
build/tizen/profiles/tv-profile.cmake
build/tizen/profiles/ubuntu-profile.cmake
build/tizen/profiles/wearable-profile.cmake
build/tizen/profiles/windows-profile.cmake
dali/devel-api/adaptor-framework/gl-window.cpp
dali/devel-api/adaptor-framework/gl-window.h
dali/devel-api/file.list
dali/internal/adaptor/common/adaptor-builder-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/graphics/common/graphics-factory-dynamic.cpp [new file with mode: 0644]
dali/internal/graphics/common/graphics-factory.h [new file with mode: 0644]
dali/internal/graphics/common/graphics-library-functions.cpp [new file with mode: 0644]
dali/internal/graphics/common/graphics-library.cpp [new file with mode: 0644]
dali/internal/graphics/common/graphics-library.h [new file with mode: 0644]
dali/internal/graphics/common/surface-factory-dynamic.cpp [new file with mode: 0644]
dali/internal/graphics/file.list
dali/internal/graphics/gles/egl-graphics-factory.cpp
dali/internal/graphics/gles/egl-graphics-factory.h
dali/internal/graphics/gles/egl-graphics.h
dali/internal/graphics/gles/egl-implementation.h
dali/internal/graphics/vulkan-impl/vulkan-command-buffer.cpp
dali/internal/graphics/vulkan/vulkan-graphics-factory.cpp
dali/internal/graphics/vulkan/vulkan-graphics-factory.h
dali/internal/imaging/common/native-image-source-factory-dynamic.cpp [new file with mode: 0644]
dali/internal/imaging/common/native-image-source-factory.h
dali/internal/imaging/file.list
dali/internal/system/common/configuration-manager.h
dali/internal/system/common/environment-options.h
dali/internal/system/common/time-service.h
dali/internal/window-system/common/display-connection.h
dali/internal/window-system/common/event-handler.h
dali/internal/window-system/common/gl-window-impl.cpp [deleted file]
dali/internal/window-system/common/gl-window-impl.h [deleted file]
dali/internal/window-system/common/gl-window-render-thread.cpp [deleted file]
dali/internal/window-system/common/gl-window-render-thread.h [deleted file]
dali/internal/window-system/common/native-image-surface-factory-dynamic.cpp [new file with mode: 0644]
dali/internal/window-system/common/native-image-surface-factory.h
dali/internal/window-system/common/render-surface-factory-dynamic.cpp [new file with mode: 0644]
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-factory.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-render-surface.h
dali/internal/window-system/common/window-system.h
dali/internal/window-system/file.list
dali/internal/window-system/gl-window/gl-window-addon.cpp [new file with mode: 0644]
dali/internal/window-system/gl-window/gl-window-impl.cpp [new file with mode: 0644]
dali/internal/window-system/gl-window/gl-window-impl.h [new file with mode: 0644]
dali/internal/window-system/gl-window/gl-window-render-thread.cpp [new file with mode: 0644]
dali/internal/window-system/gl-window/gl-window-render-thread.h [new file with mode: 0644]
dali/internal/window-system/tizen-wayland/display-connection-native-types-dynamic.cpp [new file with mode: 0644]
dali/internal/window-system/tizen-wayland/graphics-library-functions-tizen-wayland.cpp [new file with mode: 0644]
dali/internal/window-system/tizen-wayland/native-image-surface-impl-ecore-wl-egl.cpp
dali/internal/window-system/ubuntu-x11/display-connection-native-types-dynamic.cpp [new file with mode: 0644]
dali/internal/window-system/ubuntu-x11/graphics-library-functions-ubuntu-x11.cpp [new file with mode: 0644]
dali/internal/window-system/x11/display-connection-native-types-dynamic.cpp [new file with mode: 0644]
dali/internal/window-system/x11/graphics-library-functions-x11.cpp [new file with mode: 0644]
dali/internal/window-system/x11/window-system-x.h
dali/public-api/adaptor-framework/graphics-backend.cpp
dali/public-api/adaptor-framework/native-image-source.cpp
packaging/dali-adaptor.spec

index 029307955bae726dcbdc8bea27c0f26eb8a368e7..365fd4e70555ab3b3790536b55ae99e4ceef4a36 100644 (file)
@@ -92,9 +92,15 @@ INCLUDE_DIRECTORIES(
     ../dali-adaptor/dali-test-suite-utils
 )
 
+FIND_LIBRARY(GLES_GRAPHICS_LIB_FOUND NAMES dali2-adaptor-gles PATHS ${${CAPI_LIB}_LIBRARY_DIRS})
+IF(GLES_GRAPHICS_LIB_FOUND)
+    SET(GLES_GRAPHICS_LIB "-ldali2-adaptor-gles")
+ENDIF()
+
 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
 TARGET_LINK_LIBRARIES(${EXEC_NAME}
     ${${CAPI_LIB}_LIBRARIES}
+    ${GLES_GRAPHICS_LIB}
     -lpthread --coverage -rdynamic
 )
 
index b6d00f163d80d293668081757d606611525617a7..9cf30369a51d8628df01dc9a4243c4e870c37aec 100644 (file)
@@ -40,6 +40,7 @@ LIST(APPEND TC_SOURCES
     dali-test-suite-utils/mesh-builder.cpp
     dali-test-suite-utils/dali-test-suite-utils.cpp
     dali-test-suite-utils/test-actor-utils.cpp
+    dali-test-suite-utils/test-addon-manager.cpp
     dali-test-suite-utils/test-harness.cpp
     dali-test-suite-utils/test-application.cpp
     dali-test-suite-utils/test-gesture-generator.cpp
@@ -91,7 +92,7 @@ INCLUDE_DIRECTORIES(
 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
 TARGET_LINK_LIBRARIES(${EXEC_NAME}
   ${${CAPI_LIB}_LIBRARIES}
-  --coverage
+  -ldl --coverage
 )
 
 INSTALL(PROGRAMS ${EXEC_NAME}
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-addon-manager.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-addon-manager.cpp
new file mode 100644 (file)
index 0000000..71031c0
--- /dev/null
@@ -0,0 +1,265 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include "test-addon-manager.h"
+
+#include <dali-test-suite-utils.h>
+#include <dlfcn.h>
+#include <memory>
+
+#include <cstring>
+
+#ifndef ADDON_LIBS_PATH
+#define ADDON_LIBS_PATH ""
+#endif
+
+namespace Test
+{
+using namespace Dali;
+
+void AddOnManager::Initialize()
+{
+  // Only create an instance if we haven't created one already
+  if(!AddOnManager::Get())
+  {
+    static std::unique_ptr<AddOnManager> sAddonManager(new AddOnManager);
+    // Memory will be freed upon test completion
+  }
+}
+
+std::vector<std::string> AddOnManager::EnumerateAddOns()
+{
+  std::string listFileName(ADDON_LIBS_PATH);
+  listFileName += "/addons.txt";
+
+  // Read list of available test addons
+  tet_printf("Enumerating addons, file: %s\n", listFileName.c_str());
+  std::vector<std::string> addons{};
+  auto*                    fin     = fopen(listFileName.c_str(), "r");
+  char*                    lineBuf = new char[256];
+  memset(lineBuf, 0, 256);
+  size_t n = 256;
+  while(getline(&lineBuf, &n, fin) > 0)
+  {
+    char* c = lineBuf;
+    while(*c)
+    {
+      if(*c == '\n' || *c == '\r')
+      {
+        *c = 0;
+        break;
+      }
+      ++c;
+    }
+    tet_printf("Adding %s\n", lineBuf);
+    addons.emplace_back(lineBuf);
+    memset(lineBuf, 0, 256);
+  }
+  fclose(fin);
+  delete[] lineBuf;
+  std::vector<std::string> retval{};
+  // Open addons
+  for(auto& name : addons)
+  {
+    std::string path(ADDON_LIBS_PATH);
+    path += "/";
+    path += name;
+
+    mAddOnCache.emplace_back();
+    mAddOnCache.back().handle = dlopen(path.c_str(), RTLD_DEEPBIND | RTLD_LAZY);
+    if(!mAddOnCache.back().handle)
+    {
+      mAddOnCache.back().valid = false;
+      tet_printf("Can't open addon lib: %s\n", path.c_str());
+      continue;
+    }
+    // Here addon must self register
+    if(!mAddOnCache.back().valid)
+    {
+      puts("Addon invalid!");
+    }
+    else
+    {
+      tet_printf("Valid AddOn: %s\n", mAddOnCache.back().name.c_str());
+      retval.emplace_back(mAddOnCache.back().name);
+    }
+  }
+
+  return retval;
+
+  /**
+   * Check for self-registering addons
+   */
+}
+
+void AddOnManager::RegisterAddOnDispatchTable(const AddOnDispatchTable* dispatchTable)
+{
+  // Register the dispatch table
+  auto& entry = mAddOnCache.back();
+  entry.name  = dispatchTable->name;
+  tet_printf("Registering AddOn: %s\n", entry.name.c_str());
+  entry.GetGlobalProc   = dispatchTable->GetGlobalProc;
+  entry.GetInstanceProc = dispatchTable->GetInstanceProc;
+  entry.GetAddOnInfo    = dispatchTable->GetAddOnInfo;
+  entry.OnStart         = dispatchTable->OnStart;
+  entry.OnStop          = dispatchTable->OnStop;
+  entry.OnPause         = dispatchTable->OnPause;
+  entry.OnResume        = dispatchTable->OnResume;
+  entry.valid           = true;
+}
+
+bool AddOnManager::GetAddOnInfo(const std::string& name, AddOnInfo& info)
+{
+  auto retval = false;
+  std::find_if(mAddOnCache.begin(), mAddOnCache.end(), [&retval, name, &info](AddOnCacheEntry& entry) {
+    if(entry.name == name)
+    {
+      entry.GetAddOnInfo(info);
+      retval = true;
+      return true;
+    }
+    return false;
+  });
+  return retval;
+}
+
+std::vector<AddOnLibrary> AddOnManager::LoadAddOns(const std::vector<std::string>& addonNames)
+{
+  if(mAddOnCache.empty())
+  {
+    EnumerateAddOns();
+  }
+
+  std::vector<AddOnLibrary> retval{};
+  for(auto& name : addonNames)
+  {
+    size_t index = 0;
+    auto   iter  = std::find_if(mAddOnCache.begin(), mAddOnCache.end(), [&retval, name, &index](AddOnCacheEntry& entry) {
+      index++;
+      if(entry.name == name)
+      {
+        return true;
+      }
+      return false;
+    });
+    if(iter != mAddOnCache.end())
+    {
+      retval.emplace_back(*reinterpret_cast<void**>(&index));
+    }
+    else
+    {
+      retval.emplace_back(nullptr);
+    }
+  }
+
+  return retval;
+}
+
+AddOnLibrary AddOnManager::LoadAddOn(const std::string& addonName, const std::string& libraryName)
+{
+  AddOnLibrary addOnLibrary = nullptr;
+  size_t       index        = 0;
+  auto         iter         = std::find_if(mAddOnCache.begin(), mAddOnCache.end(), [&addonName, &index](AddOnCacheEntry& entry) {
+    index++;
+    return (entry.name == addonName);
+  });
+
+  if(iter != mAddOnCache.end())
+  {
+    addOnLibrary = reinterpret_cast<void*>(index);
+  }
+  else
+  {
+    mAddOnCache.emplace_back();
+    mAddOnCache.back().handle = dlopen(libraryName.c_str(), RTLD_LAZY); // We want to override some called methods in test code so don't do a deepbind
+    if(!mAddOnCache.back().handle)
+    {
+      mAddOnCache.back().valid = false;
+      tet_printf("Can't open addon lib: %s\n", libraryName.c_str());
+    }
+    // Here addon must self register
+    if(!mAddOnCache.back().valid)
+    {
+      puts("Addon invalid!");
+    }
+    else
+    {
+      tet_printf("Valid AddOn: %s\n", mAddOnCache.back().name.c_str());
+      addOnLibrary = reinterpret_cast<void*>(mAddOnCache.size());
+    }
+  }
+
+  return addOnLibrary;
+}
+
+void* AddOnManager::GetGlobalProc(const Dali::AddOnLibrary& addOnLibrary, const char* procName)
+{
+  auto index = *reinterpret_cast<const size_t*>(&addOnLibrary);
+  return mAddOnCache[index - 1].GetGlobalProc(procName);
+}
+
+void* AddOnManager::GetInstanceProc(const Dali::AddOnLibrary& addOnLibrary, const char* procName)
+{
+  auto index = *reinterpret_cast<const size_t*>(&addOnLibrary);
+  return mAddOnCache[index - 1].GetInstanceProc(procName);
+}
+
+void AddOnManager::Start()
+{
+  for(auto& entry : mAddOnCache)
+  {
+    if(entry.OnStart)
+    {
+      entry.OnStart();
+    }
+  }
+}
+
+void AddOnManager::Resume()
+{
+  for(auto& entry : mAddOnCache)
+  {
+    if(entry.OnResume)
+    {
+      entry.OnResume();
+    }
+  }
+}
+
+void AddOnManager::Stop()
+{
+  for(auto& entry : mAddOnCache)
+  {
+    if(entry.OnStop)
+    {
+      entry.OnStop();
+    }
+  }
+}
+
+void AddOnManager::Pause()
+{
+  for(auto& entry : mAddOnCache)
+  {
+    if(entry.OnPause)
+    {
+      entry.OnPause();
+    }
+  }
+}
+
+} // namespace Test
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-addon-manager.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-addon-manager.h
new file mode 100644 (file)
index 0000000..ed7a775
--- /dev/null
@@ -0,0 +1,93 @@
+#ifndef TEST_ADDON_MANAGER_H
+#define TEST_ADDON_MANAGER_H
+
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali/integration-api/addon-manager.h>
+#include <dali/public-api/common/vector-wrapper.h>
+
+#include <string>
+
+namespace Test
+{
+class AddOnManager : public Dali::Integration::AddOnManager
+{
+public:
+  /**
+   * Initializes the test addon manager so that it can be used by DALi.
+   */
+  static void Initialize();
+
+  /**
+   * @brief Constructor, initialised by the Adaptor
+   */
+  AddOnManager() = default;
+
+  /**
+   * @brief Destructor
+   */
+  ~AddOnManager() override = default;
+
+  std::vector<std::string> EnumerateAddOns() override;
+
+  bool GetAddOnInfo(const std::string& name, Dali::AddOnInfo& info) override;
+
+  std::vector<Dali::AddOnLibrary> LoadAddOns(const std::vector<std::string>& addonNames) override;
+
+  Dali::AddOnLibrary LoadAddOn(const std::string& addonName, const std::string& libraryName) override;
+
+  void* GetGlobalProc(const Dali::AddOnLibrary& addOnLibrary, const char* procName) override;
+
+  void* GetInstanceProc(const Dali::AddOnLibrary& addOnLibrary, const char* procName) override;
+
+  void RegisterAddOnDispatchTable(const Dali::AddOnDispatchTable* dispatchTable) override;
+
+  void Start() override;
+
+  void Resume() override;
+
+  void Stop() override;
+
+  void Pause() override;
+
+  struct AddOnCacheEntry
+  {
+    std::string     name{};
+    Dali::AddOnInfo info{};
+
+    // library handle
+    void* handle{nullptr};
+
+    // main function pointers
+    void (*GetAddOnInfo)(Dali::AddOnInfo&) = nullptr; ///< Returns AddOnInfo structure
+    void* (*GetInstanceProc)(const char*)  = nullptr; ///< Returns pointer of instance function (member funtion)
+    void* (*GetGlobalProc)(const char*)    = nullptr; ///< Returns pointer of global function (non-member function)
+
+    void (*OnStart)()  = nullptr;
+    void (*OnResume)() = nullptr;
+    void (*OnPause)()  = nullptr;
+    void (*OnStop)()   = nullptr;
+
+    bool valid = false;
+  };
+
+  std::vector<AddOnCacheEntry> mAddOnCache;
+};
+} // Namespace Test
+
+#endif // TEST_ADDON_MANAGER_H
index 746c6be5f39da8e0bfb59b5e552bc7ab2257cd5c..e3ba14c5689ca309612b63847de20923e6126527 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -20,6 +20,7 @@
 #include <dali/dali.h>
 #include <dali/devel-api/adaptor-framework/gl-window.h>
 #include <dali/internal/system/linux/dali-ecore-x.h>
+#include <test-addon-manager.h>
 
 using namespace Dali;
 
@@ -80,6 +81,9 @@ int UtcDaliGlWindowDestructorP(void)
 
 int UtcDaliGlWindowNew1(void)
 {
+  TestApplication application;
+  Test::AddOnManager::Initialize(); // GlWindow requires Gl Window addon so initialize the manager
+
   try
   {
     PositionSize   windowPosition(0, 0, 10, 10);
@@ -96,6 +100,9 @@ int UtcDaliGlWindowNew1(void)
 
 int UtcDaliGlWindowNew2(void)
 {
+  TestApplication application;
+  Test::AddOnManager::Initialize(); // GlWindow requires Gl Window addon so initialize the manager
+
   try
   {
     PositionSize   windowPosition(20, 10, 10, 10);
index eac61238ee9bca0ce410d101f582b4f4e3841a12..1c206972e177eff758bee440686272abb8b9db12 100644 (file)
@@ -65,9 +65,15 @@ INCLUDE_DIRECTORIES(
   ../dali-adaptor/dali-test-suite-utils
 )
 
+FIND_LIBRARY(GLES_GRAPHICS_LIB_FOUND NAMES dali2-adaptor-gles PATHS ${${CAPI_LIB}_LIBRARY_DIRS})
+IF(GLES_GRAPHICS_LIB_FOUND)
+    SET(GLES_GRAPHICS_LIB "-ldali2-adaptor-gles")
+ENDIF()
+
 ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.cpp ${TC_SOURCES})
 TARGET_LINK_LIBRARIES(${EXEC_NAME}
   ${${CAPI_LIB}_LIBRARIES}
+  ${GLES_GRAPHICS_LIB}
   --coverage
 )
 
index 1ab58fe0d006d59fcc48ed350fb15205c6504111..382092263d555cdd575d96a972b649e293096e33 100644 (file)
@@ -12,5 +12,7 @@ doc
 install_manifest.txt
 libdali2-adaptor.so.*
 linker-test
+linker-test-gles
+linker-test-vulkan
 *config.cmake
 *.dylib
index 4a85d99faf22b0975675b26b621641a7656d3ab2..a4f38d5749a1596f7efab52f802841869c0a744b 100644 (file)
@@ -207,6 +207,73 @@ IF(DEFINED STATIC)
   SET(LIBTYPE STATIC)
 ENDIF()
 
+IF(DEFINED ADAPTOR_GRAPHICS_GLES_SOURCES AND DEFINED ADAPTOR_GRAPHICS_VULKAN_SOURCES)
+  IF(enable_graphics_backend MATCHES DYNAMIC)
+    # Separate GLES Graphics Library
+    SET(ADAPTOR_GRAPHICS_GLES_NAME "${name}-gles")
+    ADD_LIBRARY(${ADAPTOR_GRAPHICS_GLES_NAME} ${LIBTYPE} ${ADAPTOR_GRAPHICS_GLES_SOURCES})
+    TARGET_COMPILE_OPTIONS(${ADAPTOR_GRAPHICS_GLES_NAME} PRIVATE ${DALI_CFLAGS})
+    TARGET_LINK_LIBRARIES(${ADAPTOR_GRAPHICS_GLES_NAME}
+            ${name}
+            ${DALICORE_LDFLAGS}
+            ${DALIADAPTOR_LDFLAGS}
+            ${COVERAGE}
+            ${OPENGLES20_LDFLAGS}
+            ${EGL_LDFLAGS}
+    )
+    INSTALL(TARGETS ${ADAPTOR_GRAPHICS_GLES_NAME} DESTINATION ${LIB_DIR})
+
+    # Linker Test for GLES Graphics
+    SET(LINKER_TEST_GLES_NAME ${DALI_ADAPTOR_PREFIX}linker-test-gles)
+    ADD_EXECUTABLE(${LINKER_TEST_GLES_NAME} linker-test-graphics-library.cpp)
+    TARGET_COMPILE_OPTIONS(${LINKER_TEST_GLES_NAME} PRIVATE -I${ROOT_SRC_DIR} ${DALI_CFLAGS} )
+    TARGET_LINK_LIBRARIES(${LINKER_TEST_GLES_NAME} ${name} ${DALI_LDFLAGS} ${ADAPTOR_GRAPHICS_GLES_NAME})
+
+    # Separate Vulkan Graphics Library
+    SET(ADAPTOR_GRAPHICS_VULKAN_NAME "${name}-vulkan")
+    ADD_LIBRARY(${ADAPTOR_GRAPHICS_VULKAN_NAME} ${LIBTYPE} ${ADAPTOR_GRAPHICS_VULKAN_SOURCES})
+    TARGET_COMPILE_OPTIONS(${ADAPTOR_GRAPHICS_VULKAN_NAME} PRIVATE -DVULKAN_HPP_NO_EXCEPTIONS ${DALI_CFLAGS})
+    TARGET_LINK_LIBRARIES(${ADAPTOR_GRAPHICS_VULKAN_NAME}
+            ${name}
+            ${DALICORE_LDFLAGS}
+            ${DALIADAPTOR_LDFLAGS}
+            ${COVERAGE}
+            ${VULKAN_LDFLAGS}
+            ${GLSLANG_LDFLAGS}
+            ${SPIRVTOOLS_LDFLAGS}
+    )
+    INSTALL(TARGETS ${ADAPTOR_GRAPHICS_VULKAN_NAME} DESTINATION ${LIB_DIR})
+
+    # Linker Test for Vulkan Graphics
+    SET(LINKER_TEST_VULKAN_NAME ${DALI_ADAPTOR_PREFIX}linker-test-vulkan)
+    ADD_EXECUTABLE(${LINKER_TEST_VULKAN_NAME} linker-test-graphics-library.cpp)
+    TARGET_COMPILE_OPTIONS(${LINKER_TEST_VULKAN_NAME} PRIVATE -I${ROOT_SRC_DIR} ${DALI_CFLAGS} )
+    TARGET_LINK_LIBRARIES(${LINKER_TEST_VULKAN_NAME} ${name} ${DALI_LDFLAGS} ${ADAPTOR_GRAPHICS_VULKAN_NAME})
+
+    SET(GRAPHICS_BACKEND_TYPE "Dynamic (GLES/VULKAN)")
+  ELSEIF(enable_graphics_backend MATCHES GLES)
+    # Add GLES sources to main adaptor library
+    SET(GRAPHICS_BACKEND_TYPE "GLES")
+    SET(SOURCES ${SOURCES} ${ADAPTOR_GRAPHICS_GLES_SOURCES})
+    SET(OPTIONAL_LIBS ${OPTIONAL_LIBS}
+            ${OPENGLES20_LDFLAGS}
+            ${EGL_LDFLAGS}
+    )
+  ELSEIF(enable_graphics_backend MATCHES VULKAN)
+    # Add VULKAN sources to main adaptor library
+    SET(GRAPHICS_BACKEND_TYPE "VULKAN")
+    SET(SOURCES ${SOURCES} ${ADAPTOR_GRAPHICS_VULKAN_SOURCES})
+    SET(OPTIONAL_LIBS ${OPTIONAL_LIBS}
+            ${VULKAN_LDFLAGS}
+            ${GLSLANG_LDFLAGS}
+            ${SPIRVTOOLS_LDFLAGS}
+    )
+  ENDIF()
+ELSE()
+  # If variables are not defined then profile does not support VULKAN and assumed to have added GLES sources
+  SET(GRAPHICS_BACKEND_TYPE "GLES")
+ENDIF()
+
 ADD_LIBRARY( ${name} ${LIBTYPE} ${SOURCES} )
 
 IF( UNIX )
@@ -285,6 +352,22 @@ MACRO(INSTALL_HEADERS_WITH_DIRECTORY HEADER_LIST STRIP_PREFIX REPLACE_PREFIX)
   ENDFOREACH(HEADER)
 ENDMACRO(INSTALL_HEADERS_WITH_DIRECTORY)
 
+# GlWindow Addon
+IF(DEFINED GL_WINDOW_ADDON_SOURCES)
+  SET(ADAPTOR_GL_WINDOW_ADDON_NAME "${name}-gl-window-addon")
+  ADD_LIBRARY(${ADAPTOR_GL_WINDOW_ADDON_NAME} ${LIBTYPE} ${GL_WINDOW_ADDON_SOURCES})
+  TARGET_LINK_LIBRARIES(${ADAPTOR_GL_WINDOW_ADDON_NAME}
+          ${name}
+          ${DALICORE_LDFLAGS}
+          ${DALIADAPTOR_LDFLAGS}
+          ${COVERAGE}
+          ${ADAPTOR_GRAPHICS_GLES_NAME}
+  )
+  INSTALL( TARGETS ${ADAPTOR_GL_WINDOW_ADDON_NAME} DESTINATION ${LIB_DIR})
+  SET(GLWINDOW_ADDON_ENABLED "ON")
+ELSE()
+  SET(GLWINDOW_ADDON_ENABLED "OFF")
+ENDIF()
 
 ########################################################################################
 # INSTALL:
@@ -441,6 +524,7 @@ MESSAGE( STATUS "Coverage:                         ${ENABLE_COVERAGE}" )
 MESSAGE( STATUS "Debug Build:                      ${ENABLE_DEBUG}")
 MESSAGE( STATUS "Freetype bitmap support (Emoji):  ${freetype_bitmap_support_ENABLED}")
 MESSAGE( STATUS "Profile:                          ${ENABLE_PROFILE}")
+MESSAGE( STATUS "Graphics Backend:                 ${GRAPHICS_BACKEND_TYPE}")
 MESSAGE( STATUS "Data Dir (Read/Write):            ${dataReadWriteDir}")
 MESSAGE( STATUS "Data Dir (Read Only):             ${dataReadOnlyDir}")
 MESSAGE( STATUS "WebP:                             ${webp_available_ENABLED}")
@@ -454,6 +538,7 @@ MESSAGE( STATUS "Enable AT-SPI:                    ${ENABLE_ATSPI}" )
 MESSAGE( STATUS "Enable AppModel:                  ${ENABLE_APPMODEL}" )
 MESSAGE( STATUS "Enable Trace:                     ${ENABLE_TRACE_STRING}" )
 MESSAGE( STATUS "Enable VConf:                     ${ENABLE_VCONF}" )
+MESSAGE( STATUS "GlWindow Addon:                   ${GLWINDOW_ADDON_ENABLED}")
 MESSAGE( STATUS "Tizen Platform Config supported   ${TIZEN_PLATFORM_CONFIG_SUPPORTED_LOGMSG}")
 MESSAGE( STATUS "ThorVG version:                   ${THORVG_VERSION}")
 MESSAGE( STATUS "Compile flags:                    ${CMAKE_CXX_FLAGS}")
@@ -461,8 +546,6 @@ MESSAGE( STATUS "Compile flags:                    ${CMAKE_C_FLAGS}")
 MESSAGE( STATUS "CMAKE_SYSROOT:                    ${CMAKE_SYSROOT}")
 MESSAGE( STATUS "CMAKE_SYSTEM_INCLUDE_PATH:        ${CMAKE_SYSTEM_INCLUDE_PATH}")
 MESSAGE( STATUS "CMAKE_SYSTEM_LIBRARY_PATH:        ${CMAKE_SYSTEM_LIBRARY_PATH}")
-MESSAGE( STATUS "Vulkan:                           ${ENABLE_VULKAN}")
-MESSAGE( STATUS "Vulkan GLSLang:                   ${ENABLE_GLSLANG}")
 
 IF( enable_feedback )
   ADD_SUBDIRECTORY( plugins )
index 803bfaf15f083d8601c270d5d4431d5e17d8e48f..83e110f5e8d44411236378af3b1e99decd39263c 100644 (file)
@@ -15,6 +15,10 @@ ARG_ENABLE( ENABLE_APPFW enable_appfw ${ENABLE_VAL} "Builds with Tizen App frame
 # Tizen Profile option
 ARG_ENABLE( ENABLE_PROFILE enable_profile "${ENABLE_VAL};UBUNTU" "Select the variant of tizen" )
 
+# Graphics Backend option
+ARG_ENABLE( ENABLE_GRAPHICS_BACKEND enable_graphics_backend "${ENABLE_VAL};DYNAMIC" "Select the graphics backend to use (DYNAMIC/GLES/VULKAN)" )
+ARG_ENABLE( ENABLE_VULKAN enable_vulkan "${ENABLE_VAL}" "Enables Vulkan build (Deprecated)") # Keep for backwards compatibility
+
 # Tizen Major version
 ARG_ENABLE( ENABLE_TIZEN_MAJOR_VERSION enable_tizen_major_version "${ENABLE_VAL};0" "Specify the Tizen Major version for backwards compatibility" )
 
@@ -25,24 +29,9 @@ ARG_ENABLE( ENABLE_WAYLAND enable_wayland "${ENABLE_VAL}" "Build on Wayland" )
 ARG_ENABLE( ENABLE_RENAME_SO enable_rename_so "${ENABLE_VAL};1" "Specify whether so file is renamed or not" )
 ARG_ENABLE( ENABLE_COVERAGE enable_coverage "${ENABLE_VAL}" "Enables coverage" )
 
-ARG_ENABLE( ENABLE_VULKAN enable_vulkan "${ENABLE_VAL}" "Enables Vulkan build")
-
-# force GLSLANG when Vulkan enabled
-IF( enable_vulkan )
-  SET(ENABLE_GLSLANG CACHE STRING "ON")
-  SET(ENABLE_GLSLANG  "ON")
-ENDIF()
-
-ARG_ENABLE( ENABLE_GLSLANG enable_glslang "${ENABLE_VAL}" "Enables Vulkan GLSLang")
-
 # help option
 ARG_ENABLE( PRINT_HELP print_help "${ENABLE_VAL}" "Prints help" )
 
-# If Vulkan is enabled GLSLang is used by default
-IF( ENABLE_VULKAN )
-  SET(enable_glslang ON)
-ENDIF()
-
 IF( print_help )
   MESSAGE( STATUS ${HELP_ENABLES} )
   EXIT()
@@ -83,6 +72,24 @@ ELSE()
   SET( DEVICE_PROFILE 1 )
 ENDIF()
 
+IF( NOT enable_graphics_backend )
+  IF( ANDROID_PROFILE OR MACOS_PROFILE OR WINDOWS_PROFILE )
+    SET( enable_graphics_backend GLES )
+  ELSE()
+    SET( enable_graphics_backend DYNAMIC )
+  ENDIF()
+ENDIF()
+
+IF(enable_vulkan AND NOT ANDROID_PROFILE AND NOT MACOS_PROFILE AND NOT WINDOWS_PROFILE )
+  SET(enable_graphics_backend VULKAN)
+ENDIF()
+
+# Test for graphics backend and exit if something wrong
+SET( VALID_GRAPHICS_BACKENDS VULKAN GLES DYNAMIC)
+LIST( FIND VALID_GRAPHICS_BACKENDS ${enable_graphics_backend} RESULT_GRAPHICS_BACKEND )
+IF( RESULT_GRAPHICS_BACKEND EQUAL -1 )
+  MESSAGE( FATAL_ERROR "Invalid graphics backend!" )
+ENDIF()
 
 # TODO check what version we really need for Android
 IF( ANDROID_PROFILE )
@@ -151,15 +158,19 @@ CHECK_MODULE_AND_SET( DALICORE dali2-core [] )
 
 CHECK_MODULE_AND_SET( THORVG thorvg thorvg_support )
 
-IF( ENABLE_VULKAN )
-  CHECK_MODULE_AND_SET( VULKAN vulkan [] )
-  CHECK_MODULE_AND_SET( GLSLANG glslang [] )
-  CHECK_MODULE_AND_SET( SPIRVTOOLS SPIRV-Tools [] )
+CHECK_MODULE_AND_SET( VULKAN vulkan VULKAN )
+IF(VULKAN_ENABLED)
+  CHECK_MODULE_AND_SET( GLSLANG glslang GLSLANG )
+  CHECK_MODULE_AND_SET( SPIRVTOOLS SPIRV-Tools SPIRVTOOLS )
 ELSE()
-  CHECK_MODULE_AND_SET( OPENGLES20 glesv2 [] )
-  CHECK_MODULE_AND_SET( EGL egl [] )
+  SET(GLSLANG_ENABLED OFF)
+  SET(SPIRVTOOLS_ENABLED OFF)
+  SET(enable_graphics_backend GLES)
 ENDIF()
 
+CHECK_MODULE_AND_SET( OPENGLES20 glesv2 [] )
+CHECK_MODULE_AND_SET( EGL egl [] )
+
 IF( thorvg_support )
   SET( THORVG_VERSION ${THORVG_VERSION_STRING} )
   ADD_DEFINITIONS( -DTHORVG_SUPPORT )
@@ -494,8 +505,8 @@ IF( WAYLAND )
     ${WAYLAND_LDFLAGS}
   )
 ENDIF()
-IF(enable_vulkan)
-  ADD_DEFINITIONS( -DVULKAN_ENABLED )
+
+IF(VULKAN_ENABLED)
   ADD_DEFINITIONS( -DVULKAN_HPP_NO_EXCEPTIONS )
 #gcc_flags = -Wno-return-local-addr -Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override \
 #            -Wstack-usage=256 -Wunsafe-loop-optimizations -Wzero-as-null-pointer-constant -Wuseless-cast
@@ -525,31 +536,25 @@ IF(enable_vulkan)
   IF (HAVE_NO_CLASS_MEMACCESS)
     ADD_COMPILE_OPTIONS( $<$<COMPILE_LANGUAGE:CXX>:-Wno-class-memaccess>)
   ENDIF()
-  IF( enable_wayland )
-    ADD_DEFINITIONS( -DVULKAN_WITH_WAYLAND )
-  ELSEIF(X11_REQUIRED)
+  IF(X11_REQUIRED)
     SET(DALI_CFLAGS ${DALI_CFLAGS} ${XCB_CFLAGS} )
     SET(DALI_LDFLAGS ${DALI_LDFLAGS} ${XCB_LDFLAGS} )
   ENDIF()
   SET(DALI_CFLAGS ${DALI_CFLAGS} ${VULKAN_CFLAGS} )
   SET(DALI_LDFLAGS ${DALI_LDFLAGS} ${VULKAN_LDFLAGS} )
-ENDIF()
 
-IF(enable_glslang)
   # glsllang-dev package on Ubuntu seems to be broken and doesn't
   # provide valid cmake config files. On Tizen cmake files are valid
   # but there's no pkg-config files so we handle both ways of obtaining
   # package configuration.
   IF(NOT GLSLANG_LDFLAGS)
     FIND_PACKAGE(glslang)
-    SET(DALI_LDFLAGS ${DALI_LDFLAGS} glslang::glslang glslang::SPIRV glslang::glslang-default-resource-limits)
+    SET(GLSLANG_LDFLAGS glslang::glslang glslang::SPIRV glslang::glslang-default-resource-limits)
   ELSE()
     # On Ubuntu 22.04 glslang seems to be horribly broken, pc file doesn't include
     # all needed deps and SPIRV-Tools package is needed
-    SET(DALI_LDFLAGS ${DALI_LDFLAGS} ${GLSLANG_LDFLAGS} -lSPIRV ${SPIRVTOOLS_LDFLAGS} -lglslang-default-resource-limits)
+    SET(GLSLANG_LDFLAGS ${GLSLANG_LDFLAGS} -lSPIRV ${SPIRVTOOLS_LDFLAGS} -lglslang-default-resource-limits)
   ENDIF()
-
-  SET(DALI_CFLAGS ${DALI_CFLAGS} ${GLSLANG_CFLAGS} )
 ENDIF()
 
 IF(LIBUV_X11_PROFILE)
diff --git a/build/tizen/linker-test-graphics-library.cpp b/build/tizen/linker-test-graphics-library.cpp
new file mode 100644 (file)
index 0000000..9968279
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-library.h>
+#include <dali/internal/window-system/common/native-image-surface-impl.h>
+
+// Dummy Implementation for NativeWindowInterface
+class NativeWindowDummyImpl : public Dali::Graphics::NativeWindowInterface
+{
+public:
+  Dali::Any GetNativeWindow() override
+  {
+    return {};
+  }
+  int GetNativeWindowId() override
+  {
+    return 0;
+  }
+};
+
+extern "C"
+{
+  extern std::unique_ptr<Dali::Internal::Adaptor::GraphicsFactoryInterface> CreateGraphicsFactory(Dali::Internal::Adaptor::EnvironmentOptions& environmentOptions);
+  extern std::unique_ptr<Dali::Internal::Adaptor::RenderSurfaceFactory>     GetRenderSurfaceFactory();
+  extern std::unique_ptr<Dali::Internal::Adaptor::NativeImageSourceFactory> GetNativeImageSourceFactory();
+  extern std::unique_ptr<Dali::Internal::Adaptor::NativeImageSurface>       CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr queue);
+  extern std::unique_ptr<Dali::Graphics::SurfaceFactory>                    CreateSurfaceFactory(Dali::Graphics::NativeWindowInterface& nativeWindow);
+} // extern "C"
+
+int main(int argc, char** argv)
+{
+  Dali::Internal::Adaptor::EnvironmentOptions options;
+  CreateGraphicsFactory(options);
+
+  [[maybe_unused]] auto renderSurfaceFactory = GetRenderSurfaceFactory();
+  [[maybe_unused]] auto imageSourceFactory   = GetNativeImageSourceFactory();
+  [[maybe_unused]] auto nativeImageSurface   = CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr());
+
+  NativeWindowDummyImpl nativeWindow;
+  [[maybe_unused]] auto surfaceFactory = CreateSurfaceFactory(nativeWindow);
+
+  return 0;
+}
index 33ce625d8f18efca08816aeeb42cbe6349aa072e..d8a558ee6e37ac341784476d99104d693ec73b04 100644 (file)
@@ -48,8 +48,6 @@ SET( SOURCES
         ${static_libraries_libunibreak_src_files}
         ${adaptor_addons_common_src_files}
         ${adaptor_addons_dummy_src_files}
-        ${adaptor_devel_api_egl_src_files}
-        ${adaptor_window_system_common_egl_src_files}
 )
 
 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
index 6c39dd59248474fd270bb65c6c5b737747010d53..22486ddc162d45fc82a0fbff836bc848cd8fb453 100644 (file)
@@ -14,8 +14,10 @@ SET( SOURCES
     ${devel_api_src_files}
     ${adaptor_devel_api_text_abstraction_src_files}
     ${adaptor_graphics_common_src_files}
+    ${adaptor_graphics_common_dynamic_src_files}
     ${adaptor_haptics_common_src_files}
     ${adaptor_imaging_common_src_files}
+    ${adaptor_imaging_common_dynamic_src_files}
     ${adaptor_imaging_tizen_src_files}
     ${adaptor_input_common_src_files}
     ${adaptor_input_tizen_wayland_src_files}
@@ -38,8 +40,10 @@ SET( SOURCES
     ${adaptor_camera_common_src_files}
     ${adaptor_web_engine_common_src_files}
     ${adaptor_window_system_common_src_files}
+    ${adaptor_window_system_common_dynamic_src_files}
     ${adaptor_window_system_tizen_src_files}
     ${adaptor_window_system_tizen_wayland_src_files}
+    ${adaptor_window_system_tizen_wayland_dynamic_src_files}
     ${adaptor_trace_common_src_files}
     ${adaptor_thread_common_src_files}
     ${adaptor_thread_linux_src_files}
@@ -49,24 +53,29 @@ SET( SOURCES
     ${static_libraries_libunibreak_src_files}
 )
 
-IF( ENABLE_VULKAN )
-  SET(SOURCES ${SOURCES}
+# GLES Graphics Library
+SET(ADAPTOR_GRAPHICS_GLES_SOURCES
+    ${adaptor_graphics_gles_src_files}
+    ${adaptor_graphics_tizen_src_files}
+    ${adaptor_imaging_tizen_egl_src_files}
+    ${adaptor_window_system_tizen_wayland_egl_src_files}
+    ${adaptor_graphics_library_common_src_files}
+    ${adaptor_window_system_tizen_wayland_graphics_library_src_files}
+)
+
+# Vulkan Graphics Library
+SET(ADAPTOR_GRAPHICS_VULKAN_SOURCES
     ${adaptor_graphics_vulkan_src_files}
     ${adaptor_graphics_vulkan_wayland_src_files}
     ${adaptor_imaging_tizen_vulkan_src_files}
     ${adaptor_libraries_spirv_reflect_src_files}
     ${adaptor_window_system_tizen_wayland_vulkan_src_files}
-  )
-ELSE()
-  SET(SOURCES ${SOURCES}
-    ${adaptor_graphics_gles_src_files}
-    ${adaptor_graphics_tizen_src_files}
-    ${adaptor_imaging_tizen_egl_src_files}
-    ${adaptor_devel_api_egl_src_files}
-    ${adaptor_window_system_common_egl_src_files}
-    ${adaptor_window_system_tizen_wayland_egl_src_files}
-  )
-ENDIF()
+    ${adaptor_graphics_library_common_src_files}
+    ${adaptor_window_system_tizen_wayland_graphics_library_src_files}
+)
+
+# GlWindow Addon
+SET( GL_WINDOW_ADDON_SOURCES ${adaptor_window_system_gl_window_src_files} )
 
 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
     SET( SOURCES ${SOURCES}
index 711a03f4d84731db5711ed28fc4b36787efd63c6..86137d75574c9f1c3af6fd690b009b0bc2bb2523 100644 (file)
@@ -16,8 +16,10 @@ SET( SOURCES
         ${devel_api_src_files}
         ${adaptor_devel_api_text_abstraction_src_files}
         ${adaptor_graphics_common_src_files}
+        ${adaptor_graphics_common_dynamic_src_files}
         ${adaptor_haptics_common_src_files}
         ${adaptor_imaging_common_src_files}
+        ${adaptor_imaging_common_dynamic_src_files}
         ${adaptor_imaging_x11_src_files}
         ${adaptor_input_common_src_files}
         ${adaptor_input_generic_src_files}
@@ -40,30 +42,36 @@ SET( SOURCES
         ${adaptor_video_common_src_files}
         ${adaptor_web_engine_common_src_files}
         ${adaptor_window_system_common_src_files}
+        ${adaptor_window_system_common_dynamic_src_files}
         ${adaptor_window_system_x11_src_files}
+        ${adaptor_window_system_x11_dynamic_src_files}
         ${devel_api_text_abstraction_src_files}
         ${static_libraries_libunibreak_src_files}
 )
 
-IF( ENABLE_VULKAN )
-  SET(SOURCES ${SOURCES}
-    ${adaptor_graphics_vulkan_src_files}
-    ${adaptor_graphics_vulkan_x11_src_files}
-    ${adaptor_imaging_x11_vulkan_src_files}
-    ${adaptor_libraries_spirv_reflect_src_files}
-    ${adaptor_window_system_x11_vulkan_src_files}
-  )
-ELSE()
-  SET(SOURCES ${SOURCES}
-    ${adaptor_devel_api_egl_src_files}
-    ${adaptor_graphics_gles_src_files}
-    ${adaptor_graphics_glib_x11_src_files}
-    ${adaptor_graphics_x11_src_files}
-    ${adaptor_imaging_x11_egl_src_files}
-    ${adaptor_window_system_x11_egl_src_files}
-    ${adaptor_window_system_common_egl_src_files}
-  )
-ENDIF()
+# GLES Graphics Library
+SET(ADAPTOR_GRAPHICS_GLES_SOURCES
+        ${adaptor_graphics_gles_src_files}
+        ${adaptor_graphics_x11_src_files}
+        ${adaptor_imaging_x11_egl_src_files}
+        ${adaptor_window_system_x11_egl_src_files}
+        ${adaptor_graphics_library_common_src_files}
+        ${adaptor_window_system_x11_graphics_library_src_files}
+)
+
+# Vulkan Graphics Library
+SET(ADAPTOR_GRAPHICS_VULKAN_SOURCES
+        ${adaptor_graphics_vulkan_src_files}
+        ${adaptor_graphics_vulkan_x11_src_files}
+        ${adaptor_imaging_x11_vulkan_src_files}
+        ${adaptor_libraries_spirv_reflect_src_files}
+        ${adaptor_window_system_x11_vulkan_src_files}
+        ${adaptor_graphics_library_common_src_files}
+        ${adaptor_window_system_x11_graphics_library_src_files}
+)
+
+# GlWindow Addon
+SET( GL_WINDOW_ADDON_SOURCES ${adaptor_window_system_gl_window_src_files} )
 
 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
     SET( SOURCES ${SOURCES}
index cf8092a59191e6a238a6f3f8d13eaad9d2353f72..f39a538f7e484eff019e88e93f6ef4846b5c3523 100644 (file)
@@ -14,9 +14,11 @@ SET( SOURCES
     ${devel_api_src_files}
     ${adaptor_devel_api_text_abstraction_src_files}
     ${adaptor_graphics_common_src_files}
+    ${adaptor_graphics_common_dynamic_src_files}
     ${adaptor_haptics_common_src_files}
     ${adaptor_haptics_tizen_src_files}
     ${adaptor_imaging_common_src_files}
+    ${adaptor_imaging_common_dynamic_src_files}
     ${adaptor_imaging_tizen_src_files}
     ${adaptor_input_common_src_files}
     ${adaptor_input_tizen_wayland_src_files}
@@ -39,8 +41,10 @@ SET( SOURCES
     ${adaptor_camera_common_src_files}
     ${adaptor_web_engine_common_src_files}
     ${adaptor_window_system_common_src_files}
+    ${adaptor_window_system_common_dynamic_src_files}
     ${adaptor_window_system_tizen_src_files}
     ${adaptor_window_system_tizen_wayland_src_files}
+    ${adaptor_window_system_tizen_wayland_dynamic_src_files}
     ${adaptor_trace_common_src_files}
     ${adaptor_thread_common_src_files}
     ${adaptor_thread_linux_src_files}
@@ -50,24 +54,29 @@ SET( SOURCES
     ${static_libraries_libunibreak_src_files}
 )
 
-IF( ENABLE_VULKAN )
-  SET(SOURCES ${SOURCES}
+# GLES Graphics Library
+SET(ADAPTOR_GRAPHICS_GLES_SOURCES
+    ${adaptor_graphics_gles_src_files}
+    ${adaptor_graphics_tizen_src_files}
+    ${adaptor_imaging_tizen_egl_src_files}
+    ${adaptor_window_system_tizen_wayland_egl_src_files}
+    ${adaptor_graphics_library_common_src_files}
+    ${adaptor_window_system_tizen_wayland_graphics_library_src_files}
+)
+
+# Vulkan Graphics Library
+SET(ADAPTOR_GRAPHICS_VULKAN_SOURCES
     ${adaptor_graphics_vulkan_src_files}
     ${adaptor_graphics_vulkan_wayland_src_files}
     ${adaptor_imaging_tizen_vulkan_src_files}
     ${adaptor_libraries_spirv_reflect_src_files}
     ${adaptor_window_system_tizen_wayland_vulkan_src_files}
-  )
-ELSE()
-  SET(SOURCES ${SOURCES}
-    ${adaptor_graphics_gles_src_files}
-    ${adaptor_graphics_tizen_src_files}
-    ${adaptor_imaging_tizen_egl_src_files}
-    ${adaptor_devel_api_egl_src_files}
-    ${adaptor_window_system_common_egl_src_files}
-    ${adaptor_window_system_tizen_wayland_egl_src_files}
-  )
-ENDIF()
+    ${adaptor_graphics_library_common_src_files}
+    ${adaptor_window_system_tizen_wayland_graphics_library_src_files}
+)
+
+# GlWindow Addon
+SET( GL_WINDOW_ADDON_SOURCES ${adaptor_window_system_gl_window_src_files} )
 
 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
     SET( SOURCES ${SOURCES}
index 6631cd9af4f465ae950460e752505ea4cf45fd37..da17dd2e553c1914c6d8fec111cf0fe6a127f32f 100644 (file)
@@ -16,8 +16,10 @@ SET( SOURCES
         ${devel_api_src_files}
         ${adaptor_devel_api_text_abstraction_src_files}
         ${adaptor_graphics_common_src_files}
+        ${adaptor_graphics_common_dynamic_src_files}
         ${adaptor_haptics_common_src_files}
         ${adaptor_imaging_common_src_files}
+        ${adaptor_imaging_common_dynamic_src_files}
         ${adaptor_imaging_x11_src_files}
         ${adaptor_input_common_src_files}
         ${adaptor_input_generic_src_files}
@@ -40,30 +42,37 @@ SET( SOURCES
         ${adaptor_video_common_src_files}
         ${adaptor_web_engine_common_src_files}
         ${adaptor_window_system_common_src_files}
+        ${adaptor_window_system_common_dynamic_src_files}
         ${adaptor_window_system_x11_src_files}
+        ${adaptor_window_system_x11_dynamic_src_files}
         ${devel_api_text_abstraction_src_files}
         ${static_libraries_libunibreak_src_files}
 )
 
-IF( ENABLE_VULKAN )
-  SET(SOURCES ${SOURCES}
-    ${adaptor_graphics_vulkan_src_files}
-    ${adaptor_graphics_vulkan_x11_src_files}
-    ${adaptor_imaging_x11_vulkan_src_files}
-    ${adaptor_libraries_spirv_reflect_src_files}
-    ${adaptor_window_system_x11_vulkan_src_files}
-  )
-ELSE()
-  SET(SOURCES ${SOURCES}
-    ${adaptor_devel_api_egl_src_files}
-    ${adaptor_graphics_gles_src_files}
-    ${adaptor_graphics_ubuntu_src_files}
-    ${adaptor_graphics_x11_src_files}
-    ${adaptor_imaging_x11_egl_src_files}
-    ${adaptor_window_system_x11_egl_src_files}
-    ${adaptor_window_system_common_egl_src_files}
-  )
-ENDIF()
+# GLES Graphics Library
+SET(ADAPTOR_GRAPHICS_GLES_SOURCES
+        ${adaptor_graphics_gles_src_files}
+        ${adaptor_graphics_ubuntu_src_files}
+        ${adaptor_graphics_x11_src_files}
+        ${adaptor_imaging_x11_egl_src_files}
+        ${adaptor_window_system_x11_egl_src_files}
+        ${adaptor_graphics_library_common_src_files}
+        ${adaptor_window_system_x11_graphics_library_src_files}
+)
+
+# Vulkan Graphics Library
+SET(ADAPTOR_GRAPHICS_VULKAN_SOURCES
+        ${adaptor_graphics_vulkan_src_files}
+        ${adaptor_graphics_vulkan_x11_src_files}
+        ${adaptor_imaging_x11_vulkan_src_files}
+        ${adaptor_libraries_spirv_reflect_src_files}
+        ${adaptor_window_system_x11_vulkan_src_files}
+        ${adaptor_graphics_library_common_src_files}
+        ${adaptor_window_system_x11_graphics_library_src_files}
+)
+
+# GlWindow Addon
+SET( GL_WINDOW_ADDON_SOURCES ${adaptor_window_system_gl_window_src_files} )
 
 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
     SET( SOURCES ${SOURCES}
index 5783e01499c21de498e7e7a056e2aa4c030445ba..0c593cb8c0cab3a024032d1a5bec97bb5f91b10d 100644 (file)
@@ -49,8 +49,6 @@ SET( SOURCES
         ${adaptor_addons_common_src_files}
         ${adaptor_addons_macos_src_files}
         ${static_libraries_libunibreak_src_files}
-        ${adaptor_devel_api_egl_src_files}
-        ${adaptor_window_system_common_egl_src_files}
 )
 
 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
index cf7fe5e8830c7d6f4c36e757c451a2de4ac86a99..6b9cc1837ab9a86a5f49dcd79f7b0a5c60369e32 100644 (file)
@@ -14,8 +14,10 @@ SET( SOURCES
     ${devel_api_src_files}
     ${adaptor_devel_api_text_abstraction_src_files}
     ${adaptor_graphics_common_src_files}
+    ${adaptor_graphics_common_dynamic_src_files}
     ${adaptor_haptics_common_src_files}
     ${adaptor_imaging_common_src_files}
+    ${adaptor_imaging_common_dynamic_src_files}
     ${adaptor_imaging_tizen_src_files}
     ${adaptor_input_common_src_files}
     ${adaptor_input_tizen_wayland_src_files}
@@ -38,8 +40,10 @@ SET( SOURCES
     ${adaptor_camera_common_src_files}
     ${adaptor_web_engine_common_src_files}
     ${adaptor_window_system_common_src_files}
+    ${adaptor_window_system_common_dynamic_src_files}
     ${adaptor_window_system_tizen_src_files}
     ${adaptor_window_system_tizen_wayland_src_files}
+    ${adaptor_window_system_tizen_wayland_dynamic_src_files}
     ${adaptor_trace_common_src_files}
     ${adaptor_thread_common_src_files}
     ${adaptor_thread_linux_src_files}
@@ -49,24 +53,29 @@ SET( SOURCES
     ${static_libraries_libunibreak_src_files}
 )
 
-IF( ENABLE_VULKAN )
-  SET(SOURCES ${SOURCES}
+# GLES Graphics Library
+SET(ADAPTOR_GRAPHICS_GLES_SOURCES
+    ${adaptor_graphics_gles_src_files}
+    ${adaptor_graphics_tizen_src_files}
+    ${adaptor_imaging_tizen_egl_src_files}
+    ${adaptor_window_system_tizen_wayland_egl_src_files}
+    ${adaptor_graphics_library_common_src_files}
+    ${adaptor_window_system_tizen_wayland_graphics_library_src_files}
+)
+
+# Vulkan Graphics Library
+SET(ADAPTOR_GRAPHICS_VULKAN_SOURCES
     ${adaptor_graphics_vulkan_src_files}
     ${adaptor_graphics_vulkan_wayland_src_files}
     ${adaptor_imaging_tizen_vulkan_src_files}
     ${adaptor_libraries_spirv_reflect_src_files}
     ${adaptor_window_system_tizen_wayland_vulkan_src_files}
-  )
-ELSE()
-  SET(SOURCES ${SOURCES}
-    ${adaptor_graphics_gles_src_files}
-    ${adaptor_graphics_tizen_src_files}
-    ${adaptor_imaging_tizen_egl_src_files}
-    ${adaptor_devel_api_egl_src_files}
-    ${adaptor_window_system_common_egl_src_files}
-    ${adaptor_window_system_tizen_wayland_egl_src_files}
-  )
-ENDIF()
+    ${adaptor_graphics_library_common_src_files}
+    ${adaptor_window_system_tizen_wayland_graphics_library_src_files}
+)
+
+# GlWindow Addon
+SET( GL_WINDOW_ADDON_SOURCES ${adaptor_window_system_gl_window_src_files} )
 
 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
     SET( SOURCES ${SOURCES}
index 8997fccaee49f02aa372299e646b3bd5bade988f..7b3e4e80219ff5e5259b5b31fc3db19e14f162fe 100644 (file)
@@ -14,8 +14,10 @@ SET( SOURCES
     ${devel_api_src_files}
     ${adaptor_devel_api_text_abstraction_src_files}
     ${adaptor_graphics_common_src_files}
+    ${adaptor_graphics_common_dynamic_src_files}
     ${adaptor_haptics_common_src_files}
     ${adaptor_imaging_common_src_files}
+    ${adaptor_imaging_common_dynamic_src_files}
     ${adaptor_imaging_tizen_src_files}
     ${adaptor_input_common_src_files}
     ${adaptor_input_tizen_wayland_src_files}
@@ -38,8 +40,10 @@ SET( SOURCES
     ${adaptor_camera_common_src_files}
     ${adaptor_web_engine_common_src_files}
     ${adaptor_window_system_common_src_files}
+    ${adaptor_window_system_common_dynamic_src_files}
     ${adaptor_window_system_tizen_src_files}
     ${adaptor_window_system_tizen_wayland_src_files}
+    ${adaptor_window_system_tizen_wayland_dynamic_src_files}
     ${adaptor_trace_common_src_files}
     ${adaptor_thread_common_src_files}
     ${adaptor_thread_linux_src_files}
@@ -49,24 +53,29 @@ SET( SOURCES
     ${static_libraries_libunibreak_src_files}
 )
 
-IF( ENABLE_VULKAN )
-  SET(SOURCES ${SOURCES}
+# GLES Graphics Library
+SET(ADAPTOR_GRAPHICS_GLES_SOURCES
+    ${adaptor_graphics_gles_src_files}
+    ${adaptor_graphics_tizen_src_files}
+    ${adaptor_imaging_tizen_egl_src_files}
+    ${adaptor_window_system_tizen_wayland_egl_src_files}
+    ${adaptor_graphics_library_common_src_files}
+    ${adaptor_window_system_tizen_wayland_graphics_library_src_files}
+)
+
+# Vulkan Graphics Library
+SET(ADAPTOR_GRAPHICS_VULKAN_SOURCES
     ${adaptor_graphics_vulkan_src_files}
     ${adaptor_graphics_vulkan_wayland_src_files}
     ${adaptor_imaging_tizen_vulkan_src_files}
     ${adaptor_libraries_spirv_reflect_src_files}
     ${adaptor_window_system_tizen_wayland_vulkan_src_files}
-  )
-ELSE()
-  SET(SOURCES ${SOURCES}
-    ${adaptor_graphics_gles_src_files}
-    ${adaptor_graphics_tizen_src_files}
-    ${adaptor_imaging_tizen_egl_src_files}
-    ${adaptor_devel_api_egl_src_files}
-    ${adaptor_window_system_common_egl_src_files}
-    ${adaptor_window_system_tizen_wayland_egl_src_files}
-  )
-ENDIF()
+    ${adaptor_graphics_library_common_src_files}
+    ${adaptor_window_system_tizen_wayland_graphics_library_src_files}
+)
+
+# GlWindow Addon
+SET( GL_WINDOW_ADDON_SOURCES ${adaptor_window_system_gl_window_src_files} )
 
 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
     SET( SOURCES ${SOURCES}
index 504d777a1bbd67c88145474b8e7df0b26041bfb5..89d302372f9ff6dfd5700be408a9559bc45c8af9 100644 (file)
@@ -13,8 +13,10 @@ SET( SOURCES
         ${devel_api_src_files}
         ${adaptor_devel_api_text_abstraction_src_files}
         ${adaptor_graphics_common_src_files}
+        ${adaptor_graphics_common_dynamic_src_files}
         ${adaptor_haptics_common_src_files}
         ${adaptor_imaging_common_src_files}
+        ${adaptor_imaging_common_dynamic_src_files}
         ${adaptor_imaging_ubuntu_src_files}
         ${adaptor_input_common_src_files}
         ${adaptor_input_ubuntu_x11_src_files}
@@ -38,7 +40,9 @@ SET( SOURCES
         ${adaptor_camera_common_src_files}
         ${adaptor_web_engine_common_src_files}
         ${adaptor_window_system_common_src_files}
+        ${adaptor_window_system_common_dynamic_src_files}
         ${adaptor_window_system_ubuntu_x11_src_files}
+        ${adaptor_window_system_ubuntu_x11_dynamic_src_files}
         ${adaptor_trace_common_src_files}
         ${adaptor_thread_common_src_files}
         ${adaptor_thread_linux_src_files}
@@ -48,25 +52,29 @@ SET( SOURCES
         ${static_libraries_libunibreak_src_files}
 )
 
-IF( ENABLE_VULKAN )
-  SET(SOURCES ${SOURCES}
-    ${adaptor_graphics_vulkan_src_files}
-    ${adaptor_graphics_vulkan_x11_src_files}
-    ${adaptor_imaging_ubuntu_x11_vulkan_src_files}
-    ${adaptor_libraries_spirv_reflect_src_files}
-    ${adaptor_window_system_ubuntu_x11_vulkan_src_files}
-    )
-ELSE()
-  SET(SOURCES ${SOURCES}
-    ${adaptor_devel_api_egl_src_files}
-    ${adaptor_graphics_gles_src_files}
-    ${adaptor_graphics_ubuntu_src_files}
-    ${adaptor_imaging_ubuntu_x11_src_files}
-    ${adaptor_imaging_ubuntu_x11_egl_src_files}
-    ${adaptor_window_system_common_egl_src_files}
-    ${adaptor_window_system_ubuntu_x11_egl_src_files}
-    )
-ENDIF()
+# GLES Graphics Library
+SET(ADAPTOR_GRAPHICS_GLES_SOURCES
+        ${adaptor_graphics_gles_src_files}
+        ${adaptor_graphics_ubuntu_src_files}
+        ${adaptor_imaging_ubuntu_x11_egl_src_files}
+        ${adaptor_window_system_ubuntu_x11_egl_src_files}
+        ${adaptor_graphics_library_common_src_files}
+        ${adaptor_window_system_ubuntu_x11_graphics_library_src_files}
+)
+
+# Vulkan Graphics Library
+SET(ADAPTOR_GRAPHICS_VULKAN_SOURCES
+        ${adaptor_graphics_vulkan_src_files}
+        ${adaptor_graphics_vulkan_x11_src_files}
+        ${adaptor_imaging_ubuntu_x11_vulkan_src_files}
+        ${adaptor_libraries_spirv_reflect_src_files}
+        ${adaptor_window_system_ubuntu_x11_vulkan_src_files}
+        ${adaptor_graphics_library_common_src_files}
+        ${adaptor_window_system_ubuntu_x11_graphics_library_src_files}
+)
+
+# GlWindow Addon
+SET( GL_WINDOW_ADDON_SOURCES ${adaptor_window_system_gl_window_src_files} )
 
 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
     SET( SOURCES ${SOURCES}
index ef8248d1499aeee1d9fcf38c8e4379b17e0fac55..80be6fac4c23bb87d8d3e9d5d547ea63be4051b9 100644 (file)
@@ -15,8 +15,10 @@ SET( SOURCES
     ${devel_api_src_files}
     ${adaptor_devel_api_text_abstraction_src_files}
     ${adaptor_graphics_common_src_files}
+    ${adaptor_graphics_common_dynamic_src_files}
     ${adaptor_haptics_common_src_files}
     ${adaptor_imaging_common_src_files}
+    ${adaptor_imaging_common_dynamic_src_files}
     ${adaptor_imaging_tizen_src_files}
     ${adaptor_input_common_src_files}
     ${adaptor_input_tizen_wayland_src_files}
@@ -40,8 +42,10 @@ SET( SOURCES
     ${adaptor_camera_common_src_files}
     ${adaptor_web_engine_common_src_files}
     ${adaptor_window_system_common_src_files}
+    ${adaptor_window_system_common_dynamic_src_files}
     ${adaptor_window_system_tizen_src_files}
     ${adaptor_window_system_tizen_wayland_src_files}
+    ${adaptor_window_system_tizen_wayland_dynamic_src_files}
     ${adaptor_trace_common_src_files}
     ${adaptor_thread_common_src_files}
     ${adaptor_thread_linux_src_files}
@@ -51,24 +55,29 @@ SET( SOURCES
     ${static_libraries_libunibreak_src_files}
 )
 
-IF( ENABLE_VULKAN )
-  SET(SOURCES ${SOURCES}
+# GLES Graphics Library
+SET(ADAPTOR_GRAPHICS_GLES_SOURCES
+    ${adaptor_graphics_gles_src_files}
+    ${adaptor_graphics_tizen_src_files}
+    ${adaptor_imaging_tizen_egl_src_files}
+    ${adaptor_window_system_tizen_wayland_egl_src_files}
+    ${adaptor_graphics_library_common_src_files}
+    ${adaptor_window_system_tizen_wayland_graphics_library_src_files}
+)
+
+# Vulkan Graphics Library
+SET(ADAPTOR_GRAPHICS_VULKAN_SOURCES
     ${adaptor_graphics_vulkan_src_files}
     ${adaptor_graphics_vulkan_wayland_src_files}
     ${adaptor_imaging_tizen_vulkan_src_files}
     ${adaptor_libraries_spirv_reflect_src_files}
     ${adaptor_window_system_tizen_wayland_vulkan_src_files}
-  )
-ELSE()
-  SET(SOURCES ${SOURCES}
-    ${adaptor_graphics_gles_src_files}
-    ${adaptor_graphics_tizen_src_files}
-    ${adaptor_imaging_tizen_egl_src_files}
-    ${adaptor_devel_api_egl_src_files}
-    ${adaptor_window_system_common_egl_src_files}
-    ${adaptor_window_system_tizen_wayland_egl_src_files}
-  )
-ENDIF()
+    ${adaptor_graphics_library_common_src_files}
+    ${adaptor_window_system_tizen_wayland_graphics_library_src_files}
+)
+
+# GlWindow Addon
+SET( GL_WINDOW_ADDON_SOURCES ${adaptor_window_system_gl_window_src_files} )
 
 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
     SET( SOURCES ${SOURCES}
index 70b7d95ab1c71b215496c013f28b69867ba8160f..002788b2e049995c16ef359a43734e56561c3d04 100644 (file)
@@ -48,13 +48,6 @@ SET( SOURCES
         ${adaptor_addons_dummy_src_files}
 )
 
-IF(NOT ENABLE_VULKAN)
-  SET(SOURCES ${SOURCES}
-    ${adaptor_devel_api_egl_src_files}
-    ${adaptor_window_system_common_egl_src_files}
-  )
-ENDIF()
-
 IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
     SET( SOURCES ${SOURCES}
          ${static_libraries_glyphy_src_files}
index daedd6fdf2c44cec5d860776d6e23401310197e7..07c78d79082ad1c838baf27f7e11ae167abf7bb1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
 #include <dali/public-api/adaptor-framework/window.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/window-system/common/gl-window-impl.h>
-#include <dali/internal/window-system/common/orientation-impl.h>
+#include <dali/devel-api/common/addon-binder.h>
+#include <dali/internal/window-system/gl-window/gl-window-impl.h>
+#include <dali/public-api/adaptor-framework/graphics-backend.h>
 
 namespace Dali
 {
+using GlWindowImpl = Internal::Adaptor::GlWindow;
+
+namespace
+{
+const char* const DALI_ADAPTOR_GL_WINDOW_ADDON_SO("libdali2-adaptor-gl-window-addon.so");
+const char* const DALI_ADAPTOR_GL_WINDOW_ADDON_NAME("AdaptorGlWindowAddOn");
+
+struct AdaptorGlWindowAddOn : public Dali::AddOn::AddOnBinder
+{
+  AdaptorGlWindowAddOn()
+  : Dali::AddOn::AddOnBinder(DALI_ADAPTOR_GL_WINDOW_ADDON_NAME, DALI_ADAPTOR_GL_WINDOW_ADDON_SO)
+  {
+  }
+
+  ~AdaptorGlWindowAddOn() = default;
+
+  ADDON_BIND_FUNCTION(GlWindowNew, GlWindow(PositionSize, const std::string&, const std::string&, bool));
+  ADDON_BIND_FUNCTION(GlWindowSetGraphicsConfig, void(GlWindowImpl&, bool, bool, int, GlWindow::GlesVersion));
+  ADDON_BIND_FUNCTION(GlWindowRaise, void(GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowLower, void(GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowActivate, void(GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowShow, void(GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowHide, void(GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowGetSupportedAuxiliaryHintCount, unsigned int(const GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowGetSupportedAuxiliaryHint, std::string(const GlWindowImpl&, unsigned int));
+  ADDON_BIND_FUNCTION(GlWindowAddAuxiliaryHint, unsigned int(GlWindowImpl&, const std::string&, const std::string&));
+  ADDON_BIND_FUNCTION(GlWindowRemoveAuxiliaryHint, bool(GlWindowImpl&, unsigned int));
+  ADDON_BIND_FUNCTION(GlWindowSetAuxiliaryHintValue, bool(GlWindowImpl&, unsigned int, const std::string&));
+  ADDON_BIND_FUNCTION(GlWindowGetAuxiliaryHintValue, std::string(const GlWindowImpl&, unsigned int));
+  ADDON_BIND_FUNCTION(GlWindowGetAuxiliaryHintId, unsigned int(const GlWindowImpl&, const std::string&));
+  ADDON_BIND_FUNCTION(GlWindowSetInputRegion, void(GlWindowImpl&, const Rect<int>&));
+  ADDON_BIND_FUNCTION(GlWindowSetOpaqueState, void(GlWindowImpl&, bool));
+  ADDON_BIND_FUNCTION(GlWindowIsOpaqueState, bool(const GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowSetPositionSize, void(GlWindowImpl&, PositionSize));
+  ADDON_BIND_FUNCTION(GlWindowGetPositionSize, PositionSize(const GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowGetCurrentOrientation, WindowOrientation(const GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowSetAvailableOrientations, void(GlWindowImpl&, const Dali::Vector<WindowOrientation>&));
+  ADDON_BIND_FUNCTION(GlWindowSetPreferredOrientation, void(GlWindowImpl&, WindowOrientation));
+  ADDON_BIND_FUNCTION(GlWindowRegisterGlCallbacks, void(GlWindowImpl&, CallbackBase*, CallbackBase*, CallbackBase*));
+  ADDON_BIND_FUNCTION(GlWindowRenderOnce, void(GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowSetRenderingMode, void(GlWindowImpl&, GlWindow::RenderingMode));
+  ADDON_BIND_FUNCTION(GlWindowGetRenderingMode, GlWindow::RenderingMode(const GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowFocusChangeSignal, GlWindow::FocusChangeSignalType&(GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowResizeSignal, GlWindow::ResizeSignalType&(GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowKeyEventSignal, GlWindow::KeyEventSignalType&(GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowTouchedSignal, GlWindow::TouchEventSignalType&(GlWindowImpl&));
+  ADDON_BIND_FUNCTION(GlWindowVisibilityChangedSignal, GlWindow::VisibilityChangedSignalType&(GlWindowImpl&));
+};
+
+std::unique_ptr<AdaptorGlWindowAddOn> gAdaptorGlWindowAddOn;
+} // unnamed namespace
+
 GlWindow GlWindow::New()
 {
   PositionSize positionSize(0, 0, 0, 0);
@@ -36,30 +89,21 @@ GlWindow GlWindow::New()
 
 GlWindow GlWindow::New(PositionSize positionSize, const std::string& name, const std::string& className, bool isTransparent)
 {
-  GlWindow                     newWindow;
-  Internal::Adaptor::GlWindow* window = Internal::Adaptor::GlWindow::New(positionSize, name, className, isTransparent);
-  newWindow                           = GlWindow(window);
-
-  const bool isAdaptorAvailable = Dali::Adaptor::IsAvailable();
-  if(isAdaptorAvailable)
+  if(Graphics::GetCurrentGraphicsBackend() == Graphics::Backend::GLES)
   {
-    Dali::Adaptor&        adaptor = Internal::Adaptor::Adaptor::Get();
-    Dali::WindowContainer windows = adaptor.GetWindows();
-    if(!windows.empty())
+    if(!gAdaptorGlWindowAddOn)
     {
-      window->SetChild(windows[0]);
+      gAdaptorGlWindowAddOn.reset(new AdaptorGlWindowAddOn);
     }
+    DALI_ASSERT_ALWAYS(gAdaptorGlWindowAddOn && "Cannot load the GlWindow Addon\n");
+    return gAdaptorGlWindowAddOn->GlWindowNew(positionSize, name, className, isTransparent);
   }
-  return newWindow;
+  DALI_ABORT("Current Graphics Backend does not support GlWindow\n");
 }
 
-GlWindow::GlWindow()
-{
-}
+GlWindow::GlWindow() = default;
 
-GlWindow::~GlWindow()
-{
-}
+GlWindow::~GlWindow() = default;
 
 GlWindow::GlWindow(const GlWindow& handle) = default;
 
@@ -71,152 +115,244 @@ GlWindow& GlWindow::operator=(GlWindow&& rhs) = default;
 
 void GlWindow::SetGraphicsConfig(bool depth, bool stencil, int msaa, GlesVersion version)
 {
-  GetImplementation(*this).SetGraphicsConfig(depth, stencil, msaa, version);
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowSetGraphicsConfig(impl, depth, stencil, msaa, version);
+  }
 }
 
 void GlWindow::Raise()
 {
-  GetImplementation(*this).Raise();
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowRaise(impl);
+  }
 }
 
 void GlWindow::Lower()
 {
-  GetImplementation(*this).Lower();
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowLower(impl);
+  }
 }
 
 void GlWindow::Activate()
 {
-  GetImplementation(*this).Activate();
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowActivate(impl);
+  }
 }
 
 void GlWindow::Show()
 {
-  GetImplementation(*this).Show();
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowShow(impl);
+  }
 }
 
 void GlWindow::Hide()
 {
-  GetImplementation(*this).Hide();
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowHide(impl);
+  }
 }
 
 unsigned int GlWindow::GetSupportedAuxiliaryHintCount() const
 {
-  return GetImplementation(*this).GetSupportedAuxiliaryHintCount();
+  const GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  return gAdaptorGlWindowAddOn ? gAdaptorGlWindowAddOn->GlWindowGetSupportedAuxiliaryHintCount(impl) : 0u;
 }
 
 std::string GlWindow::GetSupportedAuxiliaryHint(unsigned int index) const
 {
-  return GetImplementation(*this).GetSupportedAuxiliaryHint(index);
+  const GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  return gAdaptorGlWindowAddOn ? gAdaptorGlWindowAddOn->GlWindowGetSupportedAuxiliaryHint(impl, index) : "";
 }
 
 unsigned int GlWindow::AddAuxiliaryHint(const std::string& hint, const std::string& value)
 {
-  return GetImplementation(*this).AddAuxiliaryHint(hint, value);
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  return gAdaptorGlWindowAddOn ? gAdaptorGlWindowAddOn->GlWindowAddAuxiliaryHint(impl, hint, value) : 0u;
 }
 
 bool GlWindow::RemoveAuxiliaryHint(unsigned int id)
 {
-  return GetImplementation(*this).RemoveAuxiliaryHint(id);
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  return gAdaptorGlWindowAddOn ? gAdaptorGlWindowAddOn->GlWindowRemoveAuxiliaryHint(impl, id) : false;
 }
 
 bool GlWindow::SetAuxiliaryHintValue(unsigned int id, const std::string& value)
 {
-  return GetImplementation(*this).SetAuxiliaryHintValue(id, value);
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  return gAdaptorGlWindowAddOn ? gAdaptorGlWindowAddOn->GlWindowSetAuxiliaryHintValue(impl, id, value) : false;
 }
 
 std::string GlWindow::GetAuxiliaryHintValue(unsigned int id) const
 {
-  return GetImplementation(*this).GetAuxiliaryHintValue(id);
+  const GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  return gAdaptorGlWindowAddOn ? gAdaptorGlWindowAddOn->GlWindowGetAuxiliaryHintValue(impl, id) : "";
 }
 
 unsigned int GlWindow::GetAuxiliaryHintId(const std::string& hint) const
 {
-  return GetImplementation(*this).GetAuxiliaryHintId(hint);
+  const GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  return gAdaptorGlWindowAddOn ? gAdaptorGlWindowAddOn->GlWindowGetAuxiliaryHintId(impl, hint) : 0u;
 }
 
 void GlWindow::SetInputRegion(const Rect<int>& inputRegion)
 {
-  GetImplementation(*this).SetInputRegion(inputRegion);
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowSetInputRegion(impl, inputRegion);
+  }
 }
 
 void GlWindow::SetOpaqueState(bool opaque)
 {
-  GetImplementation(*this).SetOpaqueState(opaque);
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowSetOpaqueState(impl, opaque);
+  }
 }
 
 bool GlWindow::IsOpaqueState() const
 {
-  return GetImplementation(*this).IsOpaqueState();
+  const GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  return gAdaptorGlWindowAddOn ? gAdaptorGlWindowAddOn->GlWindowIsOpaqueState(impl) : false;
 }
 
 void GlWindow::SetPositionSize(PositionSize positionSize)
 {
-  GetImplementation(*this).SetPositionSize(positionSize);
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowSetPositionSize(impl, positionSize);
+  }
 }
 
 PositionSize GlWindow::GetPositionSize() const
 {
-  return GetImplementation(*this).GetPositionSize();
+  const GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  return gAdaptorGlWindowAddOn ? gAdaptorGlWindowAddOn->GlWindowGetPositionSize(impl) : PositionSize{};
 }
 
 WindowOrientation GlWindow::GetCurrentOrientation() const
 {
-  return GetImplementation(*this).GetCurrentOrientation();
+  const GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  return gAdaptorGlWindowAddOn ? gAdaptorGlWindowAddOn->GlWindowGetCurrentOrientation(impl) : WindowOrientation::PORTRAIT;
 }
 
 void GlWindow::SetAvailableOrientations(const Dali::Vector<WindowOrientation>& orientations)
 {
-  GetImplementation(*this).SetAvailableOrientations(orientations);
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowSetAvailableOrientations(impl, orientations);
+  }
 }
 
 void GlWindow::SetPreferredOrientation(WindowOrientation orientation)
 {
-  GetImplementation(*this).SetPreferredOrientation(orientation);
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowSetPreferredOrientation(impl, orientation);
+  }
 }
 
 void GlWindow::RegisterGlCallbacks(CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback)
 {
-  GetImplementation(*this).RegisterGlCallbacks(initCallback, renderFrameCallback, terminateCallback);
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowRegisterGlCallbacks(impl, initCallback, renderFrameCallback, terminateCallback);
+  }
 }
 
 void GlWindow::RenderOnce()
 {
-  GetImplementation(*this).RenderOnce();
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowRenderOnce(impl);
+  }
 }
 
 void GlWindow::SetRenderingMode(RenderingMode mode)
 {
-  GetImplementation(*this).SetRenderingMode(mode);
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    gAdaptorGlWindowAddOn->GlWindowSetRenderingMode(impl, mode);
+  }
 }
 
 GlWindow::RenderingMode GlWindow::GetRenderingMode() const
 {
-  return GetImplementation(*this).GetRenderingMode();
+  const GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  return gAdaptorGlWindowAddOn ? gAdaptorGlWindowAddOn->GlWindowGetRenderingMode(impl) : RenderingMode::CONTINUOUS;
 }
 
 GlWindow::FocusChangeSignalType& GlWindow::FocusChangeSignal()
 {
-  return GetImplementation(*this).FocusChangeSignal();
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    return gAdaptorGlWindowAddOn->GlWindowFocusChangeSignal(impl);
+  }
+  DALI_ABORT("Current Graphics Backend does not support GlWindow\n");
 }
 
 GlWindow::ResizeSignalType& GlWindow::ResizeSignal()
 {
-  return GetImplementation(*this).ResizeSignal();
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    return gAdaptorGlWindowAddOn->GlWindowResizeSignal(impl);
+  }
+  DALI_ABORT("Current Graphics Backend does not support GlWindow\n");
 }
 
 GlWindow::KeyEventSignalType& GlWindow::KeyEventSignal()
 {
-  return GetImplementation(*this).KeyEventSignal();
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    return gAdaptorGlWindowAddOn->GlWindowKeyEventSignal(impl);
+  }
+  DALI_ABORT("Current Graphics Backend does not support GlWindow\n");
 }
 
 GlWindow::TouchEventSignalType& GlWindow::TouchedSignal()
 {
-  return GetImplementation(*this).TouchedSignal();
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    return gAdaptorGlWindowAddOn->GlWindowTouchedSignal(impl);
+  }
+  DALI_ABORT("Current Graphics Backend does not support GlWindow\n");
 }
 
 GlWindow::VisibilityChangedSignalType& GlWindow::VisibilityChangedSignal()
 {
-  return GetImplementation(*this).VisibilityChangedSignal();
+  GlWindowImpl& impl = GetImplementation(*this); // Get Implementation here to catch uninitialized usage
+  if(gAdaptorGlWindowAddOn)
+  {
+    return gAdaptorGlWindowAddOn->GlWindowVisibilityChangedSignal(impl);
+  }
+  DALI_ABORT("Current Graphics Backend does not support GlWindow\n");
 }
 
 GlWindow::GlWindow(Internal::Adaptor::GlWindow* window)
index 0f026fc1668879e7ff9f968c64a8532745e5115c..f132b125015b0f5be44cc3bf7654b7510fc0a986 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GL_WINDOW_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -471,7 +471,7 @@ public: // Not intended for application developers
    * @brief This constructor is used by Dali::Application::GetGlWindow().
    * @param[in] GlWindow A pointer to the GlWindow
    */
-  explicit DALI_INTERNAL GlWindow(Internal::Adaptor::GlWindow* GlWindow);
+  explicit GlWindow(Internal::Adaptor::GlWindow* GlWindow);
   /// @endcond
 };
 
index 076aea2e5d1d7feaba9ad0165b75a4e96e870948..63f0be2792aac44014cf561b271139dff2ab57f9 100755 (executable)
@@ -26,6 +26,7 @@ SET( devel_api_src_files
   ${adaptor_devel_api_dir}/adaptor-framework/feedback-player.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/file-loader.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/file-stream.cpp
+  ${adaptor_devel_api_dir}/adaptor-framework/gl-window.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/graphics-capabilities.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/image-loading.cpp
   ${adaptor_devel_api_dir}/adaptor-framework/input-method-context.cpp
@@ -55,10 +56,6 @@ SET( devel_api_src_files
   ${adaptor_devel_api_dir}/adaptor-framework/window-blur-info.cpp
 )
 
-SET( adaptor_devel_api_egl_src_files
-  ${adaptor_devel_api_dir}/adaptor-framework/gl-window.cpp
-)
-
 SET( devel_api_adaptor_framework_header_files
   ${adaptor_devel_api_dir}/adaptor-framework/accessibility.h
   ${adaptor_devel_api_dir}/adaptor-framework/accessibility-bitset.h
index 7432f104e13b7dafc32831d8bcddf6c6f54e06ca..64d8fad0227bc8f005e4b2d5bc2dc4eea7826063 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
 #include <dali/internal/adaptor/common/adaptor-builder-impl.h>
 
 // INTERNAL INCLUDES
-#include <dali/internal/window-system/common/display-utils.h>
-#include <dali/public-api/adaptor-framework/graphics-backend.h>
-
-#if defined(VULKAN_ENABLED)
-#include <dali/internal/graphics/vulkan/vulkan-graphics-factory.h>
-#else
-#include <dali/internal/graphics/gles/egl-graphics-factory.h>
-#endif
+#include <dali/internal/graphics/common/graphics-factory.h>
 
 namespace Dali::Internal::Adaptor
 {
@@ -52,25 +45,8 @@ void AdaptorBuilder::Finalize()
 AdaptorBuilder::AdaptorBuilder(EnvironmentOptions& environmentOptions)
 : mEnvironmentOptions(environmentOptions)
 {
-  switch(Graphics::GetCurrentGraphicsBackend())
-  {
-    case Graphics::Backend::GLES:
-    {
-      DALI_LOG_RELEASE_INFO("DALi Graphics Backend: GLES\n");
-      // TODO: Load GLES library
-      break;
-    }
-
-    case Graphics::Backend::VULKAN:
-    {
-      DALI_LOG_RELEASE_INFO("DALi Graphics Backend: VULKAN\n");
-      // TODO: Attempt to load Vulkan library
-      break;
-    }
-  }
-
   // Construct Graphics Factory
-  mGraphicsFactory = Utils::MakeUnique<GraphicsFactory>(environmentOptions);
+  mGraphicsFactory = CreateGraphicsFactory(environmentOptions);
 }
 
 GraphicsFactoryInterface& AdaptorBuilder::GetGraphicsFactory() const
index 2ee9c6fad453137d6a0668680a3c57eec65daef8..6de15f079881b46f7c1cc3c4a123c5547c1fb5e3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_IMPL_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -152,8 +152,10 @@ public:
 
   /**
    * @copydoc Dali::Adaptor::Get()
+   *
+   * Needs exporting as it's used by the GlWindow library
    */
-  static Dali::Adaptor& Get();
+  static DALI_ADAPTOR_API Dali::Adaptor& Get();
 
   /**
    * @copydoc Dali::Adaptor::IsAvailable()
diff --git a/dali/internal/graphics/common/graphics-factory-dynamic.cpp b/dali/internal/graphics/common/graphics-factory-dynamic.cpp
new file mode 100644 (file)
index 0000000..99f38bd
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-factory.h>
+#include <dali/internal/graphics/common/graphics-library.h>
+
+namespace Dali::Internal::Adaptor
+{
+__attribute__((weak)) std::unique_ptr<GraphicsFactoryInterface> CreateGraphicsFactory(EnvironmentOptions& environmentOptions)
+{
+  return GraphicsLibrary::CreateGraphicsFactory(environmentOptions);
+}
+} // namespace Dali::Internal::Adaptor
diff --git a/dali/internal/graphics/common/graphics-factory.h b/dali/internal/graphics/common/graphics-factory.h
new file mode 100644 (file)
index 0000000..c83229d
--- /dev/null
@@ -0,0 +1,27 @@
+#pragma once
+
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-factory-interface.h>
+#include <dali/internal/system/common/environment-options.h>
+
+namespace Dali::Internal::Adaptor
+{
+extern std::unique_ptr<GraphicsFactoryInterface> CreateGraphicsFactory(EnvironmentOptions& environmentOptions);
+} // namespace Dali::Internal::Adaptor
diff --git a/dali/internal/graphics/common/graphics-library-functions.cpp b/dali/internal/graphics/common/graphics-library-functions.cpp
new file mode 100644 (file)
index 0000000..26962e3
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-factory.h>
+#include <dali/internal/graphics/common/surface-factory.h>
+#include <dali/internal/imaging/common/native-image-source-factory.h>
+#include <dali/internal/window-system/common/native-image-surface-factory.h>
+#include <dali/internal/window-system/common/native-image-surface-impl.h>
+#include <dali/internal/window-system/common/render-surface-factory.h>
+#include <dali/public-api/dali-adaptor-common.h>
+
+extern "C"
+{
+  using namespace Dali::Internal::Adaptor;
+
+  DALI_ADAPTOR_API std::unique_ptr<GraphicsFactoryInterface> CreateGraphicsFactory(EnvironmentOptions& environmentOptions)
+  {
+    return Dali::Internal::Adaptor::CreateGraphicsFactory(environmentOptions);
+  }
+
+  DALI_ADAPTOR_API std::unique_ptr<RenderSurfaceFactory> GetRenderSurfaceFactory()
+  {
+    return Dali::Internal::Adaptor::GetRenderSurfaceFactory();
+  }
+
+  DALI_ADAPTOR_API std::unique_ptr<NativeImageSourceFactory> GetNativeImageSourceFactory()
+  {
+    return Dali::Internal::Adaptor::GetNativeImageSourceFactory();
+  }
+
+  DALI_ADAPTOR_API std::unique_ptr<NativeImageSurface> CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr queue)
+  {
+    return Dali::Internal::Adaptor::NativeImageSurfaceFactory::CreateNativeImageSurface(queue);
+  }
+
+  DALI_ADAPTOR_API std::unique_ptr<Dali::Graphics::SurfaceFactory> CreateSurfaceFactory(Dali::Graphics::NativeWindowInterface& nativeWindow)
+  {
+    return Dali::Graphics::SurfaceFactory::New(nativeWindow);
+  }
+} // extern "C"
\ No newline at end of file
diff --git a/dali/internal/graphics/common/graphics-library.cpp b/dali/internal/graphics/common/graphics-library.cpp
new file mode 100644 (file)
index 0000000..761b40b
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// HEADER
+#include <dali/internal/graphics/common/graphics-library.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+#include <dlfcn.h>
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/common/native-image-surface-impl.h>
+#include <dali/public-api/adaptor-framework/graphics-backend.h>
+
+namespace Dali::Internal::Adaptor::GraphicsLibrary
+{
+namespace
+{
+const char* const DALI_ADAPTOR_GRAPHICS_GLES_SO("libdali2-adaptor-gles.so");
+const char* const DALI_ADAPTOR_GRAPHICS_VULKAN_SO("libdali2-adaptor-vulkan.so");
+
+struct GraphicsLibrary
+{
+public:
+  GraphicsLibrary()
+  {
+    mHandle = dlopen((Graphics::GetCurrentGraphicsBackend() == Graphics::Backend::GLES) ? DALI_ADAPTOR_GRAPHICS_GLES_SO : DALI_ADAPTOR_GRAPHICS_VULKAN_SO,
+                     RTLD_NOW | RTLD_GLOBAL | RTLD_DEEPBIND);
+    if(!mHandle)
+    {
+      // The shared library failed to load
+      DALI_LOG_ERROR("dlopen error: %s\n", dlerror());
+      DALI_ABORT("Unable to open Graphics Library\n");
+    }
+  }
+
+  ~GraphicsLibrary()
+  {
+    if(mHandle)
+    {
+      dlclose(mHandle);
+    }
+  }
+
+public:
+  void* mHandle{nullptr};
+};
+std::unique_ptr<GraphicsLibrary> gGraphicsLibraryHandle;
+
+template<typename FunctionSignature>
+FunctionSignature GetFunction(const char* const functionName)
+{
+  if(!gGraphicsLibraryHandle)
+  {
+    gGraphicsLibraryHandle.reset(new GraphicsLibrary);
+  }
+
+  if(gGraphicsLibraryHandle)
+  {
+    FunctionSignature func = reinterpret_cast<FunctionSignature>(dlsym(gGraphicsLibraryHandle->mHandle,
+                                                                       functionName));
+    if(!func)
+    {
+      DALI_LOG_ERROR("Cannot find %s function: %s\n", functionName, dlerror());
+      DALI_ABORT("Unable to find required function in dynamically loaded library\n");
+    }
+    return func;
+  }
+  return nullptr;
+}
+
+template<typename FunctionSignature, typename... Args>
+void CallVoidFunction(const char* const functionName, Args... args)
+{
+  static FunctionSignature func = GetFunction<FunctionSignature>(functionName);
+  if(func)
+  {
+    func(args...);
+  }
+}
+
+template<typename FunctionSignature, typename ReturnValue, typename... Args>
+ReturnValue CallReturnValueFunction(const char* const functionName, Args... args)
+{
+  static FunctionSignature func = GetFunction<FunctionSignature>(functionName);
+  if(func)
+  {
+    return func(args...);
+  }
+  return {};
+}
+} // unnamed namespace
+
+std::unique_ptr<GraphicsFactoryInterface> CreateGraphicsFactory(EnvironmentOptions& environmentOptions)
+{
+  return CallReturnValueFunction<std::unique_ptr<GraphicsFactoryInterface> (*)(EnvironmentOptions&), std::unique_ptr<GraphicsFactoryInterface>, EnvironmentOptions&>("CreateGraphicsFactory", environmentOptions);
+}
+
+std::unique_ptr<RenderSurfaceFactory> GetRenderSurfaceFactory()
+{
+  return CallReturnValueFunction<std::unique_ptr<RenderSurfaceFactory> (*)(), std::unique_ptr<RenderSurfaceFactory>>("GetRenderSurfaceFactory");
+}
+
+std::unique_ptr<NativeImageSourceFactory> GetNativeImageSourceFactory()
+{
+  return CallReturnValueFunction<std::unique_ptr<NativeImageSourceFactory> (*)(), std::unique_ptr<NativeImageSourceFactory>>("GetNativeImageSourceFactory");
+}
+
+std::unique_ptr<Graphics::SurfaceFactory> CreateSurfaceFactory(Graphics::NativeWindowInterface& nativeWindow)
+{
+  return CallReturnValueFunction<std::unique_ptr<Graphics::SurfaceFactory> (*)(Graphics::NativeWindowInterface&), std::unique_ptr<Graphics::SurfaceFactory>, Graphics::NativeWindowInterface&>("CreateSurfaceFactory", nativeWindow);
+}
+
+std::unique_ptr<NativeImageSurface> CreateNativeImageSurface(NativeImageSourceQueuePtr queue)
+{
+  return CallReturnValueFunction<std::unique_ptr<NativeImageSurface> (*)(NativeImageSourceQueuePtr), std::unique_ptr<NativeImageSurface>, NativeImageSourceQueuePtr>("CreateNativeImageSurface", queue);
+}
+
+Any CastToNativeGraphicsType(void* display)
+{
+  return CallReturnValueFunction<Any (*)(void*), Any, void*>("CastToNativeGraphicsType", display);
+}
+
+} // namespace Dali::Internal::Adaptor::GraphicsLibrary
diff --git a/dali/internal/graphics/common/graphics-library.h b/dali/internal/graphics/common/graphics-library.h
new file mode 100644 (file)
index 0000000..766d30d
--- /dev/null
@@ -0,0 +1,46 @@
+#pragma once
+
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/object/any.h>
+#include <memory>
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-factory-interface.h>
+#include <dali/internal/graphics/common/surface-factory.h>
+#include <dali/internal/imaging/common/native-image-source-factory.h>
+#include <dali/internal/system/common/environment-options.h>
+#include <dali/internal/window-system/common/native-image-surface-factory.h>
+#include <dali/internal/window-system/common/render-surface-factory.h>
+
+namespace Dali::Internal::Adaptor::GraphicsLibrary
+{
+std::unique_ptr<GraphicsFactoryInterface> CreateGraphicsFactory(EnvironmentOptions& environmentOptions);
+
+std::unique_ptr<RenderSurfaceFactory> GetRenderSurfaceFactory();
+
+std::unique_ptr<NativeImageSourceFactory> GetNativeImageSourceFactory();
+
+std::unique_ptr<Graphics::SurfaceFactory> CreateSurfaceFactory(Graphics::NativeWindowInterface& nativeWindow);
+
+std::unique_ptr<NativeImageSurface> CreateNativeImageSurface(NativeImageSourceQueuePtr queue);
+
+Any CastToNativeGraphicsType(void*);
+
+} // namespace Dali::Internal::Adaptor::GraphicsLibrary
diff --git a/dali/internal/graphics/common/surface-factory-dynamic.cpp b/dali/internal/graphics/common/surface-factory-dynamic.cpp
new file mode 100644 (file)
index 0000000..9485e4e
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-library.h>
+#include <dali/internal/graphics/common/surface-factory.h>
+
+namespace Dali::Graphics
+{
+__attribute__((weak)) std::unique_ptr<SurfaceFactory> SurfaceFactory::New(NativeWindowInterface& nativeWindow)
+{
+  return Internal::Adaptor::GraphicsLibrary::CreateSurfaceFactory(nativeWindow);
+}
+
+} // namespace Dali::Graphics
index f7191d66d8d8f0d50225fec1b36482ace0f4e22c..77b786ba3473ee6ae5a100d4244d5604389b02fc 100644 (file)
@@ -1,4 +1,16 @@
 
+# module: graphics, backend: gles
+SET( adaptor_graphics_common_dynamic_src_files
+    ${adaptor_graphics_dir}/common/graphics-factory-dynamic.cpp
+    ${adaptor_graphics_dir}/common/graphics-library.cpp
+    ${adaptor_graphics_dir}/common/surface-factory-dynamic.cpp
+)
+
+# module: graphics, library
+SET( adaptor_graphics_library_common_src_files
+    ${adaptor_graphics_dir}/common/graphics-library-functions.cpp
+)
+
 # module: graphics, backend: gles
 SET( adaptor_graphics_gles_src_files
     ${adaptor_graphics_dir}/gles/egl-debug.cpp
index 6e9536cf95c2ffbeac3f2f7477504c2611ccaef0..a5832a9a7aebd4a87543654c43f519b2aff9cd08 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
 #include <dali/internal/graphics/gles/egl-graphics-factory.h>
 #include <dali/internal/graphics/gles/egl-graphics.h>
 
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
 // INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-factory.h>
+#include <dali/internal/window-system/common/display-utils.h>
 
 namespace Dali
 {
@@ -27,17 +32,17 @@ namespace Internal
 {
 namespace Adaptor
 {
-GraphicsFactory::GraphicsFactory(EnvironmentOptions& environmentOptions)
+EglGraphicsFactory::EglGraphicsFactory(EnvironmentOptions& environmentOptions)
 : mEnvironmentOptions(environmentOptions)
 {
 }
 
-GraphicsFactory::~GraphicsFactory()
+EglGraphicsFactory::~EglGraphicsFactory()
 {
   /* Deleted by Adaptor destructor */
 }
 
-Graphics::GraphicsInterface& GraphicsFactory::Create()
+Graphics::GraphicsInterface& EglGraphicsFactory::Create()
 {
   Graphics::GraphicsCreateInfo info{};
 
@@ -51,11 +56,17 @@ Graphics::GraphicsInterface& GraphicsFactory::Create()
   return *eglGraphicsInterface;
 }
 
-void GraphicsFactory::Destroy()
+void EglGraphicsFactory::Destroy()
 {
   /* Deleted by EglGraphics */
 }
 
+std::unique_ptr<GraphicsFactoryInterface> CreateGraphicsFactory(EnvironmentOptions& environmentOptions)
+{
+  DALI_LOG_RELEASE_INFO("DALi Graphics Backend: GLES\n");
+  return Utils::MakeUnique<EglGraphicsFactory>(environmentOptions);
+}
+
 } // namespace Adaptor
 } // namespace Internal
 } // namespace Dali
index f1622f1a67b0f60a843fa9c81f125d89dc9b2229..17dbb9b27ba9285c8c35e535421ae35adbb7c09b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EGL_GRAPHICS_FACTORY_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
 
 namespace Dali::Internal::Adaptor
 {
-class GraphicsFactory : public GraphicsFactoryInterface
+// Needs exporting as it's called directly by the GlWindow library
+class DALI_ADAPTOR_API EglGraphicsFactory : public GraphicsFactoryInterface
 {
 public:
   /**
    * Constructor
    */
-  explicit GraphicsFactory(EnvironmentOptions& environmentOptions);
+  explicit EglGraphicsFactory(EnvironmentOptions& environmentOptions);
 
   /**
    * Destructor
    */
-  ~GraphicsFactory() override;
+  ~EglGraphicsFactory() override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::GraphicsFactoryInterface::Create()
index b66595acb3132b32a010d3ff83bd3981ad6566a9..c730875db020efa3f0d01507fd85cd3329132dab 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_BASE_GRAPHICS_IMPLEMENTATION_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -38,7 +38,8 @@ class EnvironmentOptions;
 class ConfigurationManager;
 class WindowBase;
 
-class EglGraphics : public Graphics::GraphicsInterface
+// Needs exporting as required by the GlWindow library
+class DALI_ADAPTOR_API EglGraphics : public Graphics::GraphicsInterface
 {
 public:
   /**
index a22cc301c175d15bb5a68d9dd9cdeaa374b1e6a0..de1908d17f2a9ae6da3d3c3c40344607f9489b24 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EGL_IMPLEMENTATION_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -34,8 +34,10 @@ namespace Adaptor
 {
 /**
  * EglImplementation class provides an EGL implementation.
+ *
+ * Needs exporting as required by the GlWindow library
  */
-class EglImplementation : public EglInterface
+class DALI_ADAPTOR_API EglImplementation : public EglInterface
 {
 public:
   /**
@@ -245,8 +247,8 @@ private:
   typedef std::vector<EGLSurface> EglWindowSurfaceContainer;
   EglWindowSurfaceContainer       mEglWindowSurfaces; ///< The EGL surface for the window
 
-  int32_t  mMultiSamplingLevel;
-  int32_t  mGlesVersion;
+  int32_t mMultiSamplingLevel;
+  int32_t mGlesVersion;
 
   ColorDepth mColorDepth;
 
index 1cd2bc4d2398f9bb4f671751166df4757be154ff..4c31dee5a9c90d72e3650f445809b884a16d0460 100644 (file)
@@ -179,7 +179,7 @@ void CommandBuffer::BeginRenderPass(Graphics::RenderPass*          gfxRenderPass
   DALI_ASSERT_DEBUG(mRenderTarget == renderTarget && "RenderPass has different render target to cmd buffer Begin");
 
   auto             renderPass  = static_cast<Vulkan::RenderPass*>(gfxRenderPass);
-  auto             surface     = mRenderTarget->GetSurface();
+  auto             surface     = renderTarget->GetSurface();
   auto&            device      = mController.GetGraphicsDevice();
   FramebufferImpl* framebuffer = nullptr;
   RenderPassHandle renderPassImpl;
@@ -228,10 +228,10 @@ void CommandBuffer::BeginRenderPass(Graphics::RenderPass*          gfxRenderPass
   }
   else
   {
-    auto coreFramebuffer = mRenderTarget->GetFramebuffer();
+    auto coreFramebuffer = renderTarget->GetFramebuffer();
     framebuffer          = coreFramebuffer->GetImpl();
     renderPassImpl       = framebuffer->GetImplFromRenderPass(renderPass);
-    mController.AddTextureDependencies(mRenderTarget);
+    mController.AddTextureDependencies(renderTarget);
   }
 
   std::vector<vk::ClearValue> vkClearValues;
index bce4fd36e918d06617acf91fdf31134501926414..b3430df37f66d41a6d9bf635915e8de70dc5c8f1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
 // INTERNAL INCLUDES
 #include <dali/integration-api/core-enumerations.h>
 #include <dali/internal/graphics/vulkan/vulkan-graphics-impl.h>
+#include <dali/internal/window-system/common/display-utils.h>
 
 namespace Dali::Internal::Adaptor
 {
-GraphicsFactory::GraphicsFactory(EnvironmentOptions& environmentOptions)
+VulkanGraphicsFactory::VulkanGraphicsFactory(EnvironmentOptions& environmentOptions)
 : mEnvironmentOptions(environmentOptions)
 {
 }
 
-GraphicsFactory::~GraphicsFactory() = default;
+VulkanGraphicsFactory::~VulkanGraphicsFactory() = default;
 
-Graphics::GraphicsInterface& GraphicsFactory::Create()
+Graphics::GraphicsInterface& VulkanGraphicsFactory::Create()
 {
   auto depthBufferRequired = (mEnvironmentOptions.DepthBufferRequired() ? Integration::DepthBufferAvailable::TRUE : Integration::DepthBufferAvailable::FALSE);
 
@@ -67,8 +68,14 @@ Graphics::GraphicsInterface& GraphicsFactory::Create()
   return static_cast<Dali::Graphics::GraphicsInterface&>(*graphics);
 }
 
-void GraphicsFactory::Destroy()
+void VulkanGraphicsFactory::Destroy()
 {
 }
 
+std::unique_ptr<GraphicsFactoryInterface> CreateGraphicsFactory(EnvironmentOptions& environmentOptions)
+{
+  DALI_LOG_RELEASE_INFO("DALi Graphics Backend: VULKAN\n");
+  return Utils::MakeUnique<VulkanGraphicsFactory>(environmentOptions);
+}
+
 } // namespace Dali::Internal::Adaptor
index b6443ffa763603d59f3832d08930d81b8bc5c1f1..9d2ee5df7175dee78374cd2c508f556e22ea670b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_GRAPHICS_VULKAN_GRAPHICS_FACTORY_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
 
 namespace Dali::Internal::Adaptor
 {
-class DALI_ADAPTOR_API GraphicsFactory : public GraphicsFactoryInterface
+class DALI_ADAPTOR_API VulkanGraphicsFactory : public GraphicsFactoryInterface
 {
 public:
   /**
    * Constructor
    */
-  explicit GraphicsFactory(EnvironmentOptions& environmentOptions);
+  explicit VulkanGraphicsFactory(EnvironmentOptions& environmentOptions);
 
   /**
    * Destructor
    */
-  ~GraphicsFactory() override;
+  ~VulkanGraphicsFactory() override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::GraphicsFactoryInterface::Create()
diff --git a/dali/internal/imaging/common/native-image-source-factory-dynamic.cpp b/dali/internal/imaging/common/native-image-source-factory-dynamic.cpp
new file mode 100644 (file)
index 0000000..0ce42a0
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-library.h>
+#include <dali/internal/imaging/common/native-image-source-factory.h>
+
+namespace Dali::Internal::Adaptor
+{
+__attribute__((weak)) std::unique_ptr<NativeImageSourceFactory> GetNativeImageSourceFactory()
+{
+  return GraphicsLibrary::GetNativeImageSourceFactory();
+}
+} // namespace Dali::Internal::Adaptor
index 1103533104b3bf5280fd2ad12b3a7f77c3ae9a38..062d2b2841778b501f0356f8eca5299752bc48b9 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SOURCE_FACTORY_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -45,7 +45,8 @@ public:
   virtual std::unique_ptr<NativeImageSourceQueue> CreateNativeImageSourceQueue(uint32_t queueCount, uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue) = 0;
 };
 
-extern std::unique_ptr<NativeImageSourceFactory> GetNativeImageSourceFactory();
+// Needs exporting as it's called by the Graphics Libraries
+extern DALI_ADAPTOR_API std::unique_ptr<NativeImageSourceFactory> GetNativeImageSourceFactory();
 
 } // namespace Adaptor
 } // namespace Internal
index 957085a417f79649e800f56db8c0132be8307bb4..170a5ce72df3a45d05ce3ce20d5fa0589170c245 100644 (file)
@@ -28,6 +28,11 @@ SET( adaptor_imaging_common_egl_src_files
     ${adaptor_imaging_dir}/common/native-bitmap-buffer-impl.cpp
 )
 
+# module: imaging, backend: common/dynamic
+SET( adaptor_imaging_common_dynamic_src_files
+    ${adaptor_imaging_dir}/common/native-image-source-factory-dynamic.cpp
+)
+
 # module: imaging, backend: tizen
 SET( adaptor_imaging_tizen_src_files
     ${adaptor_imaging_dir}/common/file-download.cpp
index b249cabebfcb9f07c7e36931fcd420d6b84d5f89..25f0cc2d4a185a7aac678a072cba23f72db68a28 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ENVIRONMENT_CONFIGURATION_MANAGER_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -22,6 +22,9 @@
 #include <memory>
 #include <string>
 
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
+
 namespace Dali
 {
 class FileStream;
@@ -39,8 +42,10 @@ class ThreadController;
  * This class retrieves and caches the system configuration.
  * Some of the methods in this class can block system until GL has been initialized,
  * only at the first time the DALi application is launched in the system.
+ *
+ * Needs exporting as it's called by the Graphics Libraries
  */
-class ConfigurationManager
+class DALI_ADAPTOR_API ConfigurationManager
 {
 public:
   /**
@@ -105,22 +110,22 @@ public:
   // Deleted move assignment operator.
   ConfigurationManager& operator=(const ConfigurationManager&&) = delete;
 
-private:                                                                // Data
-  std::string        mSystemCacheFilePath;                              ///< The path of system cache file
-  Dali::Graphics::GraphicsInterface* mGraphics;                         ///< Graphics interface
-  ThreadController*  mThreadController;                                 ///< The thread controller
-  unsigned int       mMaxTextureSize;                                   ///< The largest texture that the GL can handle
-  unsigned int       mMaxCombinedTextureUnits;                          ///< The maximum number of combined texture units
-  unsigned int       mShaderLanguageVersion;                            ///< The shader language version that the system supports.
-  bool               mIsMultipleWindowSupported : 1;                    ///< Whether multiple window is supported by the GLES
-  bool               mIsAdvancedBlendEquationSupported : 1;             ///< Whether blend equation advanced (extension) is supported by the GLES
-  bool               mIsMultisampledRenderToTextureSupported : 1;       ///< Whether multisampled render to texture (extension) is supported by the GLES
-  bool               mMaxTextureSizeCached : 1;                         ///< Whether we have checked the maximum texture size
-  bool               mIsMultipleWindowSupportedCached : 1;              ///< Whether we have checked the support of multiple window
-  bool               mIsAdvancedBlendEquationSupportedCached : 1;       ///< Whether we have checked the support of blend equation advanced (extension)
-  bool               mIsMultisampledRenderToTextureSupportedCached : 1; ///< Whether we have checked the support of multisampled render to texture (extension)
-  bool               mShaderLanguageVersionCached : 1;                  ///< Whether we have checked the shader language version
-  bool               mMaxCombinedTextureUnitsCached : 1;                ///< Whether we have checked the maximum number of combined texture units
+private:                                                                                // Data
+  std::string                        mSystemCacheFilePath;                              ///< The path of system cache file
+  Dali::Graphics::GraphicsInterface* mGraphics;                                         ///< Graphics interface
+  ThreadController*                  mThreadController;                                 ///< The thread controller
+  unsigned int                       mMaxTextureSize;                                   ///< The largest texture that the GL can handle
+  unsigned int                       mMaxCombinedTextureUnits;                          ///< The maximum number of combined texture units
+  unsigned int                       mShaderLanguageVersion;                            ///< The shader language version that the system supports.
+  bool                               mIsMultipleWindowSupported : 1;                    ///< Whether multiple window is supported by the GLES
+  bool                               mIsAdvancedBlendEquationSupported : 1;             ///< Whether blend equation advanced (extension) is supported by the GLES
+  bool                               mIsMultisampledRenderToTextureSupported : 1;       ///< Whether multisampled render to texture (extension) is supported by the GLES
+  bool                               mMaxTextureSizeCached : 1;                         ///< Whether we have checked the maximum texture size
+  bool                               mIsMultipleWindowSupportedCached : 1;              ///< Whether we have checked the support of multiple window
+  bool                               mIsAdvancedBlendEquationSupportedCached : 1;       ///< Whether we have checked the support of blend equation advanced (extension)
+  bool                               mIsMultisampledRenderToTextureSupportedCached : 1; ///< Whether we have checked the support of multisampled render to texture (extension)
+  bool                               mShaderLanguageVersionCached : 1;                  ///< Whether we have checked the shader language version
+  bool                               mMaxCombinedTextureUnitsCached : 1;                ///< Whether we have checked the maximum number of combined texture units
 };
 
 } // namespace Internal::Adaptor
index cd8f5bf5d65abc21dbffe1be18e4f917cda8bd95..76c455c26652f9e98800f5ad060f1896f12ccb0a 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_ADAPTOR_ENVIRONMENT_OPTIONS_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -41,8 +41,9 @@ class PerformanceInterface;
  * This class provides the environment options which define settings as well as
  * the ability to install a log function.
  *
+ * Needs exporting as it's called by the Graphics Libraries
  */
-class EnvironmentOptions : public Dali::LogFactoryInterface, public Dali::TraceFactoryInterface
+class DALI_ADAPTOR_API EnvironmentOptions : public Dali::LogFactoryInterface, public Dali::TraceFactoryInterface
 {
 public:
   /**
index bce7e5f0435bd1a33240719cbe6870b960dd3b72..0d038ce24ea0182e5027c7d5813051b2a442575d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_TIME_SERVICE_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
  *
  */
 
+// EXTERNAL INCLUDES
 #include <stdint.h>
 
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
+
 namespace Dali
 {
 namespace Internal
@@ -34,8 +38,10 @@ namespace TimeService
  * @param[out]  timeInNanoseconds  The time in nanoseconds since the reference point.
  *
  * @note The maximum value timeInNanoseconds can hold is 0xFFFFFFFFFFFFFFFF which is 1.844674407e+19. Therefore, this can overflow after approximately 584 years.
+ *
+ * Needs exporting as required by the GlWindow library
  */
-void GetNanoseconds(uint64_t& timeInNanoseconds);
+void DALI_ADAPTOR_API GetNanoseconds(uint64_t& timeInNanoseconds);
 
 /**
  * @brief Get the monotonic time since the clock's epoch.
@@ -43,8 +49,10 @@ void GetNanoseconds(uint64_t& timeInNanoseconds);
  * @return The time in milliseconds since the reference point.
  *
  * @note The maximum value that can be returned is 0xFFFFFFFF which is 4,294,967,295. Therefore, this can overflow after approximately 49 days.
+ *
+ * Needs exporting as required by the GlWindow library
  */
-uint32_t GetMilliSeconds();
+uint32_t DALI_ADAPTOR_API GetMilliSeconds();
 
 /**
  * @brief Sleeps until the monotonic time specified since the clock's epoch.
@@ -54,8 +62,10 @@ uint32_t GetMilliSeconds();
  * @param[in]  timeInNanoseconds  The time to sleep until
  *
  * @note The maximum value timeInNanoseconds can hold is 0xFFFFFFFFFFFFFFFF which is 1.844674407e+19. Therefore, this can overflow after approximately 584 years.
+ *
+ * Needs exporting as required by the GlWindow library
  */
-void SleepUntil(uint64_t timeInNanoseconds);
+void DALI_ADAPTOR_API SleepUntil(uint64_t timeInNanoseconds);
 
 } // namespace TimeService
 
index 3537f03a75881d9741c4f1520bac2096fb6f0177..27e3bdfd8af024f4c75b2a1c4724c6dcf9da2543 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOW_SYSTEM_COMMON_DISPLAY_CONNECTION_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -31,7 +31,8 @@ namespace Internal::Adaptor
 class DisplayConnection;
 }
 
-class DisplayConnection
+// Needs exporting as it's called by the Graphics Libraries
+class DALI_ADAPTOR_API DisplayConnection
 {
 public:
   /**
index 70685f814cc72aceb762fac3d95775a6396dda65..dcf816ed807305f12b91068f6b7e9b1aafc779a3 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_EVENT_HANDLER_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -51,8 +51,10 @@ class WindowRenderSurface;
  * to TouchEvents when it does receive them.
  *
  * These TouchEvents are then passed on to Core.
+ *
+ * Needs exporting as it's used by the GlWindow library
  */
-class EventHandler : public ConnectionTracker, public Dali::RefObject
+class DALI_ADAPTOR_API EventHandler : public ConnectionTracker, public Dali::RefObject
 {
 public:
   /**
diff --git a/dali/internal/window-system/common/gl-window-impl.cpp b/dali/internal/window-system/common/gl-window-impl.cpp
deleted file mode 100644 (file)
index 80d1a00..0000000
+++ /dev/null
@@ -1,869 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <dali/internal/window-system/common/gl-window-impl.h>
-
-// EXTERNAL HEADERS
-#include <dali/devel-api/adaptor-framework/gl-window.h>
-#include <dali/devel-api/adaptor-framework/orientation.h>
-#include <dali/devel-api/events/key-event-devel.h>
-#include <dali/integration-api/core.h>
-#include <dali/integration-api/events/key-event-integ.h>
-#include <dali/integration-api/events/touch-integ.h>
-
-// INTERNAL HEADERS
-#include <dali/internal/graphics/gles/egl-graphics-factory.h>
-#include <dali/internal/window-system/common/display-utils.h>
-#include <dali/internal/window-system/common/event-handler.h>
-#include <dali/internal/window-system/common/orientation-impl.h>
-#include <dali/internal/window-system/common/window-base.h>
-#include <dali/internal/window-system/common/window-factory.h>
-#include <dali/internal/window-system/common/window-impl.h>
-#include <dali/internal/window-system/common/window-render-surface.h>
-#include <dali/internal/window-system/common/window-system.h>
-#include <dali/internal/window-system/common/window-visibility-observer.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
-{
-namespace
-{
-const int MINIMUM_DIMENSION_CHANGE(1);
-
-#if defined(DEBUG_ENABLED)
-Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW");
-#endif
-
-} // unnamed namespace
-
-GlWindow* GlWindow::New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
-{
-  GlWindow* window       = new GlWindow();
-  window->mIsTransparent = isTransparent;
-  window->Initialize(positionSize, name, className);
-  return window;
-}
-
-GlWindow::GlWindow()
-: mWindowBase(),
-  mGraphics(),
-  mDisplayConnection(nullptr),
-  mGlWindowRenderThread(nullptr),
-  mEventHandler(nullptr),
-  mIsTransparent(false),
-  mIsFocusAcceptable(false),
-  mIconified(false),
-  mOpaqueState(false),
-  mResizeEnabled(false),
-  mVisible(false),
-  mIsWindowRotated(false),
-  mIsTouched(false),
-  mIsEGLInitialized(false),
-  mDepth(false),
-  mStencil(false),
-  mPositionSize(),
-  mAvailableAngles(),
-  mColorDepth(COLOR_DEPTH_24),
-  mRenderingMode(Dali::GlWindow::RenderingMode::CONTINUOUS),
-  mPreferredAngle(0),
-  mTotalRotationAngle(0),
-  mWindowRotationAngle(0),
-  mScreenRotationAngle(0),
-  mOrientationMode(0),
-  mWindowWidth(0),
-  mWindowHeight(0),
-  mNativeWindowId(-1),
-  mMSAA(0),
-  mKeyEventSignal(),
-  mTouchedSignal(),
-  mFocusChangeSignal(),
-  mResizeSignal(),
-  mVisibilityChangedSignal()
-{
-}
-
-GlWindow::~GlWindow()
-{
-  if(mEventHandler)
-  {
-    mEventHandler->RemoveObserver(*this);
-  }
-
-  if(mGlWindowRenderThread)
-  {
-    mGlWindowRenderThread->Stop();
-    mGlWindowRenderThread->Join();
-  }
-
-  if(mIsEGLInitialized)
-  {
-    mGraphics->Destroy();
-  }
-}
-
-void GlWindow::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
-{
-  int screenWidth, screenHeight;
-
-  mPositionSize = positionSize;
-  WindowSystem::GetScreenSize(screenWidth, screenHeight);
-  if((mPositionSize.width == 0) || (mPositionSize.height == 0))
-  {
-    mPositionSize.x      = 0;
-    mPositionSize.y      = 0;
-    mPositionSize.width  = screenWidth;
-    mPositionSize.height = screenHeight;
-  }
-
-  if(screenWidth > screenHeight)
-  {
-    mOrientationMode = 1; // Default mode is landscape
-  }
-  else
-  {
-    mOrientationMode = 0; // Default mode is portrate
-  }
-
-  // Create a window base
-  auto windowFactory = Dali::Internal::Adaptor::GetWindowFactory();
-  Any  surface;
-  mWindowBase = windowFactory->CreateWindowBase(mPositionSize, surface, (mIsTransparent ? true : false));
-  mWindowBase->IconifyChangedSignal().Connect(this, &GlWindow::OnIconifyChanged);
-  mWindowBase->FocusChangedSignal().Connect(this, &GlWindow::OnFocusChanged);
-  mWindowBase->OutputTransformedSignal().Connect(this, &GlWindow::OnOutputTransformed);
-
-  if(Dali::Adaptor::IsAvailable())
-  {
-    SetEventHandler();
-  }
-
-  if(!mPositionSize.IsEmpty())
-  {
-    AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
-    mResizeEnabled = true;
-  }
-
-  mWindowBase->Show();
-
-  if(mIsTransparent)
-  {
-    mColorDepth = COLOR_DEPTH_32;
-  }
-  else
-  {
-    mColorDepth = COLOR_DEPTH_24;
-  }
-
-  SetClass(name, className);
-
-  // For Debugging
-  mNativeWindowId = mWindowBase->GetNativeWindowId();
-}
-
-void GlWindow::SetEventHandler()
-{
-  mEventHandler = EventHandlerPtr(new EventHandler(mWindowBase.get(), *this));
-  mEventHandler->AddObserver(*this);
-}
-
-void GlWindow::SetClass(const std::string& name, const std::string className)
-{
-  mName      = name;
-  mClassName = className;
-  mWindowBase->SetClass(name, className);
-}
-
-void GlWindow::SetGraphicsConfig(bool depth, bool stencil, int msaa, Dali::GlWindow::GlesVersion version)
-{
-  // Init Graphics
-  mDepth   = depth;
-  mStencil = stencil;
-  mMSAA    = msaa;
-
-  InitializeGraphics();
-
-  int rVersion = 30;
-
-  if(version == Dali::GlWindow::GlesVersion::VERSION_2_0)
-  {
-    rVersion = 20;
-  }
-  else if(version == Dali::GlWindow::GlesVersion::VERSION_3_0)
-  {
-    rVersion = 30;
-  }
-
-  mGlWindowRenderThread->SetGraphicsConfig(depth, stencil, msaa, rVersion);
-}
-
-void GlWindow::Raise()
-{
-  mWindowBase->Raise();
-  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Raise() \n", this, mNativeWindowId);
-}
-
-void GlWindow::Lower()
-{
-  mWindowBase->Lower();
-  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Lower() \n", this, mNativeWindowId);
-}
-
-void GlWindow::Activate()
-{
-  mWindowBase->Activate();
-  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Activate() \n", this, mNativeWindowId);
-}
-
-void GlWindow::Show()
-{
-  mVisible = true;
-
-  mWindowBase->Show();
-
-  if(!mIconified)
-  {
-    Dali::GlWindow handle(this);
-    mVisibilityChangedSignal.Emit(handle, true);
-  }
-
-  if(mEventHandler)
-  {
-    mEventHandler->Resume();
-  }
-
-  if(mGlWindowRenderThread)
-  {
-    mGlWindowRenderThread->Resume();
-  }
-
-  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Show(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible);
-}
-
-void GlWindow::Hide()
-{
-  mVisible = false;
-
-  mWindowBase->Hide();
-
-  if(!mIconified)
-  {
-    Dali::GlWindow handle(this);
-    mVisibilityChangedSignal.Emit(handle, false);
-  }
-
-  if(mEventHandler)
-  {
-    mEventHandler->Pause();
-  }
-
-  if(mGlWindowRenderThread)
-  {
-    mGlWindowRenderThread->Pause();
-  }
-
-  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Hide(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible);
-}
-
-unsigned int GlWindow::GetSupportedAuxiliaryHintCount() const
-{
-  return mWindowBase->GetSupportedAuxiliaryHintCount();
-}
-
-std::string GlWindow::GetSupportedAuxiliaryHint(unsigned int index) const
-{
-  return mWindowBase->GetSupportedAuxiliaryHint(index);
-}
-
-unsigned int GlWindow::AddAuxiliaryHint(const std::string& hint, const std::string& value)
-{
-  return mWindowBase->AddAuxiliaryHint(hint, value);
-}
-
-bool GlWindow::RemoveAuxiliaryHint(unsigned int id)
-{
-  return mWindowBase->RemoveAuxiliaryHint(id);
-}
-
-bool GlWindow::SetAuxiliaryHintValue(unsigned int id, const std::string& value)
-{
-  return mWindowBase->SetAuxiliaryHintValue(id, value);
-}
-
-std::string GlWindow::GetAuxiliaryHintValue(unsigned int id) const
-{
-  return mWindowBase->GetAuxiliaryHintValue(id);
-}
-
-unsigned int GlWindow::GetAuxiliaryHintId(const std::string& hint) const
-{
-  return mWindowBase->GetAuxiliaryHintId(hint);
-}
-
-void GlWindow::SetInputRegion(const Rect<int>& inputRegion)
-{
-  mWindowBase->SetInputRegion(inputRegion);
-
-  DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "GlWindow::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height);
-}
-
-void GlWindow::SetOpaqueState(bool opaque)
-{
-  mOpaqueState = opaque;
-
-  mWindowBase->SetOpaqueState(opaque);
-
-  DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "GlWindow::SetOpaqueState: opaque = %d\n", opaque);
-}
-
-bool GlWindow::IsOpaqueState() const
-{
-  return mOpaqueState;
-}
-
-void GlWindow::SetPositionSize(PositionSize positionSize)
-{
-  if(!mResizeEnabled)
-  {
-    AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
-    mResizeEnabled = true;
-  }
-
-  bool needToMove   = false;
-  bool needToResize = false;
-
-  // Check moving
-  if((fabs(positionSize.x - mPositionSize.x) > MINIMUM_DIMENSION_CHANGE) ||
-     (fabs(positionSize.y - mPositionSize.y) > MINIMUM_DIMENSION_CHANGE))
-  {
-    needToMove = true;
-  }
-
-  // Check resizing
-  if((fabs(positionSize.width - mPositionSize.width) > MINIMUM_DIMENSION_CHANGE) ||
-     (fabs(positionSize.height - mPositionSize.height) > MINIMUM_DIMENSION_CHANGE))
-  {
-    needToResize = true;
-  }
-
-  if(needToResize)
-  {
-    if(needToMove)
-    {
-      mWindowBase->MoveResize(positionSize);
-    }
-    else
-    {
-      mWindowBase->Resize(positionSize);
-    }
-    mPositionSize = positionSize;
-  }
-  else
-  {
-    if(needToMove)
-    {
-      mWindowBase->Move(positionSize);
-      mPositionSize = positionSize;
-    }
-  }
-
-  // If window's size or position is changed, the signal will be emitted to user.
-  if(needToMove || needToResize)
-  {
-    Uint16Pair     newSize(mPositionSize.width, mPositionSize.height);
-    Dali::GlWindow handle(this);
-    mResizeSignal.Emit(newSize);
-
-    if(mGlWindowRenderThread)
-    {
-      mGlWindowRenderThread->RequestWindowResize(mPositionSize.width, mPositionSize.height);
-    }
-  }
-}
-
-PositionSize GlWindow::GetPositionSize() const
-{
-  PositionSize positionSize(mPositionSize);
-  if(mTotalRotationAngle == 90 || mTotalRotationAngle == 270)
-  {
-    positionSize.height = mPositionSize.width;
-    positionSize.width  = mPositionSize.height;
-  }
-
-  return positionSize;
-}
-
-void GlWindow::OnIconifyChanged(bool iconified)
-{
-  if(iconified)
-  {
-    mIconified = true;
-
-    if(mVisible)
-    {
-      Dali::GlWindow handle(this);
-      mVisibilityChangedSignal.Emit(handle, false);
-    }
-
-    if(mEventHandler)
-    {
-      mEventHandler->Pause();
-    }
-
-    if(mGlWindowRenderThread)
-    {
-      mGlWindowRenderThread->Pause();
-    }
-
-    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Iconified: visible = %d\n", this, mNativeWindowId, mVisible);
-  }
-  else
-  {
-    mIconified = false;
-
-    if(mVisible)
-    {
-      Dali::GlWindow handle(this);
-      mVisibilityChangedSignal.Emit(handle, true);
-    }
-
-    if(mEventHandler)
-    {
-      mEventHandler->Resume();
-    }
-
-    if(mGlWindowRenderThread)
-    {
-      mGlWindowRenderThread->Resume();
-    }
-
-    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Deiconified: visible = %d\n", this, mNativeWindowId, mVisible);
-  }
-}
-
-void GlWindow::OnFocusChanged(bool focusIn)
-{
-  Dali::GlWindow handle(this);
-  mFocusChangeSignal.Emit(handle, focusIn);
-}
-
-void GlWindow::OnOutputTransformed()
-{
-  int newScreenRotationAngle = mWindowBase->GetScreenRotationAngle();
-  DALI_LOG_RELEASE_INFO("GlWindow::OnOutputTransformed(), screen rotation occurs, old[%d], new[%d\n", mScreenRotationAngle, newScreenRotationAngle);
-
-  if(newScreenRotationAngle != mScreenRotationAngle)
-  {
-    UpdateScreenRotation(newScreenRotationAngle);
-  }
-}
-
-void GlWindow::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
-{
-  PointState::Type state = point.GetState();
-
-  if(state == PointState::DOWN)
-  {
-    mIsTouched = true;
-  }
-
-  if(state == PointState::UP)
-  {
-    mIsTouched = false;
-  }
-
-  if(!mIsTouched && state == PointState::MOTION)
-  {
-    return;
-  }
-
-  Vector2 convertedPosition = RecalculatePosition(point.GetScreenPosition());
-  point.SetScreenPosition(convertedPosition);
-
-  Dali::TouchEvent touchEvent = Dali::Integration::NewTouchEvent(timeStamp, point);
-  Dali::GlWindow   handle(this);
-  mTouchedSignal.Emit(touchEvent);
-}
-
-void GlWindow::OnMouseFrameEvent()
-{
-}
-
-void GlWindow::OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent)
-{
-  // TODO:
-  //FeedWheelEvent( wheelEvent );
-}
-
-void GlWindow::OnKeyEvent(Dali::Integration::KeyEvent& keyEvent)
-{
-  Dali::KeyEvent event = Dali::DevelKeyEvent::New(keyEvent.keyName, keyEvent.logicalKey, keyEvent.keyString, keyEvent.keyCode, keyEvent.keyModifier, keyEvent.time, static_cast<Dali::KeyEvent::State>(keyEvent.state), keyEvent.compose, keyEvent.deviceName, keyEvent.deviceClass, keyEvent.deviceSubclass);
-  Dali::DevelKeyEvent::SetWindowId(event, keyEvent.windowId);
-  Dali::GlWindow handle(this);
-  mKeyEventSignal.Emit(event);
-}
-
-void GlWindow::OnRotation(const RotationEvent& rotation)
-{
-  mWindowRotationAngle = rotation.angle;
-  mTotalRotationAngle  = (mWindowRotationAngle + mScreenRotationAngle) % 360;
-  if(mTotalRotationAngle == 90 || mTotalRotationAngle == 270)
-  {
-    mWindowWidth  = mPositionSize.height;
-    mWindowHeight = mPositionSize.width;
-  }
-  else
-  {
-    mWindowWidth  = mPositionSize.width;
-    mWindowHeight = mPositionSize.height;
-  }
-
-  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), OnRotation(): resize signal emit [%d x %d]\n", this, mNativeWindowId, mWindowWidth, mWindowHeight);
-
-  // Emit Resize signal
-  Dali::GlWindow handle(this);
-  mResizeSignal.Emit(Dali::Uint16Pair(mWindowWidth, mWindowHeight));
-
-  if(mGlWindowRenderThread)
-  {
-    mGlWindowRenderThread->RequestWindowRotate(mWindowRotationAngle);
-  }
-}
-
-Vector2 GlWindow::RecalculatePosition(const Vector2& position)
-{
-  Vector2 convertedPosition;
-
-  switch(mTotalRotationAngle)
-  {
-    case 90:
-    {
-      convertedPosition.x = static_cast<float>(mWindowWidth) - position.y;
-      convertedPosition.y = position.x;
-      break;
-    }
-    case 180:
-    {
-      convertedPosition.x = static_cast<float>(mWindowWidth) - position.x;
-      convertedPosition.y = static_cast<float>(mWindowHeight) - position.y;
-      break;
-    }
-    case 270:
-    {
-      convertedPosition.x = position.y;
-      convertedPosition.y = static_cast<float>(mWindowHeight) - position.x;
-      break;
-    }
-    default:
-    {
-      convertedPosition = position;
-      break;
-    }
-  }
-  return convertedPosition;
-}
-
-void GlWindow::SetAvailableAnlges(const std::vector<int>& angles)
-{
-  if(angles.size() > 4)
-  {
-    DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetAvailableAnlges: Invalid vector size! [%d]\n", angles.size());
-    return;
-  }
-
-  mWindowBase->SetAvailableAnlges(angles);
-}
-
-bool GlWindow::IsOrientationAvailable(WindowOrientation orientation) const
-{
-  if(orientation <= WindowOrientation::NO_ORIENTATION_PREFERENCE || orientation > WindowOrientation::LANDSCAPE_INVERSE)
-  {
-    DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::IsOrientationAvailable: Invalid input orientation [%d]\n", orientation);
-    return false;
-  }
-  return true;
-}
-
-int GlWindow::ConvertToAngle(WindowOrientation orientation)
-{
-  int convertAngle = 0;
-  if(mOrientationMode == 0)
-  {
-    convertAngle = static_cast<int>(orientation);
-  }
-  else if(mOrientationMode == 1)
-  {
-    switch(orientation)
-    {
-      case WindowOrientation::LANDSCAPE:
-      {
-        convertAngle = 0;
-        break;
-      }
-      case WindowOrientation::PORTRAIT:
-      {
-        convertAngle = 90;
-        break;
-      }
-      case WindowOrientation::LANDSCAPE_INVERSE:
-      {
-        convertAngle = 180;
-        break;
-      }
-      case WindowOrientation::PORTRAIT_INVERSE:
-      {
-        convertAngle = 270;
-        break;
-      }
-      case WindowOrientation::NO_ORIENTATION_PREFERENCE:
-      {
-        convertAngle = -1;
-        break;
-      }
-    }
-  }
-  return convertAngle;
-}
-
-WindowOrientation GlWindow::ConvertToOrientation(int angle) const
-{
-  WindowOrientation orientation = WindowOrientation::NO_ORIENTATION_PREFERENCE;
-  if(mOrientationMode == 0) // Portrate mode
-  {
-    orientation = static_cast<WindowOrientation>(angle);
-  }
-  else if(mOrientationMode == 1) // Landscape mode
-  {
-    switch(angle)
-    {
-      case 0:
-      {
-        orientation = WindowOrientation::LANDSCAPE;
-        break;
-      }
-      case 90:
-      {
-        orientation = WindowOrientation::PORTRAIT;
-        break;
-      }
-      case 180:
-      {
-        orientation = WindowOrientation::LANDSCAPE_INVERSE;
-        break;
-      }
-      case 270:
-      {
-        orientation = WindowOrientation::PORTRAIT_INVERSE;
-        break;
-      }
-      case -1:
-      {
-        orientation = WindowOrientation::NO_ORIENTATION_PREFERENCE;
-        break;
-      }
-    }
-  }
-  return orientation;
-}
-
-WindowOrientation GlWindow::GetCurrentOrientation() const
-{
-  return ConvertToOrientation(mTotalRotationAngle);
-}
-
-void GlWindow::SetAvailableOrientations(const Dali::Vector<WindowOrientation>& orientations)
-{
-  Dali::Vector<float>::SizeType count = orientations.Count();
-  for(Dali::Vector<float>::SizeType index = 0; index < count; ++index)
-  {
-    if(IsOrientationAvailable(orientations[index]) == false)
-    {
-      DALI_LOG_ERROR("Window::SetAvailableRotationAngles, invalid angle: %d\n", orientations[index]);
-      continue;
-    }
-
-    bool found = false;
-    int  angle = ConvertToAngle(orientations[index]);
-
-    for(std::size_t i = 0; i < mAvailableAngles.size(); i++)
-    {
-      if(mAvailableAngles[i] == angle)
-      {
-        found = true;
-        break;
-      }
-    }
-
-    if(!found)
-    {
-      DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), SetAvailableOrientations: %d\n", this, mNativeWindowId, angle);
-      mAvailableAngles.push_back(angle);
-    }
-  }
-  SetAvailableAnlges(mAvailableAngles);
-}
-
-void GlWindow::SetPreferredOrientation(WindowOrientation orientation)
-{
-  if(IsOrientationAvailable(orientation) == false)
-  {
-    DALI_LOG_ERROR("Window::SetPreferredOrientation, invalid orientation: %d\n", orientation);
-    return;
-  }
-  mPreferredAngle = ConvertToAngle(orientation);
-  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), SetPreferredOrientation: %d\n", this, mNativeWindowId, mPreferredAngle);
-  mWindowBase->SetPreferredAngle(mPreferredAngle);
-}
-
-void GlWindow::SetChild(Dali::Window& child)
-{
-  if(DALI_UNLIKELY(child))
-  {
-    mChildWindow                             = child;
-    Internal::Adaptor::Window& windowImpl    = Dali::GetImplementation(mChildWindow);
-    WindowRenderSurface*       renderSurface = static_cast<WindowRenderSurface*>(windowImpl.GetSurface());
-    if(renderSurface)
-    {
-      WindowBase* childWindowBase = renderSurface->GetWindowBase();
-      if(childWindowBase)
-      {
-        childWindowBase->SetParent(mWindowBase.get(), false);
-      }
-    }
-  }
-}
-
-void GlWindow::RegisterGlCallbacks(CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback)
-{
-  if(mIsEGLInitialized == false)
-  {
-    InitializeGraphics();
-  }
-  mGlWindowRenderThread->RegisterGlCallbacks(initCallback, renderFrameCallback, terminateCallback);
-  mGlWindowRenderThread->Start();
-}
-
-void GlWindow::RenderOnce()
-{
-  if(mGlWindowRenderThread)
-  {
-    mGlWindowRenderThread->RenderOnce();
-  }
-}
-
-void GlWindow::SetRenderingMode(Dali::GlWindow::RenderingMode mode)
-{
-  mRenderingMode = mode;
-  if(mGlWindowRenderThread)
-  {
-    bool onDemand = false;
-    if(mRenderingMode == Dali::GlWindow::RenderingMode::ON_DEMAND)
-    {
-      onDemand = true;
-    }
-    mGlWindowRenderThread->SetOnDemandRenderMode(onDemand);
-  }
-}
-
-Dali::GlWindow::RenderingMode GlWindow::GetRenderingMode() const
-{
-  return mRenderingMode;
-}
-
-void GlWindow::InitializeGraphics()
-{
-  if(!mIsEGLInitialized)
-  {
-    // Init Graphics
-    std::unique_ptr<GraphicsFactory> graphicsFactoryPtr = Utils::MakeUnique<GraphicsFactory>(mEnvironmentOptions);
-    auto                             graphicsFactory    = *graphicsFactoryPtr;
-
-    mGraphics = std::unique_ptr<Graphics::GraphicsInterface>(&graphicsFactory.Create());
-
-    Graphics::GraphicsInterface* graphics = mGraphics.get();
-
-    mDisplayConnection = std::unique_ptr<Dali::DisplayConnection>(Dali::DisplayConnection::New(Dali::Integration::RenderSurfaceInterface::Type::WINDOW_RENDER_SURFACE));
-    graphics->Initialize(*mDisplayConnection, mDepth, mStencil, false, mMSAA);
-
-    // Create Render Thread
-    mGlWindowRenderThread = std::unique_ptr<Dali::Internal::Adaptor::GlWindowRenderThread>(new GlWindowRenderThread(mPositionSize, mColorDepth));
-    if(!mGlWindowRenderThread)
-    {
-      DALI_LOG_ERROR("Fail to create GlWindow Render Thread!!!!\n");
-      return;
-    }
-
-    mGlWindowRenderThread->SetGraphicsInterface(graphics);
-    mGlWindowRenderThread->SetWindowBase(mWindowBase.get());
-    bool onDemand = false;
-    if(mRenderingMode == Dali::GlWindow::RenderingMode::ON_DEMAND)
-    {
-      onDemand = true;
-    }
-    mGlWindowRenderThread->SetOnDemandRenderMode(onDemand);
-
-    mIsEGLInitialized = true;
-
-    // Check screen rotation
-    int newScreenRotationAngle = mWindowBase->GetScreenRotationAngle();
-    DALI_LOG_RELEASE_INFO("GlWindow::InitializeGraphics(), GetScreenRotationAngle(): %d\n", mScreenRotationAngle);
-    if(newScreenRotationAngle != 0)
-    {
-      UpdateScreenRotation(newScreenRotationAngle);
-    }
-  }
-}
-
-void GlWindow::OnDamaged(const DamageArea& area)
-{
-}
-
-void GlWindow::UpdateScreenRotation(int newAngle)
-{
-  mScreenRotationAngle = newAngle;
-  mTotalRotationAngle  = (mWindowRotationAngle + mScreenRotationAngle) % 360;
-
-  if(mTotalRotationAngle == 90 || mTotalRotationAngle == 270)
-  {
-    mWindowWidth  = mPositionSize.height;
-    mWindowHeight = mPositionSize.width;
-  }
-  else
-  {
-    mWindowWidth  = mPositionSize.width;
-    mWindowHeight = mPositionSize.height;
-  }
-
-  // Emit Resize signal
-  Dali::GlWindow handle(this);
-  mResizeSignal.Emit(Dali::Uint16Pair(mWindowWidth, mWindowHeight));
-
-  if(mGlWindowRenderThread)
-  {
-    DALI_LOG_RELEASE_INFO("GlWindow::UpdateScreenRotation(), RequestScreenRotatem(), mScreenRotationAngle: %d\n", mScreenRotationAngle);
-    mGlWindowRenderThread->RequestScreenRotate(mScreenRotationAngle);
-  }
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/window-system/common/gl-window-impl.h b/dali/internal/window-system/common/gl-window-impl.h
deleted file mode 100644 (file)
index e2f0764..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-#ifndef DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_IMPL_H
-#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_IMPL_H
-
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/adaptor-framework/window.h>
-#include <dali/public-api/object/base-object.h>
-#include <dali/public-api/object/ref-object.h>
-
-// INTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/gl-window.h>
-#include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/internal/graphics/gles/egl-graphics.h>
-#include <dali/internal/window-system/common/event-handler.h>
-#include <dali/internal/window-system/common/gl-window-render-thread.h>
-
-namespace Dali
-{
-class Adaptor;
-
-namespace Internal
-{
-namespace Adaptor
-{
-class WindowBase;
-
-class GlWindow;
-using GlWindowPtr     = IntrusivePtr<GlWindow>;
-using EventHandlerPtr = IntrusivePtr<EventHandler>;
-
-/**
- * Window provides a surface to render onto with orientation.
- */
-class GlWindow : public BaseObject, public EventHandler::Observer, public DamageObserver, public ConnectionTracker
-{
-public:
-  using KeyEventSignalType          = Dali::GlWindow::KeyEventSignalType;
-  using TouchEventSignalType        = Dali::GlWindow::TouchEventSignalType;
-  using FocusChangeSignalType       = Dali::GlWindow::FocusChangeSignalType;
-  using ResizeSignalType            = Dali::GlWindow::ResizeSignalType;
-  using VisibilityChangedSignalType = Dali::GlWindow::VisibilityChangedSignalType;
-  using SignalType                  = Signal<void()>;
-
-  /**
-   * @brief Create a new GlWindow. This should only be called once by the Application class
-   * @param[in] positionSize The position and size of the window
-   * @param[in] name The window title
-   * @param[in] className The window class name
-   * @param[in] isTransparent Whether window is transparent
-   * @return A newly allocated Window
-   */
-  static GlWindow* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false);
-
-  /**
-   * @copydoc Dali::GlWindow::SetGraphicsConfig()
-   */
-  void SetGraphicsConfig(bool depth, bool stencil, int msaa, Dali::GlWindow::GlesVersion version);
-
-  /**
-   * @copydoc Dali::GlWindow::Raise()
-   */
-  void Raise();
-
-  /**
-   * @copydoc Dali::GlWindow::Lower()
-   */
-  void Lower();
-
-  /**
-   * @copydoc Dali::GlWindow::Activate()
-   */
-  void Activate();
-
-  /**
-   * @copydoc Dali::GlWindow::Show()
-   */
-  void Show();
-
-  /**
-   * @copydoc Dali::GlWindow::Hide()
-   */
-  void Hide();
-
-  /**
-   * @copydoc Dali::GlWindow::GetSupportedAuxiliaryHintCount()
-   */
-  unsigned int GetSupportedAuxiliaryHintCount() const;
-
-  /**
-   * @copydoc Dali::GlWindow::GetSupportedAuxiliaryHint()
-   */
-  std::string GetSupportedAuxiliaryHint(unsigned int index) const;
-
-  /**
-   * @copydoc Dali::GlWindow::AddAuxiliaryHint()
-   */
-  unsigned int AddAuxiliaryHint(const std::string& hint, const std::string& value);
-
-  /**
-   * @copydoc Dali::GlWindow::RemoveAuxiliaryHint()
-   */
-  bool RemoveAuxiliaryHint(unsigned int id);
-
-  /**
-   * @copydoc Dali::GlWindow::SetAuxiliaryHintValue()
-   */
-  bool SetAuxiliaryHintValue(unsigned int id, const std::string& value);
-
-  /**
-   * @copydoc Dali::GlWindow::GetAuxiliaryHintValue()
-   */
-  std::string GetAuxiliaryHintValue(unsigned int id) const;
-
-  /**
-   * @copydoc Dali::GlWindow::GetAuxiliaryHintId()
-   */
-  unsigned int GetAuxiliaryHintId(const std::string& hint) const;
-
-  /**
-   * @copydoc Dali::GlWindow::SetInputRegion()
-   */
-  void SetInputRegion(const Rect<int>& inputRegion);
-
-  /**
-   * @copydoc Dali::GlWindow::SetOpaqueState()
-   */
-  void SetOpaqueState(bool opaque);
-
-  /**
-   * @copydoc Dali::GlWindow::IsOpaqueState()
-   */
-  bool IsOpaqueState() const;
-
-  /**
-   * @copydoc Dali::GlWindow::SetPositionSize()
-   */
-  void SetPositionSize(PositionSize positionSize);
-
-  /**
-   * @copydoc Dali::GlWindow::GetPositionSize()
-   */
-  PositionSize GetPositionSize() const;
-
-  /**
-   * @copydoc Dali::GlWindow::GetCurrentOrientation() const
-   */
-  WindowOrientation GetCurrentOrientation() const;
-
-  /**
-   * @copydoc Dali::GlWindow::SetAvailableOrientations()
-   */
-  void SetAvailableOrientations(const Dali::Vector<WindowOrientation>& orientations);
-
-  /**
-   * @copydoc Dali::GlWindow::SetPreferredOrientation()
-   */
-  void SetPreferredOrientation(WindowOrientation orientation);
-
-  /**
-   * @copydoc Dali::GlWindow::RegisterGlCallbacks()
-   */
-  void RegisterGlCallbacks(CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback);
-
-  /**
-   * @copydoc Dali::GlWindow::RenderOnce()
-   */
-  void RenderOnce();
-
-  /**
-   * @copydoc Dali::GlWindow::SetRenderingMode()
-   */
-  void SetRenderingMode(Dali::GlWindow::RenderingMode mode);
-
-  /**
-   * @copydoc Dali::GlWindow::GetRenderingMode()
-   */
-  Dali::GlWindow::RenderingMode GetRenderingMode() const;
-
-public: // For implementation
-  /**
-   * @brief Sets child window with Dali::Window
-   *
-   * @param[in] child The child window.
-   *
-   * Most of cases, child window is the default window in adaptor
-   *
-   * Currently the child window is default window.
-   */
-  void SetChild(Dali::Window& child);
-
-private:
-  /**
-   * Private constructor.
-   * @sa Window::New()
-   */
-  GlWindow();
-
-  /**
-   * Destructor
-   */
-  virtual ~GlWindow();
-
-  /**
-   * Second stage initialization
-   *
-   * @param[in] positionSize The position and size of the window
-   * @param[in] name The window title
-   * @param[in] className The window class name
-   */
-  void Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className);
-
-  /**
-   * Called when the window becomes iconified or deiconified.
-   *
-   * @param[in] iconified The flag whether window is iconifed or deiconfied.
-   */
-  void OnIconifyChanged(bool iconified);
-
-  /**
-   * Called when the window focus is changed.
-   * @param[in] focusIn The flag whether window is focused or not.
-   */
-  void OnFocusChanged(bool focusIn);
-
-  /**
-   * Called when the output is transformed.
-   */
-  void OnOutputTransformed();
-
-  /**
-   * Called when the window receives a delete request.
-   */
-  void OnDeleteRequest();
-
-  /**
-   * @brief Set available rotation angle to window base.
-   *
-   * @param[in] angles The list of the avaiabled rotation angle.
-   */
-  void SetAvailableAnlges(const std::vector<int>& angles);
-
-  /**
-   * @brief Check available window orientation for Available angle.
-   *
-   * @param[in] orientation the oritation value of window rotation.
-   *
-   * @return true is available window orientation. false is not available.
-   */
-  bool IsOrientationAvailable(WindowOrientation orientation) const;
-
-  /**
-   * @brief Convert from window orientation to angle using orientation mode value.
-   *
-   * @param[in] orientation the oritation value of window rotation.
-   *
-   * @return The coverted angle value is returned.
-   */
-  int ConvertToAngle(WindowOrientation orientation);
-
-  /**
-   * @brief Convert from angle to window orientation using orientation mode value.
-   *
-   * @param[in] angle the angle value of window rotation.
-   *
-   * @return The converted window orientation value is returned.
-   */
-  WindowOrientation ConvertToOrientation(int angle) const;
-
-  /**
-   * @brief Initialize and create EGL resource
-   */
-  void InitializeGraphics();
-
-  /**
-   * @brief Sets event handler for window's events.
-   */
-  void SetEventHandler();
-
-  /**
-   * @brief calculate screen position for rotation.
-   */
-  Vector2 RecalculatePosition(const Vector2& position);
-
-  /**
-   * @brief Sets window and class name.
-   *
-   * @param[in] name The name of the window
-   * @param[in] className The class of the window
-   */
-  void SetClass(const std::string& name, const std::string className);
-
-private:
-  /**
-   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnTouchPoint
-   */
-  void OnTouchPoint(Dali::Integration::Point& point, int timeStamp) override;
-
-  /**
-   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnMouseFrameEvent
-   */
-  void OnMouseFrameEvent() override;
-
-  /**
-   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent
-   */
-  void OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent) override;
-
-  /**
-   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnKeyEvent
-   */
-  void OnKeyEvent(Dali::Integration::KeyEvent& keyEvent) override;
-
-  /**
-   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnRotation
-   */
-  void OnRotation(const RotationEvent& rotation) override;
-
-private: // From Dali::Internal::Adaptor::DamageObserver
-  /**
-   * @copydoc Dali::Internal::Adaptor::DamageObserver::OnDamaged()
-   */
-  void OnDamaged(const DamageArea& area);
-
-  /**
-   * @brief Updates screen rotation value and screen rotation works.
-   *
-   * @param[in] newAngle new screen rotation angle
-   */
-  void UpdateScreenRotation(int newAngle);
-
-public: // Signals
-  /**
-   * @copydoc Dali::GlWindow::FocusChangeSignal()
-   */
-  FocusChangeSignalType& FocusChangeSignal()
-  {
-    return mFocusChangeSignal;
-  }
-
-  /**
-   * @copydoc Dali::GlWindow::ResizeSignal()
-   */
-  ResizeSignalType& ResizeSignal()
-  {
-    return mResizeSignal;
-  }
-
-  /**
-   * @copydoc Dali::GlWindow::KeyEventSignal()
-   */
-  KeyEventSignalType& KeyEventSignal()
-  {
-    return mKeyEventSignal;
-  }
-
-  /**
-   * @copydoc Dali::GlWindow::TouchSignal()
-   */
-  TouchEventSignalType& TouchedSignal()
-  {
-    return mTouchedSignal;
-  }
-
-  /**
-   * @copydoc Dali::GlWindow::VisibilityChangedSignal()
-   */
-  VisibilityChangedSignalType& VisibilityChangedSignal()
-  {
-    return mVisibilityChangedSignal;
-  }
-
-private:
-  std::unique_ptr<WindowBase>                  mWindowBase;
-  std::unique_ptr<Graphics::GraphicsInterface> mGraphics;             ///< Graphics interface
-  std::unique_ptr<Dali::DisplayConnection>     mDisplayConnection;    ///< The native display connection
-  std::unique_ptr<GlWindowRenderThread>        mGlWindowRenderThread; ///< The render thread
-  EventHandlerPtr                              mEventHandler;         ///< The window events handler
-  Dali::Window                                 mChildWindow;          ///< The default child UI Window
-  std::string                                  mName;
-  std::string                                  mClassName;
-  bool                                         mIsTransparent : 1;
-  bool                                         mIsFocusAcceptable : 1;
-  bool                                         mIconified : 1;
-  bool                                         mOpaqueState : 1;
-  bool                                         mResizeEnabled : 1;
-  bool                                         mVisible : 1;
-  bool                                         mIsWindowRotated : 1;
-  bool                                         mIsTouched : 1;
-  bool                                         mIsEGLInitialized : 1;
-  bool                                         mDepth : 1;
-  bool                                         mStencil : 1;
-
-  PositionSize                  mPositionSize; ///< The window position and size
-  EnvironmentOptions            mEnvironmentOptions;
-  std::vector<int>              mAvailableAngles; ///< The list of available angle
-  ColorDepth                    mColorDepth;      ///< The color depth of window
-  Dali::GlWindow::RenderingMode mRenderingMode;   ///< The rendering mode
-
-  int mPreferredAngle;      ///< The angle of preferred angle
-  int mTotalRotationAngle;  ///< The angle of window + screen rotation angle % 360
-  int mWindowRotationAngle; ///< The angle of window rotation angle
-  int mScreenRotationAngle; ///< The angle of screen rotation angle
-  int mOrientationMode;     ///< 0: Default portrati, 1:Default landscape
-  int mWindowWidth;         ///< The width of the window
-  int mWindowHeight;        ///< The height of the window
-  int mNativeWindowId;      ///< The Native Window Id
-  int mMSAA;                ///< The multisample anti-aliasing for EGL Configuration
-
-  // Signals
-  KeyEventSignalType          mKeyEventSignal;
-  TouchEventSignalType        mTouchedSignal;
-  FocusChangeSignalType       mFocusChangeSignal;
-  ResizeSignalType            mResizeSignal;
-  VisibilityChangedSignalType mVisibilityChangedSignal;
-};
-
-} // namespace Adaptor
-} // namespace Internal
-
-// Helpers for public-api forwarding methods
-
-inline Internal::Adaptor::GlWindow& GetImplementation(Dali::GlWindow& window)
-{
-  DALI_ASSERT_ALWAYS(window && "Window handle is empty");
-  BaseObject& object = window.GetBaseObject();
-  return static_cast<Internal::Adaptor::GlWindow&>(object);
-}
-
-inline const Internal::Adaptor::GlWindow& GetImplementation(const Dali::GlWindow& window)
-{
-  DALI_ASSERT_ALWAYS(window && "Window handle is empty");
-  const BaseObject& object = window.GetBaseObject();
-  return static_cast<const Internal::Adaptor::GlWindow&>(object);
-}
-
-} // namespace Dali
-
-#endif // DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_IMPL_H
diff --git a/dali/internal/window-system/common/gl-window-render-thread.cpp b/dali/internal/window-system/common/gl-window-render-thread.cpp
deleted file mode 100644 (file)
index 9af6a41..0000000
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/thread-settings.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/adaptor/common/adaptor-impl.h>
-#include <dali/internal/system/common/time-service.h>
-#include <dali/internal/window-system/common/gl-window-render-thread.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace Adaptor
-{
-namespace
-{
-constexpr unsigned int NANOSECONDS_PER_SECOND(1e+9);
-
-// The following values will get calculated at compile time
-constexpr float    DEFAULT_FRAME_DURATION_IN_SECONDS(1.0f / 60.0f);
-constexpr uint64_t DEFAULT_FRAME_DURATION_IN_NANOSECONDS(DEFAULT_FRAME_DURATION_IN_SECONDS* NANOSECONDS_PER_SECOND);
-constexpr uint64_t REFRESH_RATE(1u);
-
-constexpr int MINIMUM_DIMENSION_CHANGE(1);
-} // namespace
-
-GlWindowRenderThread::GlWindowRenderThread(PositionSize positionSize, ColorDepth colorDepth)
-: mGraphics(nullptr),
-  mWindowBase(nullptr),
-  mWindowRotationTrigger(),
-  mLogFactory(Dali::Adaptor::Get().GetLogFactory()),
-  mTraceFactory(Dali::Adaptor::Get().GetTraceFactory()),
-  mPositionSize(positionSize),
-  mColorDepth(colorDepth),
-  mGLInitCallback(),
-  mGLRenderFrameCallback(),
-  mGLTerminateCallback(),
-  mEGLSurface(nullptr),
-  mEGLContext(nullptr),
-  mDepth(false),
-  mStencil(false),
-  mIsEGLInitialize(false),
-  mGLESVersion(30), //Default GLES version 30
-  mMSAA(0),
-  mWindowRotationAngle(0),
-  mScreenRotationAngle(0),
-  mRenderThreadWaitCondition(),
-  mDestroyRenderThread(0),
-  mPauseRenderThread(0),
-  mRenderingMode(0),
-  mRequestRenderOnce(0),
-  mSurfaceStatus(0),
-  mPostRendering(0),
-  mDefaultFrameDurationNanoseconds(REFRESH_RATE * DEFAULT_FRAME_DURATION_IN_NANOSECONDS)
-{
-}
-
-GlWindowRenderThread::~GlWindowRenderThread()
-{
-}
-
-void GlWindowRenderThread::SetGraphicsInterface(Graphics::GraphicsInterface* graphics)
-{
-  mGraphics = graphics;
-}
-
-void GlWindowRenderThread::SetWindowBase(WindowBase* windowBase)
-{
-  mWindowBase = windowBase;
-}
-
-void GlWindowRenderThread::SetGraphicsConfig(bool depth, bool stencil, int msaa, int version)
-{
-  mDepth       = depth;
-  mStencil     = stencil;
-  mMSAA        = msaa;
-  mGLESVersion = version;
-}
-
-void GlWindowRenderThread::Pause()
-{
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-  mPauseRenderThread = 1;
-  DALI_LOG_RELEASE_INFO("GlWindowRenderThread::Pause()\n");
-}
-
-void GlWindowRenderThread::Resume()
-{
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-  mPauseRenderThread = 0;
-  DALI_LOG_RELEASE_INFO("GlWindowRenderThread::Resume()\n");
-  mRenderThreadWaitCondition.Notify(lock);
-}
-
-void GlWindowRenderThread::Stop()
-{
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-  mDestroyRenderThread = 1;
-  DALI_LOG_RELEASE_INFO("GlWindowRenderThread::Stop()\n");
-  mRenderThreadWaitCondition.Notify(lock);
-}
-
-void GlWindowRenderThread::RegisterGlCallbacks(CallbackBase* initCallback,
-                                               CallbackBase* renderFrameCallback,
-                                               CallbackBase* terminateCallback)
-{
-  mGLInitCallback        = std::unique_ptr<CallbackBase>(initCallback);
-  mGLRenderFrameCallback = std::unique_ptr<CallbackBase>(renderFrameCallback);
-  mGLTerminateCallback   = std::unique_ptr<CallbackBase>(terminateCallback);
-}
-
-void GlWindowRenderThread::SetOnDemandRenderMode(bool onDemand)
-{
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-  mRenderingMode = static_cast<unsigned int>(onDemand);
-  DALI_LOG_RELEASE_INFO("GlWindowRenderThread::SetOnDemandRenderMode(): mRenderingMode: %d\n", mRenderingMode);
-  if(!onDemand)
-  {
-    mRenderThreadWaitCondition.Notify(lock);
-  }
-}
-
-void GlWindowRenderThread::RenderOnce()
-{
-  // Most of all, this function is called in event thread
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-  mRequestRenderOnce = 1;
-  mRenderThreadWaitCondition.Notify(lock);
-}
-
-void GlWindowRenderThread::RequestWindowResize(int width, int height)
-{
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-  // Check resizing
-  if((fabs(width - mPositionSize.width) > MINIMUM_DIMENSION_CHANGE) ||
-     (fabs(height - mPositionSize.height) > MINIMUM_DIMENSION_CHANGE))
-  {
-    mSurfaceStatus |= static_cast<unsigned int>(SurfaceStatus::RESIZED); // Set bit for window resized
-    mPositionSize.width  = width;
-    mPositionSize.height = height;
-
-    DALI_LOG_RELEASE_INFO("GlWindowRenderThread::RequestWindowResize(), width:%d, height:%d\n", width, height);
-    mRenderThreadWaitCondition.Notify(lock);
-  }
-}
-
-void GlWindowRenderThread::RequestWindowRotate(int windowAngle)
-{
-  if(!mWindowRotationTrigger)
-  {
-    mWindowRotationTrigger = std::unique_ptr<TriggerEventInterface>(TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &GlWindowRenderThread::WindowRotationCompleted),
-                                                                                                            TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
-  }
-
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-  if(mWindowRotationAngle != windowAngle)
-  {
-    mSurfaceStatus |= static_cast<unsigned int>(SurfaceStatus::WINDOW_ROTATED); // Set bit for window rotation
-    mWindowRotationAngle = windowAngle;
-    DALI_LOG_RELEASE_INFO("GlWindowRenderThread::RequestWindowRotate(): %d\n", windowAngle);
-    mRenderThreadWaitCondition.Notify(lock);
-  }
-}
-
-void GlWindowRenderThread::RequestScreenRotate(int screenAngle)
-{
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-  if(mScreenRotationAngle != screenAngle)
-  {
-    mSurfaceStatus |= static_cast<unsigned int>(SurfaceStatus::SCREEN_ROTATED); // Set bit for screen rotation
-    mScreenRotationAngle = screenAngle;
-    DALI_LOG_RELEASE_INFO("GlWindowRenderThread::RequestScreenRotate(): %d\n", screenAngle);
-    mRenderThreadWaitCondition.Notify(lock);
-  }
-}
-
-void GlWindowRenderThread::WindowRotationCompleted()
-{
-  mWindowBase->WindowRotationCompleted(mWindowRotationAngle, mPositionSize.width, mPositionSize.height);
-
-  PostRenderFinish();
-}
-
-unsigned int GlWindowRenderThread::GetSurfaceStatus(int& windowRotationAngle, int& screenRotationAngle)
-{
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-
-  // Get the surface status and reset that.
-  unsigned int status = mSurfaceStatus;
-  mSurfaceStatus      = static_cast<unsigned int>(SurfaceStatus::NO_CHANGED);
-
-  windowRotationAngle = mWindowRotationAngle;
-  screenRotationAngle = mScreenRotationAngle;
-
-  return status;
-}
-
-void GlWindowRenderThread::Run()
-{
-  Dali::SetThreadName("GlWindowRenderThread");
-  mLogFactory.InstallLogFunction();
-  mTraceFactory.InstallTraceFunction();
-
-  int          renderFrameResult = 0;
-  unsigned int isSurfaceChanged  = 0;
-  bool         isWindowResized = false, isWindowRotated = false, isScreenRotated = false;
-  int          windowRotationAngle = 0, screenRotationAngle = 0, totalAngle = 0;
-  EglGraphics* eglGraphics = static_cast<EglGraphics*>(mGraphics);
-
-  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-
-  InitializeGraphics(eglGraphics);
-
-  eglImpl.MakeContextCurrent(mEGLSurface, mEGLContext);
-
-  if(mGLInitCallback)
-  {
-    CallbackBase::Execute(*mGLInitCallback);
-  }
-
-  uint64_t timeToSleepUntil = 0;
-
-  while(RenderReady(timeToSleepUntil))
-  {
-    uint64_t currentFrameStartTime = 0;
-    TimeService::GetNanoseconds(currentFrameStartTime);
-
-    if(mGLRenderFrameCallback)
-    {
-      // PreRender
-      isSurfaceChanged = GetSurfaceStatus(windowRotationAngle, screenRotationAngle);
-      if(DALI_UNLIKELY(isSurfaceChanged))
-      {
-        isWindowResized = (isSurfaceChanged & static_cast<unsigned int>(SurfaceStatus::RESIZED)) ? true : false;
-        isWindowRotated = (isSurfaceChanged & static_cast<unsigned int>(SurfaceStatus::WINDOW_ROTATED)) ? true : false;
-        isScreenRotated = (isSurfaceChanged & static_cast<unsigned int>(SurfaceStatus::SCREEN_ROTATED)) ? true : false;
-        totalAngle      = (windowRotationAngle + screenRotationAngle) % 360;
-
-        if(isWindowRotated || isScreenRotated)
-        {
-          mWindowBase->SetWindowBufferTransform(totalAngle);
-          if(isWindowRotated)
-          {
-            mWindowBase->SetWindowTransform(windowRotationAngle);
-          }
-        }
-
-        if(isWindowResized)
-        {
-          Dali::PositionSize positionSize;
-          positionSize.x = mPositionSize.x;
-          positionSize.y = mPositionSize.y;
-          if(totalAngle == 0 || totalAngle == 180)
-          {
-            positionSize.width  = mPositionSize.width;
-            positionSize.height = mPositionSize.height;
-          }
-          else
-          {
-            positionSize.width  = mPositionSize.height;
-            positionSize.height = mPositionSize.width;
-          }
-          mWindowBase->ResizeWindow(positionSize);
-        }
-      }
-
-      // Render
-      renderFrameResult = CallbackBase::ExecuteReturn<int>(*mGLRenderFrameCallback);
-
-      // PostRender
-      if(DALI_UNLIKELY(isWindowRotated))
-      {
-        PostRenderStart();
-
-        mWindowRotationTrigger->Trigger();
-
-        PostRenderWaitForFinished();
-        isWindowRotated = false;
-      }
-
-      // buffer commit
-      if(renderFrameResult)
-      {
-        eglImpl.SwapBuffers(mEGLSurface);
-      }
-    }
-    renderFrameResult = 0;
-
-    if(timeToSleepUntil == 0)
-    {
-      timeToSleepUntil = currentFrameStartTime + mDefaultFrameDurationNanoseconds;
-    }
-    else
-    {
-      timeToSleepUntil += mDefaultFrameDurationNanoseconds;
-      uint64_t currentFrameEndTime = 0;
-      TimeService::GetNanoseconds(currentFrameEndTime);
-      while(currentFrameEndTime > timeToSleepUntil + mDefaultFrameDurationNanoseconds)
-      {
-        timeToSleepUntil += mDefaultFrameDurationNanoseconds;
-      }
-    }
-
-    TimeService::SleepUntil(timeToSleepUntil);
-  }
-
-  if(mGLTerminateCallback)
-  {
-    CallbackBase::Execute(*mGLTerminateCallback);
-  }
-
-  if(mIsEGLInitialize)
-  {
-    EglGraphics*                          eglGraphics = static_cast<EglGraphics*>(mGraphics);
-    Internal::Adaptor::EglImplementation& eglImpl     = eglGraphics->GetEglImplementation();
-
-    if(mEGLSurface)
-    {
-      eglImpl.DestroySurface(mEGLSurface);
-      mEGLSurface = nullptr;
-    }
-
-    if(mEGLContext)
-    {
-      eglImpl.DestroyContext(mEGLContext);
-      mEGLContext = nullptr;
-    }
-
-    eglImpl.TerminateGles();
-  }
-}
-
-void GlWindowRenderThread::InitializeGraphics(EglGraphics* eglGraphics)
-{
-  mIsEGLInitialize = true;
-
-  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-  eglImpl.SetGlesVersion(mGLESVersion);
-
-  if(eglImpl.ChooseConfig(true, mColorDepth) == false)
-  {
-    if(mGLESVersion == 30)
-    {
-      DALI_LOG_RELEASE_INFO("InitializeGraphics: Fail to choose config with GLES30, retry with GLES20\n");
-      eglImpl.SetGlesVersion(20);
-      mGLESVersion = 20;
-      if(eglImpl.ChooseConfig(true, mColorDepth) == false)
-      {
-        DALI_LOG_ERROR("InitializeGraphics: Fail to choose config with GLES20");
-        return;
-      }
-    }
-    else
-    {
-      DALI_LOG_ERROR("InitializeGraphics: Fail to choose config with GLES20");
-      return;
-    }
-  }
-  eglImpl.CreateWindowContext(mEGLContext);
-
-  // Create the EGL window
-  Dali::Any window = mWindowBase->CreateWindow(mPositionSize.width, mPositionSize.height);
-  mEGLSurface      = eglImpl.CreateSurfaceWindow(reinterpret_cast<EGLNativeWindowType>(window.Get<void*>()), mColorDepth);
-}
-
-bool GlWindowRenderThread::RenderReady(uint64_t& timeToSleepUntil)
-{
-  ConditionalWait::ScopedLock updateLock(mRenderThreadWaitCondition);
-  while((!mDestroyRenderThread && mRenderingMode && !mRequestRenderOnce && !mSurfaceStatus) || mPauseRenderThread)
-  {
-    timeToSleepUntil = 0;
-    mRenderThreadWaitCondition.Wait(updateLock);
-  }
-
-  mRequestRenderOnce = 0;
-  // Keep the update-render thread alive if this thread is NOT to be destroyed
-  return !mDestroyRenderThread;
-}
-
-void GlWindowRenderThread::PostRenderStart()
-{
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-  mPostRendering = false;
-}
-
-void GlWindowRenderThread::PostRenderFinish()
-{
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-  mPostRendering = true;
-  mRenderThreadWaitCondition.Notify(lock);
-}
-
-void GlWindowRenderThread::PostRenderWaitForFinished()
-{
-  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
-  while(!mPostRendering && !mDestroyRenderThread)
-  {
-    mRenderThreadWaitCondition.Wait(lock);
-  }
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
diff --git a/dali/internal/window-system/common/gl-window-render-thread.h b/dali/internal/window-system/common/gl-window-render-thread.h
deleted file mode 100644 (file)
index 886cfad..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-#ifndef DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_RENDER_THREAD_H
-#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_RENDER_THREAD_H
-
-/*
- * 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.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <dali/devel-api/threading/conditional-wait.h>
-#include <dali/devel-api/threading/thread.h>
-#include <dali/integration-api/adaptor-framework/log-factory-interface.h>
-#include <dali/integration-api/adaptor-framework/trace-factory-interface.h>
-
-// INTERNAL INCLUDES
-#include <dali/internal/graphics/gles/egl-graphics.h>
-#include <dali/internal/window-system/common/window-base.h>
-
-namespace Dali
-{
-class Adaptor;
-class TriggerEventInterface;
-
-namespace Internal
-{
-namespace Adaptor
-{
-class WindowBase;
-class GlWindow;
-
-/**
- * @brief It is for render thread for GlWindow.
- * User callbacks works in the thread.
- *
- * Key Points:
- *  1. Two Threads:
- *    a. Main/Event Thread.
- *    b. Render Thread.
- *  2. There is NO VSync thread:
- *    a. We calculate the difference between these two times and if:
- *      i.  The difference is less than the default frame time, we sleep.
- *      ii. If it’s more or the same, we continue.
- *  3. Support Rendering mode
- *    a. CONTINUOUS mode
- *      i. The rendering loop works continuously.
- *    b. ON_DEMAND mode
- *      i. The rendering works by user's request.
- *      ii. User's request is the renderOnce()'s function calling.
- */
-
-class GlWindowRenderThread : public Dali::Thread
-{
-public:
-  /**
-   * @brief Enumeration for GlWindow Surface status type
-   * It has the status as resized, window is rotated and screen is rotated.
-   *
-   */
-  enum class SurfaceStatus
-  {
-    NO_CHANGED     = 0x00, ///< no changed,
-    RESIZED        = 0x01, ///< When surface is resized,
-    WINDOW_ROTATED = 0x02, ///< When window is rotated,
-    SCREEN_ROTATED = 0x04  ///< When screen is rotated,
-  };
-
-  /**
-   * Constructor
-   *
-   * @param[in] positionSize The position and size of the physical window
-   * @param[in] depth color depth of the physical window
-   */
-  GlWindowRenderThread(PositionSize positionSize, ColorDepth colorDepth);
-
-  /**
-   * destructor.
-   */
-  virtual ~GlWindowRenderThread();
-
-  /**
-   * Sets the GraphicsInterface instance.
-   * This graphics instance is used to create and initialize graphics resource
-   *
-   * @param[in]  graphics           The graphice instance
-   */
-  void SetGraphicsInterface(Graphics::GraphicsInterface* graphics);
-
-  /**
-   * Sets the WindowBase instance
-   * This WindowBase instance is used to call wl egl window APIs.
-   *
-   * @param[in]  windowBase           The WindowBase instance
-   */
-  void SetWindowBase(WindowBase* windowBase);
-
-  /**
-   * @brief Sets graphics configuration for GlWindow
-   *
-   * @param[in] depth the flag of depth buffer. If true is set, 24bit depth buffer is enabled.
-   * @param[in] stencil the flag of stencil. it true is set, 8bit stencil buffer is enabled.
-   * @param[in] msaa the bit of msaa.
-   * @param[in] version the GLES version.
-   *
-   */
-  void SetGraphicsConfig(bool depth, bool stencil, int msaa, int version);
-
-  /**
-   * Pauses the Render Thread.
-   * It is called when GlWindow is iconified or hidden.
-   *
-   * This will lock the mutex in mRenderThreadWaitCondition.
-   */
-  void Pause();
-
-  /**
-   * Resumes the Render Thread.
-   * It is called when GlWindow is de-iconified or shown.
-   *
-   * This will lock the mutex in mRenderThreadWaitCondition.
-   */
-  void Resume();
-
-  /**
-   * Stops the Render Thread.
-   * This will lock the mutex in mRenderThreadWaitCondition.
-   *
-   * @note Should only be called in Stop as calling this will kill the render thread.
-   */
-  void Stop();
-
-  /**
-   * @copydoc Dali::GlWindow::RegisterGlCallbacks()
-   */
-  void RegisterGlCallbacks(CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback);
-
-  /**
-   * Enable OnDemand Rendering Mode
-   *
-   * @param[in] onDemand the flag of OnDemand Rendering Mode. If the flag is true, rendering mode is OnDemand, otherwise the flag is false, rendering mode is continuous mode.
-   */
-  void SetOnDemandRenderMode(bool onDemand);
-
-  /**
-   * @copydoc Dali::GlWindow::RenderOnce()
-   */
-  void RenderOnce();
-
-  /**
-   * Requests the window resize to GlWindow's render thread.
-   *
-   * @param[in] width new width.
-   * @param[in] height new height.
-   */
-  void RequestWindowResize(int width, int height);
-
-  /**
-   * Requests the window rotation to GlWindow's render thread.
-   *
-   * @param[in] windowAngle the window rotation's angle as 0, 90, 180 and 270.
-   */
-  void RequestWindowRotate(int windowAngle);
-
-  /**
-   * Requests the screen rotation to GlWindow's render thread.
-   *
-   * @param[in] screenAngle the screen rotation's angle as 0, 90, 180 and 270.
-   */
-  void RequestScreenRotate(int screenAngle);
-
-protected:
-  /**
-   * The Render thread loop. This thread will be destroyed on exit from this function.
-   */
-  virtual void Run();
-
-private:
-  /**
-   * @brief Initialize and create EGL resource
-   */
-  void InitializeGraphics(EglGraphics* eglGraphics);
-
-  /**
-   * Called by the Render Thread which ensures a wait if required.
-   *
-   * @param[out] timeToSleepUntil  The time remaining in nanoseconds to keep the thread sleeping before resuming.
-   * @return false, if the thread should stop.
-   */
-  bool RenderReady(uint64_t& timeToSleepUntil);
-
-  /**
-   * In the Tizen world, when GlWindow rotation is finished in client side,
-   * the completed message should be sent to display server.
-   * This function should be called in the event thread after buffer is committed.
-   */
-  void WindowRotationCompleted();
-
-  /**
-   * Gets window's current surface status
-   *
-   * @brief This function return window's current surface status.
-   * The status has the  the information of window resized, window rotated and screen rotated.
-   * After called, the status value is reset
-   *
-   * @[output] windowRotationAngle return current window rotation angle.
-   * @[output] screenRotationAngle return current screen rotation angle.
-   * @return the window's current surface status.
-   */
-  unsigned int GetSurfaceStatus(int& windowRotationAngle, int& screenRotationAngle);
-
-  /**
-   * Starts post rendering process
-   *
-   * @brief Starts post rendering process for window rotation
-   * It is to pause the render thread until maint thread finishes the window rotation work.
-   */
-  void PostRenderStart();
-
-  /**
-   * Finishs post rendering process
-   *
-   * @brief Finishes post rendering process for window rotation
-   * It set the resume flag for resume the render thread.
-   */
-  void PostRenderFinish();
-
-  /**
-   * Pauses the render thread unitil post rendering process
-   *
-   * @brief Pauses the render thread until main thread works window rotation.
-   */
-  void PostRenderWaitForFinished();
-
-private:
-  Graphics::GraphicsInterface*           mGraphics; ///< Graphics interface
-  WindowBase*                            mWindowBase;
-  std::unique_ptr<TriggerEventInterface> mWindowRotationTrigger;
-
-  const Dali::LogFactoryInterface&   mLogFactory;
-  const Dali::TraceFactoryInterface& mTraceFactory;
-
-  PositionSize mPositionSize; ///< Position
-  ColorDepth   mColorDepth;
-
-  // EGL, GL Resource
-  std::unique_ptr<CallbackBase> mGLInitCallback;
-  std::unique_ptr<CallbackBase> mGLRenderFrameCallback;
-  std::unique_ptr<CallbackBase> mGLTerminateCallback;
-  EGLSurface                    mEGLSurface;
-  EGLContext                    mEGLContext;
-  bool                          mDepth : 1;
-  bool                          mStencil : 1;
-  bool                          mIsEGLInitialize : 1;
-  int                           mGLESVersion;
-  int                           mMSAA;
-  int                           mWindowRotationAngle; ///< The angle of window rotation angle
-  int                           mScreenRotationAngle; ///< The angle of screen rotation angle
-
-  // To manage the render/main thread
-  ConditionalWait       mRenderThreadWaitCondition; ///< The wait condition for the update-render-thread.
-  volatile unsigned int mDestroyRenderThread;       ///< Stop render thread. It means this rendter thread will be destoried.
-  volatile unsigned int mPauseRenderThread;         ///< Sleep render thread by pause.
-  volatile unsigned int mRenderingMode;             ///< Rendering Mode, 0: continuous, 1:OnDemad
-  volatile unsigned int mRequestRenderOnce;         ///< Request rendering once
-  volatile unsigned int mSurfaceStatus;             ///< When surface is changed as resized or rotated, this flag is set. 0: No changed, 1:resized, 2:window rotation, 4:screen rotation
-  volatile unsigned int mPostRendering;             ///< Whether post-rendering is taking place (set by the event & render threads, read by the render-thread).
-
-  uint64_t mDefaultFrameDurationNanoseconds; ///< Default duration of a frame (used for sleeping if not enough time elapsed). Not protected by lock, but written to rarely so not worth adding a lock when reading.
-
-}; // GlWindowRenderThread
-
-} // namespace Adaptor
-} // namespace Internal
-} // namespace Dali
-
-#endif
diff --git a/dali/internal/window-system/common/native-image-surface-factory-dynamic.cpp b/dali/internal/window-system/common/native-image-surface-factory-dynamic.cpp
new file mode 100644 (file)
index 0000000..65d43c6
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/common/native-image-surface-factory.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-library.h>
+#include <dali/internal/window-system/common/native-image-surface-impl.h>
+
+namespace Dali::Internal::Adaptor
+{
+__attribute__((weak)) std::unique_ptr<Dali::Internal::Adaptor::NativeImageSurface> NativeImageSurfaceFactory::CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr queue)
+{
+  return GraphicsLibrary::CreateNativeImageSurface(queue);
+}
+} // namespace Dali::Internal::Adaptor
index 1e6eb50d0d737a69471a18d8312226cfe3d6c486..27367121905d737c9a8726501251b6b781c0ffa0 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_NATIVE_IMAGE_SURFACE_FACTORY_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -38,8 +38,10 @@ public:
    *
    * @param [in] queue the native image surface handle
    * @return A pointer to a newly allocated surface
+   *
+   * Needs exporting as it's called by one of the the other libraries
    */
-  static std::unique_ptr<Dali::Internal::Adaptor::NativeImageSurface> CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr queue);
+  static DALI_ADAPTOR_API std::unique_ptr<Dali::Internal::Adaptor::NativeImageSurface> CreateNativeImageSurface(Dali::NativeImageSourceQueuePtr queue);
 };
 
 } // namespace Adaptor
diff --git a/dali/internal/window-system/common/render-surface-factory-dynamic.cpp b/dali/internal/window-system/common/render-surface-factory-dynamic.cpp
new file mode 100644 (file)
index 0000000..8e403fe
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL HEADERS
+#include <dali/internal/graphics/common/graphics-library.h>
+#include <dali/internal/window-system/common/render-surface-factory.h>
+
+namespace Dali::Internal::Adaptor
+{
+__attribute__((weak)) std::unique_ptr<RenderSurfaceFactory> GetRenderSurfaceFactory()
+{
+  return GraphicsLibrary::GetRenderSurfaceFactory();
+}
+} // namespace Dali::Internal::Adaptor
index 5afb0848aaeca3ba158dae43d94d80f60d85369e..7b5cbddf666a2ad3c36a10e61eb385d13ea5397c 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_BASE_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -44,8 +44,10 @@ namespace Adaptor
 {
 /**
  * WindowBase interface
+ *
+ * Needs exporting as it's used by the GlWindow library
  */
-class WindowBase
+class DALI_ADAPTOR_API WindowBase
 {
 public:
   /**
index 023dd39effc0b98f2a45cc73510e3f66b02bbd6c..0b329655053f21e458babe722c74d03b4fb2394e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_FACTORY_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -42,7 +42,8 @@ public:
   virtual std::unique_ptr<WindowBase> CreateWindowBase(Dali::PositionSize positionSize, Any surface, bool isTransparent) = 0;
 };
 
-extern std::unique_ptr<WindowFactory> GetWindowFactory();
+// Needs exporting as it's called directly by the GlWindow library
+extern DALI_ADAPTOR_API std::unique_ptr<WindowFactory> GetWindowFactory();
 
 } // namespace Adaptor
 } // namespace Internal
index 006b7a959cee5995e8166ff0304defdb0c8f1458..4af56add4a9ed062a7a7d3ea962396ef2cf16649 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -128,8 +128,10 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std
 {
   // Create a window render surface
   auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
-  mSurface                  = renderSurfaceFactory->CreateWindowRenderSurface(positionSize, surface, mIsTransparent);
-  mWindowSurface            = static_cast<WindowRenderSurface*>(mSurface.get());
+  DALI_ASSERT_DEBUG(renderSurfaceFactory && "Cannot create render surface factory\n");
+
+  mSurface       = renderSurfaceFactory->CreateWindowRenderSurface(positionSize, surface, mIsTransparent);
+  mWindowSurface = static_cast<WindowRenderSurface*>(mSurface.get());
 
   // Get a window base
   mWindowBase = mWindowSurface->GetWindowBase();
index e39ba17be381d329dafb8d0979146d3a5f1788cc..4d21716b3d857c6beefe5e5296f8bfc8e601187f 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_RENDER_SURFACE_H
 
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -44,10 +44,12 @@ class AdaptorInternalServices;
 
 /**
  * Window interface of render surface.
+ *
+ * Needs exporting as it's called by the Graphics Libraries
  */
-class WindowRenderSurface : public Dali::Integration::RenderSurfaceInterface,
-                            public ConnectionTracker,
-                            public Graphics::NativeWindowInterface
+class DALI_ADAPTOR_API WindowRenderSurface : public Dali::Integration::RenderSurfaceInterface,
+                                             public ConnectionTracker,
+                                             public Graphics::NativeWindowInterface
 {
 public:
   using RotationFinishedSignalType = Signal<void()>; ///<The signal of window rotation's finished.
index a1a10d68e53ae5ca1a912244949a476acecc2851..f8edbd5533f03301277383ac45b4793c1141330e 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOW_SYSTEM_COMMON_WINDOW_SYSTEM_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -22,6 +22,9 @@
 #include <dali/public-api/object/any.h>
 #include <cstdint>
 
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
+
 namespace Dali
 {
 namespace Internal
@@ -60,8 +63,10 @@ void GetDpi(uint32_t& dpiHorizontal, uint32_t& dpiVertical);
 
 /**
  * @brief Get the screen size
+ *
+ * Needs exporting as it's called directly by the GlWindow library
  */
-void GetScreenSize(int32_t& width, int32_t& height);
+void DALI_ADAPTOR_API GetScreenSize(int32_t& width, int32_t& height);
 
 /**
  * @brief Update the screen size
index 78566198007605a006ac29febb25c2adbc8acb96..a2ab20a6213c069d58ff4acc14f8313a72b2b47f 100644 (file)
@@ -11,9 +11,16 @@ SET( adaptor_window_system_common_src_files
     ${adaptor_window_system_dir}/common/window-system.cpp
 )
 
-SET( adaptor_window_system_common_egl_src_files
-    ${adaptor_window_system_dir}/common/gl-window-impl.cpp
-    ${adaptor_window_system_dir}/common/gl-window-render-thread.cpp
+SET( adaptor_window_system_gl_window_src_files
+    ${adaptor_window_system_dir}/gl-window/gl-window-addon.cpp
+    ${adaptor_window_system_dir}/gl-window/gl-window-impl.cpp
+    ${adaptor_window_system_dir}/gl-window/gl-window-render-thread.cpp
+)
+
+# module: window-system, backend: common/dynamic
+SET( adaptor_window_system_common_dynamic_src_files
+    ${adaptor_window_system_dir}/common/native-image-surface-factory-dynamic.cpp
+    ${adaptor_window_system_dir}/common/render-surface-factory-dynamic.cpp
 )
 
 # module: window-system, backend: tizen-wayland
@@ -41,7 +48,17 @@ SET( adaptor_window_system_tizen_wayland_vulkan_src_files
     ${adaptor_window_system_dir}/tizen-wayland/ecore-wl2/render-surface-factory-ecore-wl2-vulkan.cpp
 )
 
-# module: window-system, backend: libuv-x11
+# module: window-system, backend: tizen-wayland/dynamic
+SET( adaptor_window_system_tizen_wayland_dynamic_src_files
+    ${adaptor_window_system_dir}/tizen-wayland/display-connection-native-types-dynamic.cpp
+)
+
+# module: window-system, backend: tizen-wayland/graphics-library
+SET( adaptor_window_system_tizen_wayland_graphics_library_src_files
+    ${adaptor_window_system_dir}/tizen-wayland/graphics-library-functions-tizen-wayland.cpp
+)
+
+# module: window-system, backend: x11
 SET( adaptor_window_system_x11_src_files
     ${adaptor_window_system_dir}/x11/display-connection-factory-x.cpp
     ${adaptor_window_system_dir}/x11/display-connection-impl-x.cpp
@@ -52,19 +69,29 @@ SET( adaptor_window_system_x11_src_files
     ${adaptor_window_system_dir}/x11/window-system-x.cpp
 )
 
-# module: window-system, backend: libuv-x11/egl
+# module: window-system, backend: x11/egl
 SET( adaptor_window_system_x11_egl_src_files
     ${adaptor_window_system_dir}/x11/display-connection-native-types-egl.cpp
     ${adaptor_window_system_dir}/x11/pixmap-render-surface-x.cpp
     ${adaptor_window_system_dir}/x11/render-surface-factory-x-egl.cpp
 )
 
-# module: window-system, backend: libuv-x11/vulkan
+# module: window-system, backend: x11/vulkan
 SET( adaptor_window_system_x11_vulkan_src_files
     ${adaptor_window_system_dir}/x11/display-connection-native-types-vulkan.cpp
     ${adaptor_window_system_dir}/x11/render-surface-factory-x-vulkan.cpp
 )
 
+# module: window-system, backend: x11/dynamic
+SET( adaptor_window_system_x11_dynamic_src_files
+    ${adaptor_window_system_dir}/x11/display-connection-native-types-dynamic.cpp
+)
+
+# module: window-system, backend: x11/graphics-library
+SET( adaptor_window_system_x11_graphics_library_src_files
+    ${adaptor_window_system_dir}/x11/graphics-library-functions-x11.cpp
+)
+
 # module: window-system, backend: ubuntu-x11
 SET( adaptor_window_system_ubuntu_x11_src_files
     ${adaptor_window_system_dir}/ubuntu-x11/display-connection-factory-x.cpp
@@ -90,6 +117,16 @@ SET( adaptor_window_system_ubuntu_x11_vulkan_src_files
     ${adaptor_window_system_dir}/ubuntu-x11/render-surface-factory-ecore-x-vulkan.cpp
 )
 
+# module: window-system, backend: ubuntu-x11/dynamic
+SET( adaptor_window_system_ubuntu_x11_dynamic_src_files
+    ${adaptor_window_system_dir}/ubuntu-x11/display-connection-native-types-dynamic.cpp
+)
+
+# module: window-system, backend: ubuntu-x11/graphics-library
+SET( adaptor_window_system_ubuntu_x11_graphics_library_src_files
+    ${adaptor_window_system_dir}/ubuntu-x11/graphics-library-functions-ubuntu-x11.cpp
+)
+
 # module: window-system, backend: android
 SET( adaptor_window_system_android_src_files
     ${adaptor_window_system_dir}/android/display-connection-factory-android.cpp
diff --git a/dali/internal/window-system/gl-window/gl-window-addon.cpp b/dali/internal/window-system/gl-window/gl-window-addon.cpp
new file mode 100644 (file)
index 0000000..7ddbce7
--- /dev/null
@@ -0,0 +1,273 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/addons/addon-base.h>
+#include <dali/integration-api/debug.h>
+#include <string>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/gl-window.h>
+#include <dali/devel-api/common/addon-binder.h>
+#include <dali/internal/window-system/gl-window/gl-window-impl.h>
+#include <dali/public-api/adaptor-framework/window.h>
+
+using namespace Dali;
+using GlWindowImpl = Internal::Adaptor::GlWindow;
+
+namespace
+{
+const char* const DALI_ADAPTOR_GL_WINDOW_ADDON_NAME("AdaptorGlWindowAddOn");
+
+GlWindow
+GlWindowNew(PositionSize positionSize, const std::string& name, const std::string& className, bool isTransparent)
+{
+  GlWindow                     newWindow;
+  Internal::Adaptor::GlWindow* window = Internal::Adaptor::GlWindow::New(positionSize, name, className, isTransparent);
+  newWindow                           = GlWindow(window);
+
+  const bool isAdaptorAvailable = Dali::Adaptor::IsAvailable();
+  if(isAdaptorAvailable)
+  {
+    Dali::Adaptor&        adaptor = Internal::Adaptor::Adaptor::Get();
+    Dali::WindowContainer windows = adaptor.GetWindows();
+    if(!windows.empty())
+    {
+      window->SetChild(windows[0]);
+    }
+  }
+  return newWindow;
+}
+
+void GlWindowSetGraphicsConfig(GlWindowImpl& glWindowImpl, bool depth, bool stencil, int msaa, GlWindow::GlesVersion version)
+{
+  glWindowImpl.SetGraphicsConfig(depth, stencil, msaa, version);
+}
+
+void GlWindowRaise(GlWindowImpl& glWindowImpl)
+{
+  glWindowImpl.Raise();
+}
+
+void GlWindowLower(GlWindowImpl& glWindowImpl)
+{
+  glWindowImpl.Lower();
+}
+
+void GlWindowActivate(GlWindowImpl& glWindowImpl)
+{
+  glWindowImpl.Activate();
+}
+
+void GlWindowShow(GlWindowImpl& glWindowImpl)
+{
+  glWindowImpl.Show();
+}
+
+void GlWindowHide(GlWindowImpl& glWindowImpl)
+{
+  glWindowImpl.Hide();
+}
+
+unsigned int GlWindowGetSupportedAuxiliaryHintCount(const GlWindowImpl& glWindowImpl)
+{
+  return glWindowImpl.GetSupportedAuxiliaryHintCount();
+}
+
+std::string GlWindowGetSupportedAuxiliaryHint(const GlWindowImpl& glWindowImpl, unsigned int index)
+{
+  return glWindowImpl.GetSupportedAuxiliaryHint(index);
+}
+
+unsigned int GlWindowAddAuxiliaryHint(GlWindowImpl& glWindowImpl, const std::string& hint, const std::string& value)
+{
+  return glWindowImpl.AddAuxiliaryHint(hint, value);
+}
+
+bool GlWindowRemoveAuxiliaryHint(GlWindowImpl& glWindowImpl, unsigned int id)
+{
+  return glWindowImpl.RemoveAuxiliaryHint(id);
+}
+
+bool GlWindowSetAuxiliaryHintValue(GlWindowImpl& glWindowImpl, unsigned int id, const std::string& value)
+{
+  return glWindowImpl.SetAuxiliaryHintValue(id, value);
+}
+
+std::string GlWindowGetAuxiliaryHintValue(const GlWindowImpl& glWindowImpl, unsigned int id)
+{
+  return glWindowImpl.GetAuxiliaryHintValue(id);
+}
+
+unsigned int GlWindowGetAuxiliaryHintId(const GlWindowImpl& glWindowImpl, const std::string& hint)
+{
+  return glWindowImpl.GetAuxiliaryHintId(hint);
+}
+
+void GlWindowSetInputRegion(GlWindowImpl& glWindowImpl, const Rect<int>& inputRegion)
+{
+  glWindowImpl.SetInputRegion(inputRegion);
+}
+
+void GlWindowSetOpaqueState(GlWindowImpl& glWindowImpl, bool opaque)
+{
+  glWindowImpl.SetOpaqueState(opaque);
+}
+
+bool GlWindowIsOpaqueState(const GlWindowImpl& glWindowImpl)
+{
+  return glWindowImpl.IsOpaqueState();
+}
+
+void GlWindowSetPositionSize(GlWindowImpl& glWindowImpl, PositionSize positionSize)
+{
+  glWindowImpl.SetPositionSize(positionSize);
+}
+
+PositionSize GlWindowGetPositionSize(const GlWindowImpl& glWindowImpl)
+{
+  return glWindowImpl.GetPositionSize();
+}
+
+WindowOrientation GlWindowGetCurrentOrientation(const GlWindowImpl& glWindowImpl)
+{
+  return glWindowImpl.GetCurrentOrientation();
+}
+
+void GlWindowSetAvailableOrientations(GlWindowImpl& glWindowImpl, const Dali::Vector<WindowOrientation>& orientations)
+{
+  glWindowImpl.SetAvailableOrientations(orientations);
+}
+
+void GlWindowSetPreferredOrientation(GlWindowImpl& glWindowImpl, WindowOrientation orientation)
+{
+  glWindowImpl.SetPreferredOrientation(orientation);
+}
+
+void GlWindowRegisterGlCallbacks(GlWindowImpl& glWindowImpl, CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback)
+{
+  glWindowImpl.RegisterGlCallbacks(initCallback, renderFrameCallback, terminateCallback);
+}
+
+void GlWindowRenderOnce(GlWindowImpl& glWindowImpl)
+{
+  glWindowImpl.RenderOnce();
+}
+
+void GlWindowSetRenderingMode(GlWindowImpl& glWindowImpl, GlWindow::RenderingMode mode)
+{
+  glWindowImpl.SetRenderingMode(mode);
+}
+
+GlWindow::RenderingMode GlWindowGetRenderingMode(const GlWindowImpl& glWindowImpl)
+{
+  return glWindowImpl.GetRenderingMode();
+}
+
+GlWindow::FocusChangeSignalType& GlWindowFocusChangeSignal(GlWindowImpl& glWindowImpl)
+{
+  return glWindowImpl.FocusChangeSignal();
+}
+
+GlWindow::ResizeSignalType& GlWindowResizeSignal(GlWindowImpl& glWindowImpl)
+{
+  return glWindowImpl.ResizeSignal();
+}
+
+GlWindow::KeyEventSignalType& GlWindowKeyEventSignal(GlWindowImpl& glWindowImpl)
+{
+  return glWindowImpl.KeyEventSignal();
+}
+
+GlWindow::TouchEventSignalType& GlWindowTouchedSignal(GlWindowImpl& glWindowImpl)
+{
+  return glWindowImpl.TouchedSignal();
+}
+
+GlWindow::VisibilityChangedSignalType& GlWindowVisibilityChangedSignal(GlWindowImpl& glWindowImpl)
+{
+  return glWindowImpl.VisibilityChangedSignal();
+}
+
+} // unnamed namespace
+
+class AdaptorGlWindowAddOn : public Dali::AddOns::AddOnBase
+{
+public:
+  void GetAddOnInfo(Dali::AddOnInfo& info) override
+  {
+    info.type    = Dali::AddOnType::GENERIC;
+    info.name    = DALI_ADAPTOR_GL_WINDOW_ADDON_NAME;
+    info.version = Dali::DALI_ADDON_VERSION(1, 0, 0);
+    info.next    = nullptr;
+  }
+
+  /**
+   * Dispatch table for global functions
+   * @return
+   */
+  Dali::AddOns::DispatchTable* GetGlobalDispatchTable() override
+  {
+    static Dali::AddOns::DispatchTable dispatchTable{};
+    if(dispatchTable.Empty())
+    {
+      dispatchTable["GlWindowNew"]                            = GlWindowNew;
+      dispatchTable["GlWindowSetGraphicsConfig"]              = GlWindowSetGraphicsConfig;
+      dispatchTable["GlWindowRaise"]                          = GlWindowRaise;
+      dispatchTable["GlWindowLower"]                          = GlWindowLower;
+      dispatchTable["GlWindowActivate"]                       = GlWindowActivate;
+      dispatchTable["GlWindowShow"]                           = GlWindowShow;
+      dispatchTable["GlWindowHide"]                           = GlWindowHide;
+      dispatchTable["GlWindowGetSupportedAuxiliaryHintCount"] = GlWindowGetSupportedAuxiliaryHintCount;
+      dispatchTable["GlWindowGetSupportedAuxiliaryHint"]      = GlWindowGetSupportedAuxiliaryHint;
+      dispatchTable["GlWindowAddAuxiliaryHint"]               = GlWindowAddAuxiliaryHint;
+      dispatchTable["GlWindowRemoveAuxiliaryHint"]            = GlWindowRemoveAuxiliaryHint;
+      dispatchTable["GlWindowSetAuxiliaryHintValue"]          = GlWindowSetAuxiliaryHintValue;
+      dispatchTable["GlWindowGetAuxiliaryHintValue"]          = GlWindowGetAuxiliaryHintValue;
+      dispatchTable["GlWindowGetAuxiliaryHintId"]             = GlWindowGetAuxiliaryHintId;
+      dispatchTable["GlWindowSetInputRegion"]                 = GlWindowSetInputRegion;
+      dispatchTable["GlWindowSetOpaqueState"]                 = GlWindowSetOpaqueState;
+      dispatchTable["GlWindowIsOpaqueState"]                  = GlWindowIsOpaqueState;
+      dispatchTable["GlWindowSetPositionSize"]                = GlWindowSetPositionSize;
+      dispatchTable["GlWindowGetPositionSize"]                = GlWindowGetPositionSize;
+      dispatchTable["GlWindowGetCurrentOrientation"]          = GlWindowGetCurrentOrientation;
+      dispatchTable["GlWindowSetAvailableOrientations"]       = GlWindowSetAvailableOrientations;
+      dispatchTable["GlWindowSetPreferredOrientation"]        = GlWindowSetPreferredOrientation;
+      dispatchTable["GlWindowRegisterGlCallbacks"]            = GlWindowRegisterGlCallbacks;
+      dispatchTable["GlWindowRenderOnce"]                     = GlWindowRenderOnce;
+      dispatchTable["GlWindowSetRenderingMode"]               = GlWindowSetRenderingMode;
+      dispatchTable["GlWindowGetRenderingMode"]               = GlWindowGetRenderingMode;
+      dispatchTable["GlWindowFocusChangeSignal"]              = GlWindowFocusChangeSignal;
+      dispatchTable["GlWindowResizeSignal"]                   = GlWindowResizeSignal;
+      dispatchTable["GlWindowKeyEventSignal"]                 = GlWindowKeyEventSignal;
+      dispatchTable["GlWindowTouchedSignal"]                  = GlWindowTouchedSignal;
+      dispatchTable["GlWindowVisibilityChangedSignal"]        = GlWindowVisibilityChangedSignal;
+    }
+    return &dispatchTable;
+  }
+
+  /**
+   * Dispatch table for instance functions
+   * @return
+   */
+  Dali::AddOns::DispatchTable* GetInstanceDispatchTable() override
+  {
+    return nullptr;
+  }
+};
+
+REGISTER_ADDON_CLASS(AdaptorGlWindowAddOn);
diff --git a/dali/internal/window-system/gl-window/gl-window-impl.cpp b/dali/internal/window-system/gl-window/gl-window-impl.cpp
new file mode 100644 (file)
index 0000000..c2787e7
--- /dev/null
@@ -0,0 +1,870 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/gl-window/gl-window-impl.h>
+
+// EXTERNAL HEADERS
+#include <dali/devel-api/adaptor-framework/gl-window.h>
+#include <dali/devel-api/adaptor-framework/orientation.h>
+#include <dali/devel-api/events/key-event-devel.h>
+#include <dali/integration-api/core.h>
+#include <dali/integration-api/events/key-event-integ.h>
+#include <dali/integration-api/events/touch-integ.h>
+
+// INTERNAL HEADERS
+#include <dali/internal/graphics/gles/egl-graphics-factory.h>
+#include <dali/internal/window-system/common/display-utils.h>
+#include <dali/internal/window-system/common/event-handler.h>
+#include <dali/internal/window-system/common/orientation-impl.h>
+#include <dali/internal/window-system/common/window-base.h>
+#include <dali/internal/window-system/common/window-factory.h>
+#include <dali/internal/window-system/common/window-impl.h>
+#include <dali/internal/window-system/common/window-render-surface.h>
+#include <dali/internal/window-system/common/window-system.h>
+#include <dali/internal/window-system/common/window-visibility-observer.h>
+#include <dali/internal/window-system/gl-window/gl-window-render-thread.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+namespace
+{
+const int MINIMUM_DIMENSION_CHANGE(1);
+
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gWindowLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_WINDOW");
+#endif
+
+} // unnamed namespace
+
+GlWindow* GlWindow::New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
+{
+  GlWindow* window       = new GlWindow();
+  window->mIsTransparent = isTransparent;
+  window->Initialize(positionSize, name, className);
+  return window;
+}
+
+GlWindow::GlWindow()
+: mWindowBase(),
+  mGraphics(),
+  mDisplayConnection(nullptr),
+  mGlWindowRenderThread(nullptr),
+  mEventHandler(nullptr),
+  mIsTransparent(false),
+  mIsFocusAcceptable(false),
+  mIconified(false),
+  mOpaqueState(false),
+  mResizeEnabled(false),
+  mVisible(false),
+  mIsWindowRotated(false),
+  mIsTouched(false),
+  mIsEGLInitialized(false),
+  mDepth(false),
+  mStencil(false),
+  mPositionSize(),
+  mAvailableAngles(),
+  mColorDepth(COLOR_DEPTH_24),
+  mRenderingMode(Dali::GlWindow::RenderingMode::CONTINUOUS),
+  mPreferredAngle(0),
+  mTotalRotationAngle(0),
+  mWindowRotationAngle(0),
+  mScreenRotationAngle(0),
+  mOrientationMode(0),
+  mWindowWidth(0),
+  mWindowHeight(0),
+  mNativeWindowId(-1),
+  mMSAA(0),
+  mKeyEventSignal(),
+  mTouchedSignal(),
+  mFocusChangeSignal(),
+  mResizeSignal(),
+  mVisibilityChangedSignal()
+{
+}
+
+GlWindow::~GlWindow()
+{
+  if(mEventHandler)
+  {
+    mEventHandler->RemoveObserver(*this);
+  }
+
+  if(mGlWindowRenderThread)
+  {
+    mGlWindowRenderThread->Stop();
+    mGlWindowRenderThread->Join();
+  }
+
+  if(mIsEGLInitialized)
+  {
+    mGraphics->Destroy();
+  }
+}
+
+void GlWindow::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
+{
+  int screenWidth, screenHeight;
+
+  mPositionSize = positionSize;
+  WindowSystem::GetScreenSize(screenWidth, screenHeight);
+  if((mPositionSize.width == 0) || (mPositionSize.height == 0))
+  {
+    mPositionSize.x      = 0;
+    mPositionSize.y      = 0;
+    mPositionSize.width  = screenWidth;
+    mPositionSize.height = screenHeight;
+  }
+
+  if(screenWidth > screenHeight)
+  {
+    mOrientationMode = 1; // Default mode is landscape
+  }
+  else
+  {
+    mOrientationMode = 0; // Default mode is portrate
+  }
+
+  // Create a window base
+  auto windowFactory = Dali::Internal::Adaptor::GetWindowFactory();
+  Any  surface;
+  mWindowBase = windowFactory->CreateWindowBase(mPositionSize, surface, (mIsTransparent ? true : false));
+  mWindowBase->IconifyChangedSignal().Connect(this, &GlWindow::OnIconifyChanged);
+  mWindowBase->FocusChangedSignal().Connect(this, &GlWindow::OnFocusChanged);
+  mWindowBase->OutputTransformedSignal().Connect(this, &GlWindow::OnOutputTransformed);
+
+  if(Dali::Adaptor::IsAvailable())
+  {
+    SetEventHandler();
+  }
+
+  if(!mPositionSize.IsEmpty())
+  {
+    AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
+    mResizeEnabled = true;
+  }
+
+  mWindowBase->Show();
+
+  if(mIsTransparent)
+  {
+    mColorDepth = COLOR_DEPTH_32;
+  }
+  else
+  {
+    mColorDepth = COLOR_DEPTH_24;
+  }
+
+  SetClass(name, className);
+
+  // For Debugging
+  mNativeWindowId = mWindowBase->GetNativeWindowId();
+}
+
+void GlWindow::SetEventHandler()
+{
+  mEventHandler = EventHandlerPtr(new EventHandler(mWindowBase.get(), *this));
+  mEventHandler->AddObserver(*this);
+}
+
+void GlWindow::SetClass(const std::string& name, const std::string className)
+{
+  mName      = name;
+  mClassName = className;
+  mWindowBase->SetClass(name, className);
+}
+
+void GlWindow::SetGraphicsConfig(bool depth, bool stencil, int msaa, Dali::GlWindow::GlesVersion version)
+{
+  // Init Graphics
+  mDepth   = depth;
+  mStencil = stencil;
+  mMSAA    = msaa;
+
+  InitializeGraphics();
+
+  int rVersion = 30;
+
+  if(version == Dali::GlWindow::GlesVersion::VERSION_2_0)
+  {
+    rVersion = 20;
+  }
+  else if(version == Dali::GlWindow::GlesVersion::VERSION_3_0)
+  {
+    rVersion = 30;
+  }
+
+  mGlWindowRenderThread->SetGraphicsConfig(depth, stencil, msaa, rVersion);
+}
+
+void GlWindow::Raise()
+{
+  mWindowBase->Raise();
+  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Raise() \n", this, mNativeWindowId);
+}
+
+void GlWindow::Lower()
+{
+  mWindowBase->Lower();
+  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Lower() \n", this, mNativeWindowId);
+}
+
+void GlWindow::Activate()
+{
+  mWindowBase->Activate();
+  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Activate() \n", this, mNativeWindowId);
+}
+
+void GlWindow::Show()
+{
+  mVisible = true;
+
+  mWindowBase->Show();
+
+  if(!mIconified)
+  {
+    Dali::GlWindow handle(this);
+    mVisibilityChangedSignal.Emit(handle, true);
+  }
+
+  if(mEventHandler)
+  {
+    mEventHandler->Resume();
+  }
+
+  if(mGlWindowRenderThread)
+  {
+    mGlWindowRenderThread->Resume();
+  }
+
+  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Show(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible);
+}
+
+void GlWindow::Hide()
+{
+  mVisible = false;
+
+  mWindowBase->Hide();
+
+  if(!mIconified)
+  {
+    Dali::GlWindow handle(this);
+    mVisibilityChangedSignal.Emit(handle, false);
+  }
+
+  if(mEventHandler)
+  {
+    mEventHandler->Pause();
+  }
+
+  if(mGlWindowRenderThread)
+  {
+    mGlWindowRenderThread->Pause();
+  }
+
+  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Hide(): iconified = %d, visible = %d\n", this, mNativeWindowId, mIconified, mVisible);
+}
+
+unsigned int GlWindow::GetSupportedAuxiliaryHintCount() const
+{
+  return mWindowBase->GetSupportedAuxiliaryHintCount();
+}
+
+std::string GlWindow::GetSupportedAuxiliaryHint(unsigned int index) const
+{
+  return mWindowBase->GetSupportedAuxiliaryHint(index);
+}
+
+unsigned int GlWindow::AddAuxiliaryHint(const std::string& hint, const std::string& value)
+{
+  return mWindowBase->AddAuxiliaryHint(hint, value);
+}
+
+bool GlWindow::RemoveAuxiliaryHint(unsigned int id)
+{
+  return mWindowBase->RemoveAuxiliaryHint(id);
+}
+
+bool GlWindow::SetAuxiliaryHintValue(unsigned int id, const std::string& value)
+{
+  return mWindowBase->SetAuxiliaryHintValue(id, value);
+}
+
+std::string GlWindow::GetAuxiliaryHintValue(unsigned int id) const
+{
+  return mWindowBase->GetAuxiliaryHintValue(id);
+}
+
+unsigned int GlWindow::GetAuxiliaryHintId(const std::string& hint) const
+{
+  return mWindowBase->GetAuxiliaryHintId(hint);
+}
+
+void GlWindow::SetInputRegion(const Rect<int>& inputRegion)
+{
+  mWindowBase->SetInputRegion(inputRegion);
+
+  DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "GlWindow::SetInputRegion: x = %d, y = %d, w = %d, h = %d\n", inputRegion.x, inputRegion.y, inputRegion.width, inputRegion.height);
+}
+
+void GlWindow::SetOpaqueState(bool opaque)
+{
+  mOpaqueState = opaque;
+
+  mWindowBase->SetOpaqueState(opaque);
+
+  DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "GlWindow::SetOpaqueState: opaque = %d\n", opaque);
+}
+
+bool GlWindow::IsOpaqueState() const
+{
+  return mOpaqueState;
+}
+
+void GlWindow::SetPositionSize(PositionSize positionSize)
+{
+  if(!mResizeEnabled)
+  {
+    AddAuxiliaryHint("wm.policy.win.user.geometry", "1");
+    mResizeEnabled = true;
+  }
+
+  bool needToMove   = false;
+  bool needToResize = false;
+
+  // Check moving
+  if((fabs(positionSize.x - mPositionSize.x) > MINIMUM_DIMENSION_CHANGE) ||
+     (fabs(positionSize.y - mPositionSize.y) > MINIMUM_DIMENSION_CHANGE))
+  {
+    needToMove = true;
+  }
+
+  // Check resizing
+  if((fabs(positionSize.width - mPositionSize.width) > MINIMUM_DIMENSION_CHANGE) ||
+     (fabs(positionSize.height - mPositionSize.height) > MINIMUM_DIMENSION_CHANGE))
+  {
+    needToResize = true;
+  }
+
+  if(needToResize)
+  {
+    if(needToMove)
+    {
+      mWindowBase->MoveResize(positionSize);
+    }
+    else
+    {
+      mWindowBase->Resize(positionSize);
+    }
+    mPositionSize = positionSize;
+  }
+  else
+  {
+    if(needToMove)
+    {
+      mWindowBase->Move(positionSize);
+      mPositionSize = positionSize;
+    }
+  }
+
+  // If window's size or position is changed, the signal will be emitted to user.
+  if(needToMove || needToResize)
+  {
+    Uint16Pair     newSize(mPositionSize.width, mPositionSize.height);
+    Dali::GlWindow handle(this);
+    mResizeSignal.Emit(newSize);
+
+    if(mGlWindowRenderThread)
+    {
+      mGlWindowRenderThread->RequestWindowResize(mPositionSize.width, mPositionSize.height);
+    }
+  }
+}
+
+PositionSize GlWindow::GetPositionSize() const
+{
+  PositionSize positionSize(mPositionSize);
+  if(mTotalRotationAngle == 90 || mTotalRotationAngle == 270)
+  {
+    positionSize.height = mPositionSize.width;
+    positionSize.width  = mPositionSize.height;
+  }
+
+  return positionSize;
+}
+
+void GlWindow::OnIconifyChanged(bool iconified)
+{
+  if(iconified)
+  {
+    mIconified = true;
+
+    if(mVisible)
+    {
+      Dali::GlWindow handle(this);
+      mVisibilityChangedSignal.Emit(handle, false);
+    }
+
+    if(mEventHandler)
+    {
+      mEventHandler->Pause();
+    }
+
+    if(mGlWindowRenderThread)
+    {
+      mGlWindowRenderThread->Pause();
+    }
+
+    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Iconified: visible = %d\n", this, mNativeWindowId, mVisible);
+  }
+  else
+  {
+    mIconified = false;
+
+    if(mVisible)
+    {
+      Dali::GlWindow handle(this);
+      mVisibilityChangedSignal.Emit(handle, true);
+    }
+
+    if(mEventHandler)
+    {
+      mEventHandler->Resume();
+    }
+
+    if(mGlWindowRenderThread)
+    {
+      mGlWindowRenderThread->Resume();
+    }
+
+    DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Deiconified: visible = %d\n", this, mNativeWindowId, mVisible);
+  }
+}
+
+void GlWindow::OnFocusChanged(bool focusIn)
+{
+  Dali::GlWindow handle(this);
+  mFocusChangeSignal.Emit(handle, focusIn);
+}
+
+void GlWindow::OnOutputTransformed()
+{
+  int newScreenRotationAngle = mWindowBase->GetScreenRotationAngle();
+  DALI_LOG_RELEASE_INFO("GlWindow::OnOutputTransformed(), screen rotation occurs, old[%d], new[%d\n", mScreenRotationAngle, newScreenRotationAngle);
+
+  if(newScreenRotationAngle != mScreenRotationAngle)
+  {
+    UpdateScreenRotation(newScreenRotationAngle);
+  }
+}
+
+void GlWindow::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
+{
+  PointState::Type state = point.GetState();
+
+  if(state == PointState::DOWN)
+  {
+    mIsTouched = true;
+  }
+
+  if(state == PointState::UP)
+  {
+    mIsTouched = false;
+  }
+
+  if(!mIsTouched && state == PointState::MOTION)
+  {
+    return;
+  }
+
+  Vector2 convertedPosition = RecalculatePosition(point.GetScreenPosition());
+  point.SetScreenPosition(convertedPosition);
+
+  Dali::TouchEvent touchEvent = Dali::Integration::NewTouchEvent(timeStamp, point);
+  Dali::GlWindow   handle(this);
+  mTouchedSignal.Emit(touchEvent);
+}
+
+void GlWindow::OnMouseFrameEvent()
+{
+}
+
+void GlWindow::OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent)
+{
+  // TODO:
+  //FeedWheelEvent( wheelEvent );
+}
+
+void GlWindow::OnKeyEvent(Dali::Integration::KeyEvent& keyEvent)
+{
+  Dali::KeyEvent event = Dali::DevelKeyEvent::New(keyEvent.keyName, keyEvent.logicalKey, keyEvent.keyString, keyEvent.keyCode, keyEvent.keyModifier, keyEvent.time, static_cast<Dali::KeyEvent::State>(keyEvent.state), keyEvent.compose, keyEvent.deviceName, keyEvent.deviceClass, keyEvent.deviceSubclass);
+  Dali::DevelKeyEvent::SetWindowId(event, keyEvent.windowId);
+  Dali::GlWindow handle(this);
+  mKeyEventSignal.Emit(event);
+}
+
+void GlWindow::OnRotation(const RotationEvent& rotation)
+{
+  mWindowRotationAngle = rotation.angle;
+  mTotalRotationAngle  = (mWindowRotationAngle + mScreenRotationAngle) % 360;
+  if(mTotalRotationAngle == 90 || mTotalRotationAngle == 270)
+  {
+    mWindowWidth  = mPositionSize.height;
+    mWindowHeight = mPositionSize.width;
+  }
+  else
+  {
+    mWindowWidth  = mPositionSize.width;
+    mWindowHeight = mPositionSize.height;
+  }
+
+  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), OnRotation(): resize signal emit [%d x %d]\n", this, mNativeWindowId, mWindowWidth, mWindowHeight);
+
+  // Emit Resize signal
+  Dali::GlWindow handle(this);
+  mResizeSignal.Emit(Dali::Uint16Pair(mWindowWidth, mWindowHeight));
+
+  if(mGlWindowRenderThread)
+  {
+    mGlWindowRenderThread->RequestWindowRotate(mWindowRotationAngle);
+  }
+}
+
+Vector2 GlWindow::RecalculatePosition(const Vector2& position)
+{
+  Vector2 convertedPosition;
+
+  switch(mTotalRotationAngle)
+  {
+    case 90:
+    {
+      convertedPosition.x = static_cast<float>(mWindowWidth) - position.y;
+      convertedPosition.y = position.x;
+      break;
+    }
+    case 180:
+    {
+      convertedPosition.x = static_cast<float>(mWindowWidth) - position.x;
+      convertedPosition.y = static_cast<float>(mWindowHeight) - position.y;
+      break;
+    }
+    case 270:
+    {
+      convertedPosition.x = position.y;
+      convertedPosition.y = static_cast<float>(mWindowHeight) - position.x;
+      break;
+    }
+    default:
+    {
+      convertedPosition = position;
+      break;
+    }
+  }
+  return convertedPosition;
+}
+
+void GlWindow::SetAvailableAnlges(const std::vector<int>& angles)
+{
+  if(angles.size() > 4)
+  {
+    DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::SetAvailableAnlges: Invalid vector size! [%d]\n", angles.size());
+    return;
+  }
+
+  mWindowBase->SetAvailableAnlges(angles);
+}
+
+bool GlWindow::IsOrientationAvailable(WindowOrientation orientation) const
+{
+  if(orientation <= WindowOrientation::NO_ORIENTATION_PREFERENCE || orientation > WindowOrientation::LANDSCAPE_INVERSE)
+  {
+    DALI_LOG_INFO(gWindowLogFilter, Debug::Verbose, "Window::IsOrientationAvailable: Invalid input orientation [%d]\n", orientation);
+    return false;
+  }
+  return true;
+}
+
+int GlWindow::ConvertToAngle(WindowOrientation orientation)
+{
+  int convertAngle = 0;
+  if(mOrientationMode == 0)
+  {
+    convertAngle = static_cast<int>(orientation);
+  }
+  else if(mOrientationMode == 1)
+  {
+    switch(orientation)
+    {
+      case WindowOrientation::LANDSCAPE:
+      {
+        convertAngle = 0;
+        break;
+      }
+      case WindowOrientation::PORTRAIT:
+      {
+        convertAngle = 90;
+        break;
+      }
+      case WindowOrientation::LANDSCAPE_INVERSE:
+      {
+        convertAngle = 180;
+        break;
+      }
+      case WindowOrientation::PORTRAIT_INVERSE:
+      {
+        convertAngle = 270;
+        break;
+      }
+      case WindowOrientation::NO_ORIENTATION_PREFERENCE:
+      {
+        convertAngle = -1;
+        break;
+      }
+    }
+  }
+  return convertAngle;
+}
+
+WindowOrientation GlWindow::ConvertToOrientation(int angle) const
+{
+  WindowOrientation orientation = WindowOrientation::NO_ORIENTATION_PREFERENCE;
+  if(mOrientationMode == 0) // Portrate mode
+  {
+    orientation = static_cast<WindowOrientation>(angle);
+  }
+  else if(mOrientationMode == 1) // Landscape mode
+  {
+    switch(angle)
+    {
+      case 0:
+      {
+        orientation = WindowOrientation::LANDSCAPE;
+        break;
+      }
+      case 90:
+      {
+        orientation = WindowOrientation::PORTRAIT;
+        break;
+      }
+      case 180:
+      {
+        orientation = WindowOrientation::LANDSCAPE_INVERSE;
+        break;
+      }
+      case 270:
+      {
+        orientation = WindowOrientation::PORTRAIT_INVERSE;
+        break;
+      }
+      case -1:
+      {
+        orientation = WindowOrientation::NO_ORIENTATION_PREFERENCE;
+        break;
+      }
+    }
+  }
+  return orientation;
+}
+
+WindowOrientation GlWindow::GetCurrentOrientation() const
+{
+  return ConvertToOrientation(mTotalRotationAngle);
+}
+
+void GlWindow::SetAvailableOrientations(const Dali::Vector<WindowOrientation>& orientations)
+{
+  Dali::Vector<float>::SizeType count = orientations.Count();
+  for(Dali::Vector<float>::SizeType index = 0; index < count; ++index)
+  {
+    if(IsOrientationAvailable(orientations[index]) == false)
+    {
+      DALI_LOG_ERROR("Window::SetAvailableRotationAngles, invalid angle: %d\n", orientations[index]);
+      continue;
+    }
+
+    bool found = false;
+    int  angle = ConvertToAngle(orientations[index]);
+
+    for(std::size_t i = 0; i < mAvailableAngles.size(); i++)
+    {
+      if(mAvailableAngles[i] == angle)
+      {
+        found = true;
+        break;
+      }
+    }
+
+    if(!found)
+    {
+      DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), SetAvailableOrientations: %d\n", this, mNativeWindowId, angle);
+      mAvailableAngles.push_back(angle);
+    }
+  }
+  SetAvailableAnlges(mAvailableAngles);
+}
+
+void GlWindow::SetPreferredOrientation(WindowOrientation orientation)
+{
+  if(IsOrientationAvailable(orientation) == false)
+  {
+    DALI_LOG_ERROR("Window::SetPreferredOrientation, invalid orientation: %d\n", orientation);
+    return;
+  }
+  mPreferredAngle = ConvertToAngle(orientation);
+  DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), SetPreferredOrientation: %d\n", this, mNativeWindowId, mPreferredAngle);
+  mWindowBase->SetPreferredAngle(mPreferredAngle);
+}
+
+void GlWindow::SetChild(Dali::Window& child)
+{
+  if(DALI_UNLIKELY(child))
+  {
+    mChildWindow                             = child;
+    Internal::Adaptor::Window& windowImpl    = Dali::GetImplementation(mChildWindow);
+    WindowRenderSurface*       renderSurface = static_cast<WindowRenderSurface*>(windowImpl.GetSurface());
+    if(renderSurface)
+    {
+      WindowBase* childWindowBase = renderSurface->GetWindowBase();
+      if(childWindowBase)
+      {
+        childWindowBase->SetParent(mWindowBase.get(), false);
+      }
+    }
+  }
+}
+
+void GlWindow::RegisterGlCallbacks(CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback)
+{
+  if(mIsEGLInitialized == false)
+  {
+    InitializeGraphics();
+  }
+  mGlWindowRenderThread->RegisterGlCallbacks(initCallback, renderFrameCallback, terminateCallback);
+  mGlWindowRenderThread->Start();
+}
+
+void GlWindow::RenderOnce()
+{
+  if(mGlWindowRenderThread)
+  {
+    mGlWindowRenderThread->RenderOnce();
+  }
+}
+
+void GlWindow::SetRenderingMode(Dali::GlWindow::RenderingMode mode)
+{
+  mRenderingMode = mode;
+  if(mGlWindowRenderThread)
+  {
+    bool onDemand = false;
+    if(mRenderingMode == Dali::GlWindow::RenderingMode::ON_DEMAND)
+    {
+      onDemand = true;
+    }
+    mGlWindowRenderThread->SetOnDemandRenderMode(onDemand);
+  }
+}
+
+Dali::GlWindow::RenderingMode GlWindow::GetRenderingMode() const
+{
+  return mRenderingMode;
+}
+
+void GlWindow::InitializeGraphics()
+{
+  if(!mIsEGLInitialized)
+  {
+    // Init Graphics
+    std::unique_ptr<EglGraphicsFactory> graphicsFactoryPtr = Utils::MakeUnique<EglGraphicsFactory>(mEnvironmentOptions);
+    auto                                graphicsFactory    = *graphicsFactoryPtr;
+
+    mGraphics = std::unique_ptr<Graphics::GraphicsInterface>(&graphicsFactory.Create());
+
+    Graphics::GraphicsInterface* graphics = mGraphics.get();
+
+    mDisplayConnection = std::unique_ptr<Dali::DisplayConnection>(Dali::DisplayConnection::New(Dali::Integration::RenderSurfaceInterface::Type::WINDOW_RENDER_SURFACE));
+    graphics->Initialize(*mDisplayConnection, mDepth, mStencil, false, mMSAA);
+
+    // Create Render Thread
+    mGlWindowRenderThread = std::unique_ptr<Dali::Internal::Adaptor::GlWindowRenderThread>(new GlWindowRenderThread(mPositionSize, mColorDepth));
+    if(!mGlWindowRenderThread)
+    {
+      DALI_LOG_ERROR("Fail to create GlWindow Render Thread!!!!\n");
+      return;
+    }
+
+    mGlWindowRenderThread->SetGraphicsInterface(graphics);
+    mGlWindowRenderThread->SetWindowBase(mWindowBase.get());
+    bool onDemand = false;
+    if(mRenderingMode == Dali::GlWindow::RenderingMode::ON_DEMAND)
+    {
+      onDemand = true;
+    }
+    mGlWindowRenderThread->SetOnDemandRenderMode(onDemand);
+
+    mIsEGLInitialized = true;
+
+    // Check screen rotation
+    int newScreenRotationAngle = mWindowBase->GetScreenRotationAngle();
+    DALI_LOG_RELEASE_INFO("GlWindow::InitializeGraphics(), GetScreenRotationAngle(): %d\n", mScreenRotationAngle);
+    if(newScreenRotationAngle != 0)
+    {
+      UpdateScreenRotation(newScreenRotationAngle);
+    }
+  }
+}
+
+void GlWindow::OnDamaged(const DamageArea& area)
+{
+}
+
+void GlWindow::UpdateScreenRotation(int newAngle)
+{
+  mScreenRotationAngle = newAngle;
+  mTotalRotationAngle  = (mWindowRotationAngle + mScreenRotationAngle) % 360;
+
+  if(mTotalRotationAngle == 90 || mTotalRotationAngle == 270)
+  {
+    mWindowWidth  = mPositionSize.height;
+    mWindowHeight = mPositionSize.width;
+  }
+  else
+  {
+    mWindowWidth  = mPositionSize.width;
+    mWindowHeight = mPositionSize.height;
+  }
+
+  // Emit Resize signal
+  Dali::GlWindow handle(this);
+  mResizeSignal.Emit(Dali::Uint16Pair(mWindowWidth, mWindowHeight));
+
+  if(mGlWindowRenderThread)
+  {
+    DALI_LOG_RELEASE_INFO("GlWindow::UpdateScreenRotation(), RequestScreenRotatem(), mScreenRotationAngle: %d\n", mScreenRotationAngle);
+    mGlWindowRenderThread->RequestScreenRotate(mScreenRotationAngle);
+  }
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/window-system/gl-window/gl-window-impl.h b/dali/internal/window-system/gl-window/gl-window-impl.h
new file mode 100644 (file)
index 0000000..b0ef7ec
--- /dev/null
@@ -0,0 +1,455 @@
+#ifndef DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_IMPL_H
+#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_IMPL_H
+
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/adaptor-framework/window.h>
+#include <dali/public-api/object/base-object.h>
+#include <dali/public-api/object/ref-object.h>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/gl-window.h>
+#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/window-system/common/event-handler.h>
+
+namespace Dali
+{
+class Adaptor;
+
+namespace Internal
+{
+namespace Adaptor
+{
+class WindowBase;
+
+class GlWindow;
+using GlWindowPtr     = IntrusivePtr<GlWindow>;
+using EventHandlerPtr = IntrusivePtr<EventHandler>;
+
+class GlWindowRenderThread;
+
+/**
+ * Window provides a surface to render onto with orientation.
+ */
+class GlWindow : public BaseObject, public EventHandler::Observer, public DamageObserver, public ConnectionTracker
+{
+public:
+  using KeyEventSignalType          = Dali::GlWindow::KeyEventSignalType;
+  using TouchEventSignalType        = Dali::GlWindow::TouchEventSignalType;
+  using FocusChangeSignalType       = Dali::GlWindow::FocusChangeSignalType;
+  using ResizeSignalType            = Dali::GlWindow::ResizeSignalType;
+  using VisibilityChangedSignalType = Dali::GlWindow::VisibilityChangedSignalType;
+  using SignalType                  = Signal<void()>;
+
+  /**
+   * @brief Create a new GlWindow. This should only be called once by the Application class
+   * @param[in] positionSize The position and size of the window
+   * @param[in] name The window title
+   * @param[in] className The window class name
+   * @param[in] isTransparent Whether window is transparent
+   * @return A newly allocated Window
+   */
+  static GlWindow* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent = false);
+
+  /**
+   * @copydoc Dali::GlWindow::SetGraphicsConfig()
+   */
+  void SetGraphicsConfig(bool depth, bool stencil, int msaa, Dali::GlWindow::GlesVersion version);
+
+  /**
+   * @copydoc Dali::GlWindow::Raise()
+   */
+  void Raise();
+
+  /**
+   * @copydoc Dali::GlWindow::Lower()
+   */
+  void Lower();
+
+  /**
+   * @copydoc Dali::GlWindow::Activate()
+   */
+  void Activate();
+
+  /**
+   * @copydoc Dali::GlWindow::Show()
+   */
+  void Show();
+
+  /**
+   * @copydoc Dali::GlWindow::Hide()
+   */
+  void Hide();
+
+  /**
+   * @copydoc Dali::GlWindow::GetSupportedAuxiliaryHintCount()
+   */
+  unsigned int GetSupportedAuxiliaryHintCount() const;
+
+  /**
+   * @copydoc Dali::GlWindow::GetSupportedAuxiliaryHint()
+   */
+  std::string GetSupportedAuxiliaryHint(unsigned int index) const;
+
+  /**
+   * @copydoc Dali::GlWindow::AddAuxiliaryHint()
+   */
+  unsigned int AddAuxiliaryHint(const std::string& hint, const std::string& value);
+
+  /**
+   * @copydoc Dali::GlWindow::RemoveAuxiliaryHint()
+   */
+  bool RemoveAuxiliaryHint(unsigned int id);
+
+  /**
+   * @copydoc Dali::GlWindow::SetAuxiliaryHintValue()
+   */
+  bool SetAuxiliaryHintValue(unsigned int id, const std::string& value);
+
+  /**
+   * @copydoc Dali::GlWindow::GetAuxiliaryHintValue()
+   */
+  std::string GetAuxiliaryHintValue(unsigned int id) const;
+
+  /**
+   * @copydoc Dali::GlWindow::GetAuxiliaryHintId()
+   */
+  unsigned int GetAuxiliaryHintId(const std::string& hint) const;
+
+  /**
+   * @copydoc Dali::GlWindow::SetInputRegion()
+   */
+  void SetInputRegion(const Rect<int>& inputRegion);
+
+  /**
+   * @copydoc Dali::GlWindow::SetOpaqueState()
+   */
+  void SetOpaqueState(bool opaque);
+
+  /**
+   * @copydoc Dali::GlWindow::IsOpaqueState()
+   */
+  bool IsOpaqueState() const;
+
+  /**
+   * @copydoc Dali::GlWindow::SetPositionSize()
+   */
+  void SetPositionSize(PositionSize positionSize);
+
+  /**
+   * @copydoc Dali::GlWindow::GetPositionSize()
+   */
+  PositionSize GetPositionSize() const;
+
+  /**
+   * @copydoc Dali::GlWindow::GetCurrentOrientation() const
+   */
+  WindowOrientation GetCurrentOrientation() const;
+
+  /**
+   * @copydoc Dali::GlWindow::SetAvailableOrientations()
+   */
+  void SetAvailableOrientations(const Dali::Vector<WindowOrientation>& orientations);
+
+  /**
+   * @copydoc Dali::GlWindow::SetPreferredOrientation()
+   */
+  void SetPreferredOrientation(WindowOrientation orientation);
+
+  /**
+   * @copydoc Dali::GlWindow::RegisterGlCallbacks()
+   */
+  void RegisterGlCallbacks(CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback);
+
+  /**
+   * @copydoc Dali::GlWindow::RenderOnce()
+   */
+  void RenderOnce();
+
+  /**
+   * @copydoc Dali::GlWindow::SetRenderingMode()
+   */
+  void SetRenderingMode(Dali::GlWindow::RenderingMode mode);
+
+  /**
+   * @copydoc Dali::GlWindow::GetRenderingMode()
+   */
+  Dali::GlWindow::RenderingMode GetRenderingMode() const;
+
+public: // For implementation
+  /**
+   * @brief Sets child window with Dali::Window
+   *
+   * @param[in] child The child window.
+   *
+   * Most of cases, child window is the default window in adaptor
+   *
+   * Currently the child window is default window.
+   */
+  void SetChild(Dali::Window& child);
+
+private:
+  /**
+   * Private constructor.
+   * @sa Window::New()
+   */
+  GlWindow();
+
+  /**
+   * Destructor
+   */
+  virtual ~GlWindow();
+
+  /**
+   * Second stage initialization
+   *
+   * @param[in] positionSize The position and size of the window
+   * @param[in] name The window title
+   * @param[in] className The window class name
+   */
+  void Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className);
+
+  /**
+   * Called when the window becomes iconified or deiconified.
+   *
+   * @param[in] iconified The flag whether window is iconifed or deiconfied.
+   */
+  void OnIconifyChanged(bool iconified);
+
+  /**
+   * Called when the window focus is changed.
+   * @param[in] focusIn The flag whether window is focused or not.
+   */
+  void OnFocusChanged(bool focusIn);
+
+  /**
+   * Called when the output is transformed.
+   */
+  void OnOutputTransformed();
+
+  /**
+   * Called when the window receives a delete request.
+   */
+  void OnDeleteRequest();
+
+  /**
+   * @brief Set available rotation angle to window base.
+   *
+   * @param[in] angles The list of the avaiabled rotation angle.
+   */
+  void SetAvailableAnlges(const std::vector<int>& angles);
+
+  /**
+   * @brief Check available window orientation for Available angle.
+   *
+   * @param[in] orientation the oritation value of window rotation.
+   *
+   * @return true is available window orientation. false is not available.
+   */
+  bool IsOrientationAvailable(WindowOrientation orientation) const;
+
+  /**
+   * @brief Convert from window orientation to angle using orientation mode value.
+   *
+   * @param[in] orientation the oritation value of window rotation.
+   *
+   * @return The coverted angle value is returned.
+   */
+  int ConvertToAngle(WindowOrientation orientation);
+
+  /**
+   * @brief Convert from angle to window orientation using orientation mode value.
+   *
+   * @param[in] angle the angle value of window rotation.
+   *
+   * @return The converted window orientation value is returned.
+   */
+  WindowOrientation ConvertToOrientation(int angle) const;
+
+  /**
+   * @brief Initialize and create EGL resource
+   */
+  void InitializeGraphics();
+
+  /**
+   * @brief Sets event handler for window's events.
+   */
+  void SetEventHandler();
+
+  /**
+   * @brief calculate screen position for rotation.
+   */
+  Vector2 RecalculatePosition(const Vector2& position);
+
+  /**
+   * @brief Sets window and class name.
+   *
+   * @param[in] name The name of the window
+   * @param[in] className The class of the window
+   */
+  void SetClass(const std::string& name, const std::string className);
+
+private:
+  /**
+   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnTouchPoint
+   */
+  void OnTouchPoint(Dali::Integration::Point& point, int timeStamp) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnMouseFrameEvent
+   */
+  void OnMouseFrameEvent() override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnWheelEvent
+   */
+  void OnWheelEvent(Dali::Integration::WheelEvent& wheelEvent) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnKeyEvent
+   */
+  void OnKeyEvent(Dali::Integration::KeyEvent& keyEvent) override;
+
+  /**
+   * @copydoc Dali::Internal::Adaptor::EventHandler::Observer::OnRotation
+   */
+  void OnRotation(const RotationEvent& rotation) override;
+
+private: // From Dali::Internal::Adaptor::DamageObserver
+  /**
+   * @copydoc Dali::Internal::Adaptor::DamageObserver::OnDamaged()
+   */
+  void OnDamaged(const DamageArea& area);
+
+  /**
+   * @brief Updates screen rotation value and screen rotation works.
+   *
+   * @param[in] newAngle new screen rotation angle
+   */
+  void UpdateScreenRotation(int newAngle);
+
+public: // Signals
+  /**
+   * @copydoc Dali::GlWindow::FocusChangeSignal()
+   */
+  FocusChangeSignalType& FocusChangeSignal()
+  {
+    return mFocusChangeSignal;
+  }
+
+  /**
+   * @copydoc Dali::GlWindow::ResizeSignal()
+   */
+  ResizeSignalType& ResizeSignal()
+  {
+    return mResizeSignal;
+  }
+
+  /**
+   * @copydoc Dali::GlWindow::KeyEventSignal()
+   */
+  KeyEventSignalType& KeyEventSignal()
+  {
+    return mKeyEventSignal;
+  }
+
+  /**
+   * @copydoc Dali::GlWindow::TouchSignal()
+   */
+  TouchEventSignalType& TouchedSignal()
+  {
+    return mTouchedSignal;
+  }
+
+  /**
+   * @copydoc Dali::GlWindow::VisibilityChangedSignal()
+   */
+  VisibilityChangedSignalType& VisibilityChangedSignal()
+  {
+    return mVisibilityChangedSignal;
+  }
+
+private:
+  std::unique_ptr<WindowBase>                  mWindowBase;
+  std::unique_ptr<Graphics::GraphicsInterface> mGraphics;             ///< Graphics interface
+  std::unique_ptr<Dali::DisplayConnection>     mDisplayConnection;    ///< The native display connection
+  std::unique_ptr<GlWindowRenderThread>        mGlWindowRenderThread; ///< The render thread
+  EventHandlerPtr                              mEventHandler;         ///< The window events handler
+  Dali::Window                                 mChildWindow;          ///< The default child UI Window
+  std::string                                  mName;
+  std::string                                  mClassName;
+  bool                                         mIsTransparent : 1;
+  bool                                         mIsFocusAcceptable : 1;
+  bool                                         mIconified : 1;
+  bool                                         mOpaqueState : 1;
+  bool                                         mResizeEnabled : 1;
+  bool                                         mVisible : 1;
+  bool                                         mIsWindowRotated : 1;
+  bool                                         mIsTouched : 1;
+  bool                                         mIsEGLInitialized : 1;
+  bool                                         mDepth : 1;
+  bool                                         mStencil : 1;
+
+  PositionSize                  mPositionSize; ///< The window position and size
+  EnvironmentOptions            mEnvironmentOptions;
+  std::vector<int>              mAvailableAngles; ///< The list of available angle
+  ColorDepth                    mColorDepth;      ///< The color depth of window
+  Dali::GlWindow::RenderingMode mRenderingMode;   ///< The rendering mode
+
+  int mPreferredAngle;      ///< The angle of preferred angle
+  int mTotalRotationAngle;  ///< The angle of window + screen rotation angle % 360
+  int mWindowRotationAngle; ///< The angle of window rotation angle
+  int mScreenRotationAngle; ///< The angle of screen rotation angle
+  int mOrientationMode;     ///< 0: Default portrati, 1:Default landscape
+  int mWindowWidth;         ///< The width of the window
+  int mWindowHeight;        ///< The height of the window
+  int mNativeWindowId;      ///< The Native Window Id
+  int mMSAA;                ///< The multisample anti-aliasing for EGL Configuration
+
+  // Signals
+  KeyEventSignalType          mKeyEventSignal;
+  TouchEventSignalType        mTouchedSignal;
+  FocusChangeSignalType       mFocusChangeSignal;
+  ResizeSignalType            mResizeSignal;
+  VisibilityChangedSignalType mVisibilityChangedSignal;
+};
+
+} // namespace Adaptor
+} // namespace Internal
+
+// Helpers for public-api forwarding methods
+
+inline Internal::Adaptor::GlWindow& GetImplementation(Dali::GlWindow& window)
+{
+  DALI_ASSERT_ALWAYS(window && "Window handle is empty");
+  BaseObject& object = window.GetBaseObject();
+  return static_cast<Internal::Adaptor::GlWindow&>(object);
+}
+
+inline const Internal::Adaptor::GlWindow& GetImplementation(const Dali::GlWindow& window)
+{
+  DALI_ASSERT_ALWAYS(window && "Window handle is empty");
+  const BaseObject& object = window.GetBaseObject();
+  return static_cast<const Internal::Adaptor::GlWindow&>(object);
+}
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_IMPL_H
diff --git a/dali/internal/window-system/gl-window/gl-window-render-thread.cpp b/dali/internal/window-system/gl-window/gl-window-render-thread.cpp
new file mode 100644 (file)
index 0000000..503db88
--- /dev/null
@@ -0,0 +1,425 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/window-system/gl-window/gl-window-render-thread.h>
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/thread-settings.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/system/common/time-service.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+namespace
+{
+constexpr unsigned int NANOSECONDS_PER_SECOND(1e+9);
+
+// The following values will get calculated at compile time
+constexpr float    DEFAULT_FRAME_DURATION_IN_SECONDS(1.0f / 60.0f);
+constexpr uint64_t DEFAULT_FRAME_DURATION_IN_NANOSECONDS(DEFAULT_FRAME_DURATION_IN_SECONDS* NANOSECONDS_PER_SECOND);
+constexpr uint64_t REFRESH_RATE(1u);
+
+constexpr int MINIMUM_DIMENSION_CHANGE(1);
+} // namespace
+
+GlWindowRenderThread::GlWindowRenderThread(PositionSize positionSize, ColorDepth colorDepth)
+: mGraphics(nullptr),
+  mWindowBase(nullptr),
+  mWindowRotationTrigger(),
+  mLogFactory(Dali::Adaptor::Get().GetLogFactory()),
+  mTraceFactory(Dali::Adaptor::Get().GetTraceFactory()),
+  mPositionSize(positionSize),
+  mColorDepth(colorDepth),
+  mGLInitCallback(),
+  mGLRenderFrameCallback(),
+  mGLTerminateCallback(),
+  mEGLSurface(nullptr),
+  mEGLContext(nullptr),
+  mDepth(false),
+  mStencil(false),
+  mIsEGLInitialize(false),
+  mGLESVersion(30), //Default GLES version 30
+  mMSAA(0),
+  mWindowRotationAngle(0),
+  mScreenRotationAngle(0),
+  mRenderThreadWaitCondition(),
+  mDestroyRenderThread(0),
+  mPauseRenderThread(0),
+  mRenderingMode(0),
+  mRequestRenderOnce(0),
+  mSurfaceStatus(0),
+  mPostRendering(0),
+  mDefaultFrameDurationNanoseconds(REFRESH_RATE * DEFAULT_FRAME_DURATION_IN_NANOSECONDS)
+{
+}
+
+GlWindowRenderThread::~GlWindowRenderThread()
+{
+}
+
+void GlWindowRenderThread::SetGraphicsInterface(Graphics::GraphicsInterface* graphics)
+{
+  mGraphics = graphics;
+}
+
+void GlWindowRenderThread::SetWindowBase(WindowBase* windowBase)
+{
+  mWindowBase = windowBase;
+}
+
+void GlWindowRenderThread::SetGraphicsConfig(bool depth, bool stencil, int msaa, int version)
+{
+  mDepth       = depth;
+  mStencil     = stencil;
+  mMSAA        = msaa;
+  mGLESVersion = version;
+}
+
+void GlWindowRenderThread::Pause()
+{
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+  mPauseRenderThread = 1;
+  DALI_LOG_RELEASE_INFO("GlWindowRenderThread::Pause()\n");
+}
+
+void GlWindowRenderThread::Resume()
+{
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+  mPauseRenderThread = 0;
+  DALI_LOG_RELEASE_INFO("GlWindowRenderThread::Resume()\n");
+  mRenderThreadWaitCondition.Notify(lock);
+}
+
+void GlWindowRenderThread::Stop()
+{
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+  mDestroyRenderThread = 1;
+  DALI_LOG_RELEASE_INFO("GlWindowRenderThread::Stop()\n");
+  mRenderThreadWaitCondition.Notify(lock);
+}
+
+void GlWindowRenderThread::RegisterGlCallbacks(CallbackBase* initCallback,
+                                               CallbackBase* renderFrameCallback,
+                                               CallbackBase* terminateCallback)
+{
+  mGLInitCallback        = std::unique_ptr<CallbackBase>(initCallback);
+  mGLRenderFrameCallback = std::unique_ptr<CallbackBase>(renderFrameCallback);
+  mGLTerminateCallback   = std::unique_ptr<CallbackBase>(terminateCallback);
+}
+
+void GlWindowRenderThread::SetOnDemandRenderMode(bool onDemand)
+{
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+  mRenderingMode = static_cast<unsigned int>(onDemand);
+  DALI_LOG_RELEASE_INFO("GlWindowRenderThread::SetOnDemandRenderMode(): mRenderingMode: %d\n", mRenderingMode);
+  if(!onDemand)
+  {
+    mRenderThreadWaitCondition.Notify(lock);
+  }
+}
+
+void GlWindowRenderThread::RenderOnce()
+{
+  // Most of all, this function is called in event thread
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+  mRequestRenderOnce = 1;
+  mRenderThreadWaitCondition.Notify(lock);
+}
+
+void GlWindowRenderThread::RequestWindowResize(int width, int height)
+{
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+  // Check resizing
+  if((fabs(width - mPositionSize.width) > MINIMUM_DIMENSION_CHANGE) ||
+     (fabs(height - mPositionSize.height) > MINIMUM_DIMENSION_CHANGE))
+  {
+    mSurfaceStatus |= static_cast<unsigned int>(SurfaceStatus::RESIZED); // Set bit for window resized
+    mPositionSize.width  = width;
+    mPositionSize.height = height;
+
+    DALI_LOG_RELEASE_INFO("GlWindowRenderThread::RequestWindowResize(), width:%d, height:%d\n", width, height);
+    mRenderThreadWaitCondition.Notify(lock);
+  }
+}
+
+void GlWindowRenderThread::RequestWindowRotate(int windowAngle)
+{
+  if(!mWindowRotationTrigger)
+  {
+    mWindowRotationTrigger = std::unique_ptr<TriggerEventInterface>(TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &GlWindowRenderThread::WindowRotationCompleted),
+                                                                                                            TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER));
+  }
+
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+  if(mWindowRotationAngle != windowAngle)
+  {
+    mSurfaceStatus |= static_cast<unsigned int>(SurfaceStatus::WINDOW_ROTATED); // Set bit for window rotation
+    mWindowRotationAngle = windowAngle;
+    DALI_LOG_RELEASE_INFO("GlWindowRenderThread::RequestWindowRotate(): %d\n", windowAngle);
+    mRenderThreadWaitCondition.Notify(lock);
+  }
+}
+
+void GlWindowRenderThread::RequestScreenRotate(int screenAngle)
+{
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+  if(mScreenRotationAngle != screenAngle)
+  {
+    mSurfaceStatus |= static_cast<unsigned int>(SurfaceStatus::SCREEN_ROTATED); // Set bit for screen rotation
+    mScreenRotationAngle = screenAngle;
+    DALI_LOG_RELEASE_INFO("GlWindowRenderThread::RequestScreenRotate(): %d\n", screenAngle);
+    mRenderThreadWaitCondition.Notify(lock);
+  }
+}
+
+void GlWindowRenderThread::WindowRotationCompleted()
+{
+  mWindowBase->WindowRotationCompleted(mWindowRotationAngle, mPositionSize.width, mPositionSize.height);
+
+  PostRenderFinish();
+}
+
+unsigned int GlWindowRenderThread::GetSurfaceStatus(int& windowRotationAngle, int& screenRotationAngle)
+{
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+
+  // Get the surface status and reset that.
+  unsigned int status = mSurfaceStatus;
+  mSurfaceStatus      = static_cast<unsigned int>(SurfaceStatus::NO_CHANGED);
+
+  windowRotationAngle = mWindowRotationAngle;
+  screenRotationAngle = mScreenRotationAngle;
+
+  return status;
+}
+
+void GlWindowRenderThread::Run()
+{
+  Dali::SetThreadName("GlWindowRenderThread");
+  mLogFactory.InstallLogFunction();
+  mTraceFactory.InstallTraceFunction();
+
+  int          renderFrameResult = 0;
+  unsigned int isSurfaceChanged  = 0;
+  bool         isWindowResized = false, isWindowRotated = false, isScreenRotated = false;
+  int          windowRotationAngle = 0, screenRotationAngle = 0, totalAngle = 0;
+  EglGraphics* eglGraphics = static_cast<EglGraphics*>(mGraphics);
+
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+
+  InitializeGraphics(eglGraphics);
+
+  eglImpl.MakeContextCurrent(mEGLSurface, mEGLContext);
+
+  if(mGLInitCallback)
+  {
+    CallbackBase::Execute(*mGLInitCallback);
+  }
+
+  uint64_t timeToSleepUntil = 0;
+
+  while(RenderReady(timeToSleepUntil))
+  {
+    uint64_t currentFrameStartTime = 0;
+    TimeService::GetNanoseconds(currentFrameStartTime);
+
+    if(mGLRenderFrameCallback)
+    {
+      // PreRender
+      isSurfaceChanged = GetSurfaceStatus(windowRotationAngle, screenRotationAngle);
+      if(DALI_UNLIKELY(isSurfaceChanged))
+      {
+        isWindowResized = (isSurfaceChanged & static_cast<unsigned int>(SurfaceStatus::RESIZED)) ? true : false;
+        isWindowRotated = (isSurfaceChanged & static_cast<unsigned int>(SurfaceStatus::WINDOW_ROTATED)) ? true : false;
+        isScreenRotated = (isSurfaceChanged & static_cast<unsigned int>(SurfaceStatus::SCREEN_ROTATED)) ? true : false;
+        totalAngle      = (windowRotationAngle + screenRotationAngle) % 360;
+
+        if(isWindowRotated || isScreenRotated)
+        {
+          mWindowBase->SetWindowBufferTransform(totalAngle);
+          if(isWindowRotated)
+          {
+            mWindowBase->SetWindowTransform(windowRotationAngle);
+          }
+        }
+
+        if(isWindowResized)
+        {
+          Dali::PositionSize positionSize;
+          positionSize.x = mPositionSize.x;
+          positionSize.y = mPositionSize.y;
+          if(totalAngle == 0 || totalAngle == 180)
+          {
+            positionSize.width  = mPositionSize.width;
+            positionSize.height = mPositionSize.height;
+          }
+          else
+          {
+            positionSize.width  = mPositionSize.height;
+            positionSize.height = mPositionSize.width;
+          }
+          mWindowBase->ResizeWindow(positionSize);
+        }
+      }
+
+      // Render
+      renderFrameResult = CallbackBase::ExecuteReturn<int>(*mGLRenderFrameCallback);
+
+      // PostRender
+      if(DALI_UNLIKELY(isWindowRotated))
+      {
+        PostRenderStart();
+
+        mWindowRotationTrigger->Trigger();
+
+        PostRenderWaitForFinished();
+        isWindowRotated = false;
+      }
+
+      // buffer commit
+      if(renderFrameResult)
+      {
+        eglImpl.SwapBuffers(mEGLSurface);
+      }
+    }
+    renderFrameResult = 0;
+
+    if(timeToSleepUntil == 0)
+    {
+      timeToSleepUntil = currentFrameStartTime + mDefaultFrameDurationNanoseconds;
+    }
+    else
+    {
+      timeToSleepUntil += mDefaultFrameDurationNanoseconds;
+      uint64_t currentFrameEndTime = 0;
+      TimeService::GetNanoseconds(currentFrameEndTime);
+      while(currentFrameEndTime > timeToSleepUntil + mDefaultFrameDurationNanoseconds)
+      {
+        timeToSleepUntil += mDefaultFrameDurationNanoseconds;
+      }
+    }
+
+    TimeService::SleepUntil(timeToSleepUntil);
+  }
+
+  if(mGLTerminateCallback)
+  {
+    CallbackBase::Execute(*mGLTerminateCallback);
+  }
+
+  if(mIsEGLInitialize)
+  {
+    EglGraphics*                          eglGraphics = static_cast<EglGraphics*>(mGraphics);
+    Internal::Adaptor::EglImplementation& eglImpl     = eglGraphics->GetEglImplementation();
+
+    if(mEGLSurface)
+    {
+      eglImpl.DestroySurface(mEGLSurface);
+      mEGLSurface = nullptr;
+    }
+
+    if(mEGLContext)
+    {
+      eglImpl.DestroyContext(mEGLContext);
+      mEGLContext = nullptr;
+    }
+
+    eglImpl.TerminateGles();
+  }
+}
+
+void GlWindowRenderThread::InitializeGraphics(EglGraphics* eglGraphics)
+{
+  mIsEGLInitialize = true;
+
+  Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+  eglImpl.SetGlesVersion(mGLESVersion);
+
+  if(eglImpl.ChooseConfig(true, mColorDepth) == false)
+  {
+    if(mGLESVersion == 30)
+    {
+      DALI_LOG_RELEASE_INFO("InitializeGraphics: Fail to choose config with GLES30, retry with GLES20\n");
+      eglImpl.SetGlesVersion(20);
+      mGLESVersion = 20;
+      if(eglImpl.ChooseConfig(true, mColorDepth) == false)
+      {
+        DALI_LOG_ERROR("InitializeGraphics: Fail to choose config with GLES20");
+        return;
+      }
+    }
+    else
+    {
+      DALI_LOG_ERROR("InitializeGraphics: Fail to choose config with GLES20");
+      return;
+    }
+  }
+  eglImpl.CreateWindowContext(mEGLContext);
+
+  // Create the EGL window
+  Dali::Any window = mWindowBase->CreateWindow(mPositionSize.width, mPositionSize.height);
+  mEGLSurface      = eglImpl.CreateSurfaceWindow(reinterpret_cast<EGLNativeWindowType>(window.Get<void*>()), mColorDepth);
+}
+
+bool GlWindowRenderThread::RenderReady(uint64_t& timeToSleepUntil)
+{
+  ConditionalWait::ScopedLock updateLock(mRenderThreadWaitCondition);
+  while((!mDestroyRenderThread && mRenderingMode && !mRequestRenderOnce && !mSurfaceStatus) || mPauseRenderThread)
+  {
+    timeToSleepUntil = 0;
+    mRenderThreadWaitCondition.Wait(updateLock);
+  }
+
+  mRequestRenderOnce = 0;
+  // Keep the update-render thread alive if this thread is NOT to be destroyed
+  return !mDestroyRenderThread;
+}
+
+void GlWindowRenderThread::PostRenderStart()
+{
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+  mPostRendering = false;
+}
+
+void GlWindowRenderThread::PostRenderFinish()
+{
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+  mPostRendering = true;
+  mRenderThreadWaitCondition.Notify(lock);
+}
+
+void GlWindowRenderThread::PostRenderWaitForFinished()
+{
+  ConditionalWait::ScopedLock lock(mRenderThreadWaitCondition);
+  while(!mPostRendering && !mDestroyRenderThread)
+  {
+    mRenderThreadWaitCondition.Wait(lock);
+  }
+}
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/window-system/gl-window/gl-window-render-thread.h b/dali/internal/window-system/gl-window/gl-window-render-thread.h
new file mode 100644 (file)
index 0000000..8ef7370
--- /dev/null
@@ -0,0 +1,287 @@
+#ifndef DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_RENDER_THREAD_H
+#define DALI_INTERNAL_WINDOWSYSTEM_COMMON_GL_WINDOW_RENDER_THREAD_H
+
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/threading/conditional-wait.h>
+#include <dali/devel-api/threading/thread.h>
+#include <dali/integration-api/adaptor-framework/log-factory-interface.h>
+#include <dali/integration-api/adaptor-framework/trace-factory-interface.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/window-system/common/window-base.h>
+
+namespace Dali
+{
+class Adaptor;
+class TriggerEventInterface;
+
+namespace Internal
+{
+namespace Adaptor
+{
+class WindowBase;
+class GlWindow;
+
+/**
+ * @brief It is for render thread for GlWindow.
+ * User callbacks works in the thread.
+ *
+ * Key Points:
+ *  1. Two Threads:
+ *    a. Main/Event Thread.
+ *    b. Render Thread.
+ *  2. There is NO VSync thread:
+ *    a. We calculate the difference between these two times and if:
+ *      i.  The difference is less than the default frame time, we sleep.
+ *      ii. If it’s more or the same, we continue.
+ *  3. Support Rendering mode
+ *    a. CONTINUOUS mode
+ *      i. The rendering loop works continuously.
+ *    b. ON_DEMAND mode
+ *      i. The rendering works by user's request.
+ *      ii. User's request is the renderOnce()'s function calling.
+ */
+
+class GlWindowRenderThread : public Dali::Thread
+{
+public:
+  /**
+   * @brief Enumeration for GlWindow Surface status type
+   * It has the status as resized, window is rotated and screen is rotated.
+   *
+   */
+  enum class SurfaceStatus
+  {
+    NO_CHANGED     = 0x00, ///< no changed,
+    RESIZED        = 0x01, ///< When surface is resized,
+    WINDOW_ROTATED = 0x02, ///< When window is rotated,
+    SCREEN_ROTATED = 0x04  ///< When screen is rotated,
+  };
+
+  /**
+   * Constructor
+   *
+   * @param[in] positionSize The position and size of the physical window
+   * @param[in] depth color depth of the physical window
+   */
+  GlWindowRenderThread(PositionSize positionSize, ColorDepth colorDepth);
+
+  /**
+   * destructor.
+   */
+  virtual ~GlWindowRenderThread();
+
+  /**
+   * Sets the GraphicsInterface instance.
+   * This graphics instance is used to create and initialize graphics resource
+   *
+   * @param[in]  graphics           The graphice instance
+   */
+  void SetGraphicsInterface(Graphics::GraphicsInterface* graphics);
+
+  /**
+   * Sets the WindowBase instance
+   * This WindowBase instance is used to call wl egl window APIs.
+   *
+   * @param[in]  windowBase           The WindowBase instance
+   */
+  void SetWindowBase(WindowBase* windowBase);
+
+  /**
+   * @brief Sets graphics configuration for GlWindow
+   *
+   * @param[in] depth the flag of depth buffer. If true is set, 24bit depth buffer is enabled.
+   * @param[in] stencil the flag of stencil. it true is set, 8bit stencil buffer is enabled.
+   * @param[in] msaa the bit of msaa.
+   * @param[in] version the GLES version.
+   *
+   */
+  void SetGraphicsConfig(bool depth, bool stencil, int msaa, int version);
+
+  /**
+   * Pauses the Render Thread.
+   * It is called when GlWindow is iconified or hidden.
+   *
+   * This will lock the mutex in mRenderThreadWaitCondition.
+   */
+  void Pause();
+
+  /**
+   * Resumes the Render Thread.
+   * It is called when GlWindow is de-iconified or shown.
+   *
+   * This will lock the mutex in mRenderThreadWaitCondition.
+   */
+  void Resume();
+
+  /**
+   * Stops the Render Thread.
+   * This will lock the mutex in mRenderThreadWaitCondition.
+   *
+   * @note Should only be called in Stop as calling this will kill the render thread.
+   */
+  void Stop();
+
+  /**
+   * @copydoc Dali::GlWindow::RegisterGlCallbacks()
+   */
+  void RegisterGlCallbacks(CallbackBase* initCallback, CallbackBase* renderFrameCallback, CallbackBase* terminateCallback);
+
+  /**
+   * Enable OnDemand Rendering Mode
+   *
+   * @param[in] onDemand the flag of OnDemand Rendering Mode. If the flag is true, rendering mode is OnDemand, otherwise the flag is false, rendering mode is continuous mode.
+   */
+  void SetOnDemandRenderMode(bool onDemand);
+
+  /**
+   * @copydoc Dali::GlWindow::RenderOnce()
+   */
+  void RenderOnce();
+
+  /**
+   * Requests the window resize to GlWindow's render thread.
+   *
+   * @param[in] width new width.
+   * @param[in] height new height.
+   */
+  void RequestWindowResize(int width, int height);
+
+  /**
+   * Requests the window rotation to GlWindow's render thread.
+   *
+   * @param[in] windowAngle the window rotation's angle as 0, 90, 180 and 270.
+   */
+  void RequestWindowRotate(int windowAngle);
+
+  /**
+   * Requests the screen rotation to GlWindow's render thread.
+   *
+   * @param[in] screenAngle the screen rotation's angle as 0, 90, 180 and 270.
+   */
+  void RequestScreenRotate(int screenAngle);
+
+protected:
+  /**
+   * The Render thread loop. This thread will be destroyed on exit from this function.
+   */
+  virtual void Run();
+
+private:
+  /**
+   * @brief Initialize and create EGL resource
+   */
+  void InitializeGraphics(EglGraphics* eglGraphics);
+
+  /**
+   * Called by the Render Thread which ensures a wait if required.
+   *
+   * @param[out] timeToSleepUntil  The time remaining in nanoseconds to keep the thread sleeping before resuming.
+   * @return false, if the thread should stop.
+   */
+  bool RenderReady(uint64_t& timeToSleepUntil);
+
+  /**
+   * In the Tizen world, when GlWindow rotation is finished in client side,
+   * the completed message should be sent to display server.
+   * This function should be called in the event thread after buffer is committed.
+   */
+  void WindowRotationCompleted();
+
+  /**
+   * Gets window's current surface status
+   *
+   * @brief This function return window's current surface status.
+   * The status has the  the information of window resized, window rotated and screen rotated.
+   * After called, the status value is reset
+   *
+   * @[output] windowRotationAngle return current window rotation angle.
+   * @[output] screenRotationAngle return current screen rotation angle.
+   * @return the window's current surface status.
+   */
+  unsigned int GetSurfaceStatus(int& windowRotationAngle, int& screenRotationAngle);
+
+  /**
+   * Starts post rendering process
+   *
+   * @brief Starts post rendering process for window rotation
+   * It is to pause the render thread until maint thread finishes the window rotation work.
+   */
+  void PostRenderStart();
+
+  /**
+   * Finishs post rendering process
+   *
+   * @brief Finishes post rendering process for window rotation
+   * It set the resume flag for resume the render thread.
+   */
+  void PostRenderFinish();
+
+  /**
+   * Pauses the render thread unitil post rendering process
+   *
+   * @brief Pauses the render thread until main thread works window rotation.
+   */
+  void PostRenderWaitForFinished();
+
+private:
+  Graphics::GraphicsInterface*           mGraphics; ///< Graphics interface
+  WindowBase*                            mWindowBase;
+  std::unique_ptr<TriggerEventInterface> mWindowRotationTrigger;
+
+  const Dali::LogFactoryInterface&   mLogFactory;
+  const Dali::TraceFactoryInterface& mTraceFactory;
+
+  PositionSize mPositionSize; ///< Position
+  ColorDepth   mColorDepth;
+
+  // EGL, GL Resource
+  std::unique_ptr<CallbackBase> mGLInitCallback;
+  std::unique_ptr<CallbackBase> mGLRenderFrameCallback;
+  std::unique_ptr<CallbackBase> mGLTerminateCallback;
+  EGLSurface                    mEGLSurface;
+  EGLContext                    mEGLContext;
+  bool                          mDepth : 1;
+  bool                          mStencil : 1;
+  bool                          mIsEGLInitialize : 1;
+  int                           mGLESVersion;
+  int                           mMSAA;
+  int                           mWindowRotationAngle; ///< The angle of window rotation angle
+  int                           mScreenRotationAngle; ///< The angle of screen rotation angle
+
+  // To manage the render/main thread
+  ConditionalWait       mRenderThreadWaitCondition; ///< The wait condition for the update-render-thread.
+  volatile unsigned int mDestroyRenderThread;       ///< Stop render thread. It means this rendter thread will be destoried.
+  volatile unsigned int mPauseRenderThread;         ///< Sleep render thread by pause.
+  volatile unsigned int mRenderingMode;             ///< Rendering Mode, 0: continuous, 1:OnDemad
+  volatile unsigned int mRequestRenderOnce;         ///< Request rendering once
+  volatile unsigned int mSurfaceStatus;             ///< When surface is changed as resized or rotated, this flag is set. 0: No changed, 1:resized, 2:window rotation, 4:screen rotation
+  volatile unsigned int mPostRendering;             ///< Whether post-rendering is taking place (set by the event & render threads, read by the render-thread).
+
+  uint64_t mDefaultFrameDurationNanoseconds; ///< Default duration of a frame (used for sleeping if not enough time elapsed). Not protected by lock, but written to rarely so not worth adding a lock when reading.
+
+}; // GlWindowRenderThread
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
+
+#endif
diff --git a/dali/internal/window-system/tizen-wayland/display-connection-native-types-dynamic.cpp b/dali/internal/window-system/tizen-wayland/display-connection-native-types-dynamic.cpp
new file mode 100644 (file)
index 0000000..0088afe
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/internal/window-system/tizen-wayland/display-connection-native-types.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-library.h>
+
+namespace Dali::Internal::Adaptor
+{
+__attribute__((weak)) Any CastToNativeGraphicsType(wl_display* display)
+{
+  return GraphicsLibrary::CastToNativeGraphicsType(display);
+}
+
+} // namespace Dali::Internal::Adaptor
diff --git a/dali/internal/window-system/tizen-wayland/graphics-library-functions-tizen-wayland.cpp b/dali/internal/window-system/tizen-wayland/graphics-library-functions-tizen-wayland.cpp
new file mode 100644 (file)
index 0000000..c5a6343
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/tizen-wayland/display-connection-native-types.h>
+#include <dali/public-api/dali-adaptor-common.h>
+
+extern "C"
+{
+  DALI_ADAPTOR_API Dali::Any CastToNativeGraphicsType(void* display)
+  {
+    return Dali::Internal::Adaptor::CastToNativeGraphicsType(static_cast<wl_display*>(display));
+  }
+} // extern "C"
\ No newline at end of file
index 4aac7ad09c2bf09f9a96504245412eec3a86e7c0..b648701d03167b545e52bd7876b61060d51ee4fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -123,8 +123,8 @@ Any NativeImageSurfaceEcoreWl::GetNativeRenderable()
 
 void NativeImageSurfaceEcoreWl::InitializeGraphics()
 {
-  std::unique_ptr<GraphicsFactory> graphicsFactoryPtr = Utils::MakeUnique<GraphicsFactory>(*(new EnvironmentOptions()));
-  auto                             graphicsFactory    = *graphicsFactoryPtr.get();
+  std::unique_ptr<EglGraphicsFactory> graphicsFactoryPtr = Utils::MakeUnique<EglGraphicsFactory>(*(new EnvironmentOptions()));
+  auto                                graphicsFactory    = *graphicsFactoryPtr.get();
 
   mGraphics        = std::unique_ptr<Graphics::GraphicsInterface>(&graphicsFactory.Create());
   auto graphics    = mGraphics.get();
diff --git a/dali/internal/window-system/ubuntu-x11/display-connection-native-types-dynamic.cpp b/dali/internal/window-system/ubuntu-x11/display-connection-native-types-dynamic.cpp
new file mode 100644 (file)
index 0000000..b7ad093
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/internal/window-system/ubuntu-x11/display-connection-native-types.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-library.h>
+
+namespace Dali::Internal::Adaptor
+{
+__attribute__((weak)) Any CastToNativeGraphicsType(XDisplay* display)
+{
+  return GraphicsLibrary::CastToNativeGraphicsType(display);
+}
+
+} // namespace Dali::Internal::Adaptor
diff --git a/dali/internal/window-system/ubuntu-x11/graphics-library-functions-ubuntu-x11.cpp b/dali/internal/window-system/ubuntu-x11/graphics-library-functions-ubuntu-x11.cpp
new file mode 100644 (file)
index 0000000..50e70e8
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/ubuntu-x11/display-connection-native-types.h>
+#include <dali/public-api/dali-adaptor-common.h>
+
+extern "C"
+{
+  DALI_ADAPTOR_API Dali::Any CastToNativeGraphicsType(void* display)
+  {
+    return Dali::Internal::Adaptor::CastToNativeGraphicsType(static_cast<Dali::XDisplay*>(display));
+  }
+} // extern "C"
\ No newline at end of file
diff --git a/dali/internal/window-system/x11/display-connection-native-types-dynamic.cpp b/dali/internal/window-system/x11/display-connection-native-types-dynamic.cpp
new file mode 100644 (file)
index 0000000..914a538
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/internal/window-system/x11/display-connection-native-types.h>
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/common/graphics-library.h>
+
+namespace Dali::Internal::Adaptor
+{
+__attribute__((weak)) Any CastToNativeGraphicsType(::Display* display)
+{
+  return GraphicsLibrary::CastToNativeGraphicsType(display);
+}
+
+} // namespace Dali::Internal::Adaptor
diff --git a/dali/internal/window-system/x11/graphics-library-functions-x11.cpp b/dali/internal/window-system/x11/graphics-library-functions-x11.cpp
new file mode 100644 (file)
index 0000000..6faa5a2
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2025 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/window-system/x11/display-connection-native-types.h>
+#include <dali/public-api/dali-adaptor-common.h>
+
+extern "C"
+{
+  DALI_ADAPTOR_API Dali::Any CastToNativeGraphicsType(void* display)
+  {
+    return Dali::Internal::Adaptor::CastToNativeGraphicsType(static_cast<::Display*>(display));
+  }
+} // extern "C"
\ No newline at end of file
index 67b41d9de89a4535f409030499510b22a3bb51bb..e34eba6f888bf866bcc7add850cbb3ce57c7ed5b 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOW_SYSTEM_X11_WINDOW_SYSTEM_H
 
 /*
- * COPYRIGHT (c) 2023 Samsung Electronics Co., Ltd.
+ * COPYRIGHT (c) 2025 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.
@@ -28,8 +28,9 @@ namespace Dali::Internal::Adaptor::WindowSystem
 {
 /**
  * Class to encapsulate the actual window system calls to X11
+ * Needs exporting as it's called by the graphics libraries
  */
-class WindowSystemX : public WindowSystemBase
+class DALI_ADAPTOR_API WindowSystemX : public WindowSystemBase
 {
 public:
   static Atom ATOM_WM_PROTOCOLS;
@@ -358,8 +359,9 @@ private:
 /**
  * Get the platform implementation of the window system
  * @return the platform implementation of the window system
+ * Needs exporting as it's called by the graphics libraries
  */
-WindowSystemX& GetImplementation();
+DALI_ADAPTOR_API WindowSystemX& GetImplementation();
 
 } // namespace Dali::Internal::Adaptor::WindowSystem
 
index 3d8e9f0aa4b9a7d7d2b3133041923aca504d1a9e..9d754655417638d42be0e685b388ae567c52e3ad 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -30,13 +30,7 @@ Backend gCurrentGraphicsBackend = Backend::DEFAULT;
 
 Backend GetCurrentGraphicsBackend()
 {
-// TODO: Remove below once we actually have it dynamic, but for now just use define
-//  return gCurrentGraphics;
-#if VULKAN_ENABLED
-  return Backend::VULKAN;
-#else
-  return Backend::GLES;
-#endif
+  return gCurrentGraphicsBackend;
 }
 
 void SetGraphicsBackend(Backend backend)
index d86a705627ed32741007d675c951c60491939a89..089f2534f5bb02ed2c4d1934aeb52a10003e1976 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 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.
@@ -138,7 +138,9 @@ NativeImageInterface::Extension* NativeImageSource::GetExtension()
 NativeImageSource::NativeImageSource(uint32_t width, uint32_t height, ColorDepth depth, Any nativeImageSource)
 {
   auto factory = Dali::Internal::Adaptor::GetNativeImageSourceFactory();
-  mImpl        = factory->CreateNativeImageSource(width, height, depth, nativeImageSource).release();
+  DALI_ASSERT_DEBUG(factory && "Unable to get NativeImageSourceFactory\n");
+
+  mImpl = factory->CreateNativeImageSource(width, height, depth, nativeImageSource).release();
 }
 
 NativeImageSource::~NativeImageSource()
index 9620db2659ab2eeb7efcc3b2ffca3b8aa122eace..a05caf36de2c948834450cc83b94f298878e869d 100644 (file)
@@ -28,10 +28,6 @@ Requires(post): /sbin/ldconfig
 Requires(postun): /sbin/ldconfig
 Requires:       giflib
 
-%if 0%{?enable_vulkan}
-Requires:  glslang
-%endif
-
 %define tizen_platform_config_supported 1
 BuildRequires:  pkgconfig(libtzplatform-config)
 
@@ -70,14 +66,11 @@ BuildRequires:  fribidi-devel
 BuildRequires:  pkgconfig(capi-system-info)
 BuildRequires:  pkgconfig(capi-system-sensor)
 
-%if 0%{?enable_vulkan}
 BuildRequires:  pkgconfig(vulkan)
 BuildRequires:  glslang-devel
 BuildRequires:  glslang
-%else
 BuildRequires:  pkgconfig(egl)
 BuildRequires:  pkgconfig(wayland-egl)
-%endif
 
 BuildRequires:  pkgconfig(wayland-client)
 BuildRequires:  pkgconfig(input-method-client)
@@ -94,9 +87,7 @@ BuildRequires:  pkgconfig(libwebpmux)
 
 # We use ecore mainloop
 BuildRequires:  pkgconfig(ecore-wl2)
-%if !0%{?enable_vulkan}
 BuildRequires:  pkgconfig(wayland-egl-tizen)
-%endif
 
 # We need tbm_surface in tizen 3.0 wayland
 BuildRequires:  pkgconfig(libtbm)
@@ -129,6 +120,16 @@ Recommends: %{name}-profile_common = %{version}-%{release}
 The DALi Tizen Adaptor provides a Tizen specific implementation of the dali-core
 platform abstraction and application shell
 
+###########################################
+# Vulkan Graphics Backend
+###########################################
+%package vulkan
+Summary:        The DALi Tizen Adaptor with the Vulkan library
+Requires:       %{name}
+Requires:       glslang
+%description vulkan
+The DALi Tizen Adaptor with the Vulkan library.
+
 ###########################################
 # Dali adapter for profiles
 ###########################################
@@ -305,10 +306,6 @@ cmake_flags+=" -DCMAKE_BUILD_TYPE=Debug"
 cmake_flags+=" -DENABLE_NETWORK_LOGGING=ON"
 %endif
 
-%if 0%{?enable_vulkan}
-cmake_flags+=" -DENABLE_VULKAN=ON"
-%endif
-
 libtoolize --force
 cd %{_builddir}/%{name}-%{version}/build/tizen
 
@@ -614,6 +611,8 @@ exit 0
 %{_libdir}/libdali2-adaptor.so
 %{_libdir}/libdali2-adaptor.so.2
 %{_libdir}/libdali2-adaptor.so.2.0.0
+%{_libdir}/libdali2-adaptor-gles.so
+%{_libdir}/libdali2-adaptor-gl-window-addon.so
 %{_libdir}/libdali2-adaptor-application-normal.so*
 %{_libdir}/libdali2-adaptor-application-widget.so*
 %{_libdir}/libdali2-adaptor-application-watch.so*
@@ -621,6 +620,13 @@ exit 0
 
 #################################################
 
+%files vulkan
+%manifest dali-adaptor.manifest
+%defattr(-,root,root,-)
+%{_libdir}/libdali2-adaptor-vulkan.so
+
+#################################################
+
 %files dali2-feedback-plugin
 %manifest dali-adaptor.manifest
 %defattr(-,root,root,-)