summaryrefslogtreecommitdiff
path: root/Source/Android
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2016-08-13 22:08:53 +1000
committerStenzek <stenzek@gmail.com>2016-10-01 01:09:12 +1000
commit6a99cbd9fc32637b18b1b030ec06ce9c73be04eb (patch)
treeb52a33a7563cd99c00a0fdbb9d3048c7452897ce /Source/Android
parent534607879199e700dbd143317e71218140a58b56 (diff)
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).
Diffstat (limited to 'Source/Android')
-rw-r--r--Source/Android/jni/MainAndroid.cpp24
1 files changed, 5 insertions, 19 deletions
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)