mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 05:08:57 +00:00
Android: Rewrite GetRenderSurfaceScale in Java
Long sequences of JNI calls are both hard to read and slow.
This commit is contained in:
parent
a161e58591
commit
02fe1cdec4
2 changed files with 11 additions and 38 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue