mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-15 23:40:29 +02:00
Android: Handle rotation and window resizing without recreating the activity
Every rotation, fold or window resize destroyed the activity and with it all of graphics, then built it all up again. Declare those config changes handled, so they arrive as a surfaceChanged and go through the same resize path as a desktop window resize. That path needed three things it didn't have on Android: - The GPU_DISPLAY_RESIZED message, left out for Android since 2020 when DeviceRestore covered every size change. - A fixed (hardware scaled) surface size is now recomputed on each in-place surface change, since surfaceCreated no longer runs on a rotation. - A 180 degree flip keeps the size but changes the surface transform, so the display rotation is passed along and a change in it is a resize too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
c7a2cb6f63
commit
d0e45b94d9
6 files changed
+52
-10
No files matched your search
+3
-1
@@ -1345,7 +1345,9 @@ void NativeFrame(GraphicsContext *graphicsContext) {
|
||||
g_screenManager->resized();
|
||||
|
||||
// TODO: Move this to the GraphicsContext objects for each backend.
|
||||
#if !PPSSPP_PLATFORM(WINDOWS) && !defined(ANDROID)
|
||||
// (Android used to be left out here, since every size change there was a full graphics restart,
|
||||
// and DeviceRestore covers it. Rotation and window resizing are in-place now.)
|
||||
#if !PPSSPP_PLATFORM(WINDOWS)
|
||||
PSP_CoreParameter().pixelWidth = g_display.pixel_xres;
|
||||
PSP_CoreParameter().pixelHeight = g_display.pixel_yres;
|
||||
System_PostUIMessage(UIMessage::GPU_DISPLAY_RESIZED);
|
||||
|
||||
Reference in new issue
Block a user