mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Android: Rewrite GetRenderSurfaceScale in Java
Long sequences of JNI calls are both hard to read and slow.
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
|
||||
package org.dolphinemu.dolphinemu;
|
||||
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Surface;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
@ -571,5 +572,12 @@ public final class NativeLibrary
|
||||
}
|
||||
}
|
||||
|
||||
public static float getRenderSurfaceScale()
|
||||
{
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
sEmulationActivity.get().getWindowManager().getDefaultDisplay().getMetrics(metrics);
|
||||
return metrics.scaledDensity;
|
||||
}
|
||||
|
||||
public static native float GetGameAspectRatio();
|
||||
}
|
||||
|
Reference in New Issue
Block a user