Skip to content

Commit

Permalink
Merge pull request #60505 from m4gr3d/fix_low_processor_mode_renderin…
Browse files Browse the repository at this point in the history
…g_after_resume_3x
  • Loading branch information
akien-mga authored Apr 25, 2022
2 parents 3ba9803 + 7a88d5b commit 795fcc4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions platform/android/java_godot_lib_jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,8 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_onRendererResumed(JNI
if (step.get() <= 0)
return;

// We force redraw to ensure we render at least once when resuming the app.
Main::force_redraw();
if (os_android->get_main_loop()) {
os_android->get_main_loop()->notification(MainLoop::NOTIFICATION_APP_RESUMED);
}
Expand Down
3 changes: 2 additions & 1 deletion platform/android/os_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,11 @@ void OS_Android::main_loop_begin() {
bool OS_Android::main_loop_iterate(bool *r_should_swap_buffers) {
if (!main_loop)
return false;
uint64_t current_frames_drawn = Engine::get_singleton()->get_frames_drawn();
bool exit = Main::iteration();

if (r_should_swap_buffers) {
*r_should_swap_buffers = !is_in_low_processor_usage_mode() || _update_pending;
*r_should_swap_buffers = !is_in_low_processor_usage_mode() || _update_pending || current_frames_drawn != Engine::get_singleton()->get_frames_drawn();
}

return exit;
Expand Down

0 comments on commit 795fcc4

Please sign in to comment.