summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android/qandroidplatformvulkanwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Android: rename m_surfaceCreated to m_androidSurfaceCreatedAssam Boudjelthia2025-09-011-2/+2
| | | | | | | | | This would make it clear that the boolean is tracking the Android surface (QtSurface) and not the egl surface. Pick-to: 6.10 Change-Id: Idd46940b9f18d7c489b0ed3ca8b64780f248bb76 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Android: add debug print when egl/vkSurface() called while suspendedAssam Boudjelthia2025-08-271-1/+4
| | | | | | Pick-to: 6.10 Change-Id: I5a75a75c6f56c8b8f9f18aff400aea6160496cee Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Android: add logging for AndroidDeadlockProtectorAssam Boudjelthia2025-08-261-1/+4
| | | | | | | | | | | Have AndroidDeadlockProtector instance provide a string as an identifier of where it's going to be acquired so that when another code try to acquire we can have better logs of what can potentially go wrong. Pick-to: 6.10 Change-Id: I14abc0058831c5f23f2d96c6ce0231a6e0cc8f68 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Android: move AndroidDeadlockProtector to QtAndroidPrivate namespaceAssam Boudjelthia2025-08-261-2/+1
| | | | | | | | | | This way it can be used by all Qt code and not only under the platform plugin and avoid cases where it's forgotten to manually release it when only using acquireAndroidDeadlockProtector(). Pick-to: 6.10 Change-Id: Ie7658b4057d499c470cf7d8706928870edabcf0e Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Android: Unconditionally set geometry when asked to via setGeometryTor Arne Vestbø2024-08-071-3/+0
| | | | | | | | | | | | The geometry() of the platform window may match the incoming geometry at the point of the call, but the native geometry of the Android layout and view might not, so we still need to propagate it to the platform. This matches what other platforms do in QPlatformWindow::setGeometry. Pick-to: 6.8 Change-Id: I5f04a323412ce2ce9561cace1f0cec461c133e28 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Remove unused member m_oldGeometryTor Arne Vestbø2024-08-081-2/+0
| | | | | | | | | The usage was removed in a02ea26b469a32fbdcd9ce777dd46aeacc5cd82f. Pick-to: 6.8 Change-Id: I91ec688b7388ea62b2b69745747f83112eaae439 Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Simplify QAndroidPlatformWindow::setGeometry plumbingTor Arne Vestbø2024-08-081-2/+0
| | | | | | | | | | | Instead of splitting the geometry setting into setGeometry and setNativeGeometry we can leave setGeometry to do the right choice of whether to propagate the geometry to the QtWindow layout or not. Pick-to: 6.8 Change-Id: I30291dbf7079df76f4d3a54d6ea3c9c3f1329c90 Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Add preliminary support for child windowsTinja Paavoseppä2023-12-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the manual test case for embedded windows to have native window on Android. There are still some sharp corners, for example: * The windows are implemented with SurfaceViews, which makes z-ordering with multiple of them a bit tricky. The Surfaces they instantiate are basically z-ordered to either be below everything, with a hole punched in the window, or on top of everything, with the Surfaces created later on top of the ones created earlier. Also, with the foreign views it looks like the native view is on top of the Surface, because it is created later. And since the child windows create their Surfaces before the parent, they would be behind the parent window, currently circumventing this with letting the parent be z-ordered behind everything, and the children on top of everything. A follow up commit addresses this by changing the native view class to TextureView when multiple windows are present. * Parent window always gets the touch events - fixed in a follow up commit * If a child window has a text edit, it does not receive focus when clicking on it Task-number: QTBUG-116187 Change-Id: I32188ec5e3d3fce9fd8e3a931e317d1e081f691c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Android: Make QtLayout per window instead of per screenTinja Paavoseppä2023-12-081-2/+2
| | | | | | | | | | | Each QAndroidPlatformWindow has its own QtLayout, instead of one for the whole app/screen. This paves the way for addition of child windows. Task-number: QTBUG-116187 Change-Id: I36c68cea1a5f27ded3696bcfc2fbc04d9a8ce79e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Android: Give raster windows their own surface, and flush via RHITinja Paavoseppä2023-12-071-38/+7
| | | | | | | | | | | | | | Refactored platform windows on Android so that all window types, including raster windows, have their own surface to draw on. Raster windows now flush the backing-store via RHI/OpenGL. As a drive by, update to newer JNI syntax where appropriate. Task-number: QTBUG-116187 Change-Id: I3b764b7126abf53556750b0ccbb7d27efe007bc1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix passing QJniEnvironment to ANativeWindow_fromSurfaceMarius Kittler2021-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The function ANativeWindow_fromSurface (as declared by `$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/android/native_window_jni.h` from version r22.b of the Android NDK) takes a `JNIEnv*` so `.jniEnv()` must be used. This prevents the following compilation error: ``` error: no matching function for call to 'ANativeWindow_f romSurface' m_nativeWindow = ANativeWindow_fromSurface(env, m_androidSurfaceObject.object()); ^~~~~~~~~~~~~~~~~~~~~~~~~ /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/android/native_window_jni.h:45:16: note: candidate function not viable: no known conversion from 'QJniEnvironment' t o 'JNIEnv *' (aka '_JNIEnv *') for 1st argument ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface); ^ 1 error generated. ``` Pick-to: 6.1 Change-Id: I70d75cb7edc5875314fcb8a70d51d0ef40442101 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Make QJniObject and QJniEnvironment public APIAssam Boudjelthia2021-01-271-5/+5
| | | | | | | | | | | | | | | | | | | | As part of Qt 6 restructring for the extras modules, this change exposes the Jni APIs which are very important for Android platform. This patch adds the APIs QJniObject, QJniEnvironment, QJniExceptionCleaner based from private QtCore and QtAndroidExtras. The Jni interface is cross-platform which justifies the name, but currently, this API is used mainly for Android, and the naming comes generic without Android keyword to avoid any future limitation on supporting other platforms. [ChangeLog][QtCore] Add new QJniObject, QJniEnvironment and QJniExceptionCleaner APIs. Task-number: QTBUG-89482 Fixes: QTBUG-89633 Change-Id: I4382dd53a225375759b9d042f6035a4a9810572b Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* [Android] Make sure expose events are emitted after window resizePiotr Mikolajczyk2020-10-211-3/+1
| | | | | | | | | | | | Expose event would not be sent when window was resized Fixes: QTBUG-69155 Pick-to: 5.15 Change-Id: I81bf2d54f830a0dabf15398e1f25b55ff7ff4479 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
* Basic Vulkan enablersLaszlo Agocs2017-03-171-0/+210
For Android, Windows and xcb. Verified on Win10 with NVIDIA, Win10 with AMD, Android with Tegra K1, Android aarch64 with Tegra X1, and Linux aarch64 with Tegra X1 (Jetson TX1, L4T). Introduce QPA-based Vulkan library loader, core function resolver, and instance creation support. In addition to creating a new VkInstance, adopting an existing one from an external engine is supported as well. The WSI specifics are hidden in the platform plugins. Vulkan-capable windows use the new surface type VulkanSurface and are associated with a QVulkanInstance. On Windows VULKAN_SDK is picked up automatically so finding vulkan.h needs no additional manual steps once the LunarG SDK is installed. [ChangeLog][QtGui] Added support for rendering to QWindow via the Vulkan graphics API. Task-number: QTBUG-55981 Change-Id: I50fa92d313fa440e0cc73939c6d7510ca317fbc9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>