IF(DEFINED ADAPTOR_GRAPHICS_GLES_SOURCES AND DEFINED ADAPTOR_GRAPHICS_VULKAN_SOURCES)
IF(enable_graphics_backend MATCHES DYNAMIC)
# Separate GLES Graphics Library
+ MESSAGE(STATUS "Separating GLES and Vulkan graphics into their own libraries")
+
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} ${COVERAGE})
SET(GRAPHICS_BACKEND_TYPE "Dynamic (GLES/VULKAN)")
ELSEIF(enable_graphics_backend MATCHES GLES)
# Add GLES sources to main adaptor library
+ MESSAGE(STATUS "Integrating GLES graphics into main lib")
SET(GRAPHICS_BACKEND_TYPE "GLES")
SET(SOURCES ${SOURCES} ${ADAPTOR_GRAPHICS_GLES_SOURCES})
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS}
# Add VULKAN sources to main adaptor library
SET(GRAPHICS_BACKEND_TYPE "VULKAN")
SET(SOURCES ${SOURCES} ${ADAPTOR_GRAPHICS_VULKAN_SOURCES})
+ MESSAGE(STATUS "Integrating Vulkan graphics into main lib")
+ IF(ANDROID_PROFILE)
+ ADD_DEFINITIONS(-DVK_USE_PLATFORM_ANDROID_KHR=1)
+ ENDIF()
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS}
${VULKAN_LDFLAGS}
${GLSLANG_LDFLAGS}
${devel_api_src_files}
${adaptor_devel_api_text_abstraction_src_files}
${adaptor_graphics_common_src_files}
- ${adaptor_graphics_gles_src_files}
- ${adaptor_graphics_android_src_files}
${adaptor_haptics_common_src_files}
${adaptor_imaging_common_src_files}
${adaptor_imaging_android_src_files}
${static_libraries_libunibreak_src_files}
${adaptor_addons_common_src_files}
${adaptor_addons_android_src_files}
+ ${adaptor_graphics_gles_src_files}
+ ${adaptor_graphics_egl_android_src_files}
+ ${adaptor_imaging_egl_android_src_files}
)
+#SET(ADAPTOR_GRAPHICS_GLES_SOURCES
+# ${adaptor_graphics_gles_src_files}
+# ${adaptor_graphics_egl_android_src_files}
+# ${adaptor_imaging_egl_android_src_files}
+#)
+
+#SET(ADAPTOR_GRAPHICS_VULKAN_SOURCES
+# ${adaptor_graphics_vulkan_src_files}
+# ${adaptor_graphics_vulkan_android_src_files}
+# ${adaptor_imaging_vulkan_android_src_files}
+# ${adaptor_libraries_spirv_reflect_src_files}
+#)
+
IF( ENABLE_VECTOR_BASED_TEXT_RENDERING )
SET( SOURCES ${SOURCES}
${static_libraries_glyphy_src_files}
${adaptor_graphics_dir}/vulkan/wayland/vk-surface-wayland.cpp
)
-# module: graphics, backend: vulkan/tizen
-SET( adaptor_graphics_vulkan_tizen_src_files
- ${adaptor_graphics_dir}/vulkan/api/vulkan-api-native-texture.cpp
-)
-
# module: graphics, backend: tizen
SET( adaptor_graphics_tizen_src_files
${adaptor_graphics_dir}/tizen/egl-image-extensions-tizen.cpp
${adaptor_graphics_dir}/generic/egl-sync-implementation.cpp
)
-# module: graphics, backend: android
-SET( adaptor_graphics_android_src_files
+# module: graphics, backend: android, egl
+SET( adaptor_graphics_egl_android_src_files
${adaptor_graphics_dir}/android/egl-image-extensions-android.cpp
${adaptor_graphics_dir}/android/egl-sync-implementation-android.cpp
)
+# module: graphics, backend: android, vulkan
+SET( adaptor_graphics_vulkan_android_src_files
+ ${adaptor_graphics_dir}/vulkan/android/vk-surface-android.cpp
+)
+
# module: graphics, backend: windows
SET( adaptor_graphics_windows_src_files
${adaptor_graphics_dir}/windows-gl/egl-image-extensions.cpp
#define DALI_GRAPHICS_VULKAN_TYPES
/*
- * 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.
XLIB,
XCB,
WAYLAND,
+ PLATFORM_ANDROID,
};
struct FormatInfo
--- /dev/null
+/*
+ * 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.
+ *
+ */
+
+#include <dali/internal/graphics/vulkan/android/vk-surface-android.h>
+#include <dali/internal/graphics/vulkan/vulkan-hpp-wrapper.h>
+#include <dali/internal/window-system/common/window-render-surface.h>
+
+namespace Dali
+{
+namespace Graphics
+{
+namespace Vulkan
+{
+VkSurfaceAndroid::VkSurfaceAndroid(NativeWindowInterface& nativeWindow)
+: SurfaceFactory()
+{
+ mWindow = static_cast<ANativeWindow*>(AnyCast<void*>(nativeWindow.GetNativeWindow()));
+}
+
+VkSurfaceAndroid::VkSurfaceAndroid(ANativeWindow* window)
+: SurfaceFactory()
+{
+ mWindow = window;
+}
+
+vk::SurfaceKHR VkSurfaceAndroid::Create(
+ vk::Instance instance,
+ const vk::AllocationCallbacks* allocCallbacks) const
+{
+ vk::AndroidSurfaceCreateInfoKHR info;
+ info.window = mWindow;
+
+ auto retval = instance.createAndroidSurfaceKHR(info, allocCallbacks).value;
+
+ return retval;
+}
+
+} // namespace Vulkan
+
+std::unique_ptr<SurfaceFactory> SurfaceFactory::New(NativeWindowInterface& nativeWindow)
+{
+ auto surfaceFactory = std::unique_ptr<Graphics::Vulkan::VkSurfaceAndroid>(new Graphics::Vulkan::VkSurfaceAndroid(nativeWindow));
+ return surfaceFactory;
+}
+
+} // namespace Graphics
+} // namespace Dali
--- /dev/null
+#ifndef DALI_GRAPHICS_VULKAN_SURFACE_ANDROID_H
+#define DALI_GRAPHICS_VULKAN_SURFACE_ANDROID_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.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/internal/graphics/vulkan/vulkan-surface-factory.h>
+
+// EXTERNAL INCLUDES
+#include <android_native_app_glue.h>
+#include <vulkan/vulkan.hpp>
+
+namespace Dali
+{
+class RenderSurface;
+
+namespace Graphics
+{
+namespace Vulkan
+{
+class VkSurfaceAndroid final : public SurfaceFactory
+{
+public:
+ VkSurfaceAndroid(NativeWindowInterface& renderSurface);
+ VkSurfaceAndroid(ANativeWindow* window);
+
+ virtual vk::SurfaceKHR Create(
+ vk::Instance instance,
+ const vk::AllocationCallbacks* allocCallbacks) const override;
+
+private:
+ ANativeWindow* mWindow;
+};
+
+} // Namespace Vulkan
+} // Namespace Graphics
+} // Namespace Dali
+
+#endif // DALI_GRAPHICS_VULKAN_SURFACE_ANDROID_H
#define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface"
#endif
+#ifndef VK_KHR_ANDROID_SURFACE_EXTENSION_NAME
+#define VK_KHR_ANDROID_SURFACE_EXTENSION_NAME "VK_KHR_android_surface"
+#endif
+
#include <iostream>
#include <utility>
bool xlibAvailable{false};
bool xcbAvailable{false};
bool waylandAvailable{false};
+ bool androidAvailable{false};
bool debugReportExtensionAvailable{false};
for(auto&& ext : availableExtensions.value)
{
waylandAvailable = true;
}
+ else if(extensionName == VK_KHR_ANDROID_SURFACE_EXTENSION_NAME)
+ {
+ androidAvailable = true;
+ }
else if(extensionName == VK_EXT_DEBUG_REPORT_EXTENSION_NAME)
{
debugReportExtensionAvailable = true;
* VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME
*/
}
+ else if(platform == Platform::PLATFORM_ANDROID && androidAvailable)
+ {
+ extensions.push_back(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME);
+ }
}
else // try to determine the platform based on available extensions
{
* VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME
*/
}
+ else if(androidAvailable)
+ {
+ mPlatform = Platform::PLATFORM_ANDROID;
+ extensions.push_back(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME);
+ }
else
{
// can't determine the platform!
--- /dev/null
+/*
+ * 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/imaging/android/native-image-source-factory-android.h>
+
+// INTERNAL HEADERS
+#include <dali/internal/imaging/android/native-image-source-impl-android.h>
+#include <dali/internal/imaging/android/native-image-source-queue-impl-android.h>
+
+namespace Dali
+{
+namespace Internal
+{
+namespace Adaptor
+{
+std::unique_ptr<NativeImageSource> NativeImageSourceFactoryAndroid::CreateNativeImageSource(uint32_t width, uint32_t height, Dali::NativeImageSource::ColorDepth depth, Any nativeImageSource)
+{
+ return nullptr;
+}
+
+std::unique_ptr<NativeImageSourceQueue> NativeImageSourceFactoryAndroid::CreateNativeImageSourceQueue(uint32_t queueCount, uint32_t width, uint32_t height, Dali::NativeImageSourceQueue::ColorFormat colorFormat, Any nativeImageSourceQueue)
+{
+ return nullptr;
+}
+
+std::unique_ptr<NativeImageSourceFactory> GetNativeImageSourceFactory()
+{
+ return nullptr;
+}
+
+} // namespace Adaptor
+} // namespace Internal
+} // namespace Dali
# module: imaging, backend: android
SET( adaptor_imaging_android_src_files
${adaptor_imaging_dir}/common/file-download.cpp
+)
+
+# module: imaging, backend: android, egl
+SET( adaptor_imaging_egl_android_src_files
${adaptor_imaging_dir}/android/native-image-source-factory-android.cpp
${adaptor_imaging_dir}/android/native-image-source-impl-android.cpp
${adaptor_imaging_dir}/android/native-image-source-queue-impl-android.cpp
)
+# module: imaging, backend: android, vulkan
+SET( adaptor_imaging_vulkan_android_src_files
+ ${adaptor_imaging_dir}/android/native-image-source-factory-android-vulkan.cpp
+)
+
# module: imaging, backend: windows
SET( adaptor_imaging_windows_src_files
${adaptor_imaging_dir}/windows/curl-environment-win.cpp
/*
- * 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/window-system/android/window-base-android.h>
// INTERNAL HEADERS
-#include <dali/internal/graphics/common/egl-include.h>
#include <dali/internal/window-system/common/window-impl.h>
#include <dali/internal/window-system/common/window-render-surface.h>
Dali::Any WindowBaseAndroid::CreateWindow(int width, int height)
{
- // from eglplatform.h header
- // typedef struct ANativeWindow* EGLNativeWindowType;
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "Returns the window created for us.\n");
auto window = static_cast<void*>(mWindow);