add a version of Engine::flushAndWait that takes a timeout

The old version that doesn't take a timeout now always waits forever;
before it waited for a few seconds on Android debug builds.

The new version has an explicit timeout that works on all platforms and
returns success status.

FIXES=[384043020]
This commit is contained in:
Mathias Agopian
2025-01-23 14:24:16 -08:00
committed by Mathias Agopian
parent 4465e6c7f6
commit 41f7dc384b
6 changed files with 60 additions and 37 deletions

View File

@@ -392,11 +392,11 @@ Java_com_google_android_filament_Engine_nIsValidSwapChain(JNIEnv*, jclass,
return (jboolean)engine->isValid((SwapChain*)nativeSwapChain);
}
extern "C" JNIEXPORT void JNICALL
extern "C" JNIEXPORT jboolean JNICALL
Java_com_google_android_filament_Engine_nFlushAndWait(JNIEnv*, jclass,
jlong nativeEngine) {
jlong nativeEngine, jlong timeout) {
Engine* engine = (Engine*) nativeEngine;
engine->flushAndWait();
return engine->flushAndWait((uint64_t)timeout);
}
extern "C" JNIEXPORT void JNICALL