diff options
author | Marius Kittler <mariuskittler@gmx.de> | 2021-05-08 01:55:19 +0200 |
---|---|---|
committer | Marius Kittler <mariuskittler@gmx.de> | 2021-05-10 10:49:25 +0200 |
commit | 590f70a849d85c438385c313fb452f528fd304a4 (patch) | |
tree | ba421d3363952996b6c8818d21893bbb2577558c /src/plugins/platforms/android | |
parent | 4d4eb11fe340bf0b3a1ce0caae62d9319bf941cf (diff) |
Fix passing QJniEnvironment to ANativeWindow_fromSurface
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>
Diffstat (limited to 'src/plugins/platforms/android')
-rw-r--r-- | src/plugins/platforms/android/qandroidplatformvulkanwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformvulkanwindow.cpp b/src/plugins/platforms/android/qandroidplatformvulkanwindow.cpp index 8f2a37626a..9d4688b52d 100644 --- a/src/plugins/platforms/android/qandroidplatformvulkanwindow.cpp +++ b/src/plugins/platforms/android/qandroidplatformvulkanwindow.cpp @@ -173,7 +173,7 @@ VkSurfaceKHR *QAndroidPlatformVulkanWindow::vkSurface() return &m_vkSurface; QJniEnvironment env; - m_nativeWindow = ANativeWindow_fromSurface(env, m_androidSurfaceObject.object()); + m_nativeWindow = ANativeWindow_fromSurface(env.jniEnv(), m_androidSurfaceObject.object()); VkAndroidSurfaceCreateInfoKHR surfaceInfo; memset(&surfaceInfo, 0, sizeof(surfaceInfo)); |