From 6a99cbd9fc32637b18b1b030ec06ce9c73be04eb Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sat, 13 Aug 2016 22:08:53 +1000 Subject: VideoCommon: Call Renderer::SurfaceChanged on render parent resize This is needed because for some reason the WSI for NV Vulkan drivers doesn't return VK_ERROR_OUT_OF_DATE_KHR, so there is no other way to know that a resize has occured apart from polling, which is a poor solution for X11 (since it is blocking). --- Source/Android/jni/MainAndroid.cpp | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'Source/Android/jni/MainAndroid.cpp') diff --git a/Source/Android/jni/MainAndroid.cpp b/Source/Android/jni/MainAndroid.cpp index 7e3da54b25..5e12fffa57 100644 --- a/Source/Android/jni/MainAndroid.cpp +++ b/Source/Android/jni/MainAndroid.cpp @@ -747,35 +747,21 @@ JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceChang if (surf == nullptr) __android_log_print(ANDROID_LOG_ERROR, DOLPHIN_TAG, "Error: Surface is null."); - // If GLInterface isn't a thing yet then we don't need to let it know that the - // surface has changed - if (GLInterface) - { - GLInterface->UpdateHandle(surf); - Renderer::s_ChangedSurface.Reset(); - Renderer::s_SurfaceNeedsChanged.Set(); - Renderer::s_ChangedSurface.Wait(); - } + if (g_renderer) + g_renderer->ChangeSurface(surf); } JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_SurfaceDestroyed(JNIEnv* env, jobject obj) { + if (g_renderer) + g_renderer->ChangeSurface(nullptr); + if (surf) { ANativeWindow_release(surf); surf = nullptr; } - - // If GLInterface isn't a thing yet then we don't need to let it know that the - // surface has changed - if (GLInterface) - { - GLInterface->UpdateHandle(nullptr); - Renderer::s_ChangedSurface.Reset(); - Renderer::s_SurfaceNeedsChanged.Set(); - Renderer::s_ChangedSurface.Wait(); - } } JNIEXPORT void JNICALL Java_org_dolphinemu_dolphinemu_NativeLibrary_RefreshWiimotes(JNIEnv* env, jobject obj) -- cgit v1.2.3