MCPcopy Create free account
hub / github.com/baldurk/renderdoc / handle_cmd

Function handle_cmd

renderdoccmd/renderdoccmd_android.cpp:457–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455}
456
457void handle_cmd(android_app *app, int32_t cmd)
458{
459 ANDROID_LOG("handle_cmd(%i)", cmd);
460 switch(cmd)
461 {
462 case APP_CMD_INIT_WINDOW:
463 {
464 ANDROID_LOG("APP_CMD_INIT_WINDOW");
465 // if we already have a thread handle, see if it's still running
466 if(cmdthread_handle != 0)
467 {
468 ANDROID_LOG("thread handle exists");
469 // if the thread isn't running anymore, we can acquire m_CmdLock. If so, we need to join the
470 // thread and start afresh. If we can't acquire the lock, the thread is still running so we
471 // leave it alone.
472 if(m_CmdLock.trylock())
473 {
474 ANDROID_LOG("thread is dead, reaping");
475 m_CmdLock.unlock();
476 // safe to join here, thread will terminate soon if it hasn't already
477 pthread_join(cmdthread_handle, NULL);
478 cmdthread_handle = 0;
479 }
480 }
481
482 // if we don't have a command thread, start one.
483 if(cmdthread_handle == 0)
484 {
485 ANDROID_LOG("spawning command thread");
486 pthread_create(&cmdthread_handle, NULL, cmdthread, NULL);
487 }
488
489 DisplayGenericSplash();
490 break;
491 }
492 case APP_CMD_WINDOW_REDRAW_NEEDED:
493 case APP_CMD_GAINED_FOCUS:
494 case APP_CMD_LOST_FOCUS:
495 {
496 ANDROID_LOG("doing misc splash");
497 DisplayGenericSplash();
498 break;
499 }
500 }
501}
502
503void android_main(struct android_app *state)
504{

Callers

nothing calls this directly

Calls 3

DisplayGenericSplashFunction · 0.85
trylockMethod · 0.80
unlockMethod · 0.45

Tested by

no test coverage detected