mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-17 19:34:39 +01:00
Android: Re-report the surface when the display density changes
Now that density is in configChanges, a density change no longer recreates the activity - but it also doesn't resize the surface, so no surfaceChanged follows it. The DPI is only recalculated in backbufferResize, so the UI kept the old scale until the next real resize or a trip through the background. Re-report the surface we already have when the density has moved. The native side needs no change: Recalculate() already returns true when the dp size changes, which a density change does on its own. Also make the log line say which size changed, since the pixel size now stays put in this case. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01152igCdjTNhT29qvphPyPC
This commit is contained in:
1 parent
114512774d
commit
a2869a47cd
3 files changed
+38
-2
No files matched your search
@@ -951,6 +951,8 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_backbufferResize(JNIEnv
|
||||
|
||||
int old_w = g_display.pixel_xres;
|
||||
int old_h = g_display.pixel_yres;
|
||||
int old_dp_w = g_display.dp_xres;
|
||||
int old_dp_h = g_display.dp_yres;
|
||||
|
||||
// pixel_*res is the backbuffer resolution.
|
||||
backbuffer_format = format;
|
||||
@@ -973,7 +975,9 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_backbufferResize(JNIEnv
|
||||
display_dpi, dpi_x, dpi_y, display_scale_x, display_scale_y, g_display.dpi_scale_x, g_display.dpi_scale_y, g_display.dp_xres, g_display.dp_yres);
|
||||
|
||||
if (new_size || rotated) {
|
||||
INFO_LOG(Log::G3D, "%s detected (previously %d,%d) - calling NativeResized()", new_size ? "Size change" : "Rotation change", old_w, old_h);
|
||||
// Note that a density change moves the dp size while the pixel size stays put.
|
||||
INFO_LOG(Log::G3D, "%s detected (previously %dx%d px, %dx%d dp) - calling NativeResized()",
|
||||
new_size ? "Size change" : "Rotation change", old_w, old_h, old_dp_w, old_dp_h);
|
||||
NativeResized();
|
||||
} else {
|
||||
INFO_LOG(Log::G3D, "NativeApp::backbufferResize: Size didn't change.");
|
||||
|
||||
Reference in new issue
Block a user