This commit is contained in:
Henrik Rydgård 2019-10-06 00:20:49 +02:00
parent c023cd7e20
commit 0698944752
4 changed files with 10 additions and 9 deletions

View File

@ -211,7 +211,7 @@ void AndroidVulkanContext::SwapBuffers() {
}
void AndroidVulkanContext::Resize() {
ILOG("AndroidVulkanContext::Resize begin (%d, %d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
ILOG("AndroidVulkanContext::Resize begin (oldsize: %dx%d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
draw_->HandleEvent(Draw::Event::LOST_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
g_Vulkan->DestroyObjects();
@ -220,7 +220,7 @@ void AndroidVulkanContext::Resize() {
g_Vulkan->ReinitSurface();
g_Vulkan->InitObjects();
draw_->HandleEvent(Draw::Event::GOT_BACKBUFFER, g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
ILOG("AndroidVulkanContext::Resize end (%d, %d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
ILOG("AndroidVulkanContext::Resize end (final size: %dx%d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight());
}
void AndroidVulkanContext::SwapInterval(int interval) {

View File

@ -629,6 +629,7 @@ static void recalculateDpi() {
pixel_in_dps_x = (float)pixel_xres / dp_xres;
pixel_in_dps_y = (float)pixel_yres / dp_yres;
ILOG("RecalcDPI: display_xres=%d display_yres=%d", display_xres, display_yres);
ILOG("RecalcDPI: g_dpi=%f g_dpi_scale_x=%f g_dpi_scale_y=%f", g_dpi, g_dpi_scale_x, g_dpi_scale_y);
ILOG("RecalcDPI: dp_xscale=%f dp_yscale=%f", dp_xscale, dp_yscale);
ILOG("RecalcDPI: dp_xres=%d dp_yres=%d", dp_xres, dp_yres);
@ -904,6 +905,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_setDisplayParameters(JN
display_hz = refreshRate;
recalculateDpi();
NativeResized();
}
extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_computeDesiredBackbufferDimensions() {

View File

@ -53,8 +53,6 @@ import java.lang.reflect.Field;
import java.util.List;
import java.util.Locale;
import static android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
public abstract class NativeActivity extends Activity implements SurfaceHolder.Callback {
// Remember to loadLibrary your JNI .so in a static {} block
@ -414,14 +412,13 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
flags |= View.SYSTEM_UI_FLAG_LOW_PROFILE;
}
if (useImmersive()) {
flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | SYSTEM_UI_FLAG_HIDE_NAVIGATION;
flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
}
if (getWindow().getDecorView() != null) {
getWindow().getDecorView().setSystemUiVisibility(flags);
} else {
Log.e(TAG, "updateSystemUiVisibility: decor view not yet created, ignoring");
Log.e(TAG, "updateSystemUiVisibility: decor view not yet created, ignoring for now");
}
updateDisplayMeasurements();
}
@ -606,6 +603,7 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
Log.w(TAG, "Surface changed. Resolution: " + width + "x" + height + " Format: " + format);
// The window size might have changed (immersive mode, native fullscreen on some devices)
NativeApp.backbufferResize(width, height, format);
updateDisplayMeasurements();
mSurface = holder.getSurface();
if (!javaGL) {
// If we got a surface, this starts the thread. If not, it doesn't.
@ -678,7 +676,7 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
// whether it's because of our or system actions.
// We will try to force it to follow our preference but will not stupidly
// act as if it's visible if it's not.
navigationHidden = ((visibility & SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 0);
navigationHidden = ((visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) != 0);
// TODO: Check here if it's the state we want.
Log.i(TAG, "SystemUiVisibilityChange! visibility=" + visibility + " navigationHidden: " + navigationHidden);
updateDisplayMeasurements();
@ -812,7 +810,7 @@ public abstract class NativeActivity extends Activity implements SurfaceHolder.C
updateSystemUiVisibility();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
densityDpi = (float) newConfig.densityDpi;
densityDpi = (float)newConfig.densityDpi;
}
}

View File

@ -125,6 +125,7 @@ void ScreenManager::deviceRestored() {
}
void ScreenManager::resized() {
ILOG("ScreenManager::resized(dp: %dx%d)", dp_xres, dp_yres);
std::lock_guard<std::recursive_mutex> guard(inputLock_);
// Have to notify the whole stack, otherwise there will be problems when going back
// to non-top screens.