Android: Rewrite GetRenderSurfaceScale in Java
Long sequences of JNI calls are both hard to read and slow.
This commit is contained in:
1 parent
a161e58591
commit
02fe1cdec4
2 files changed
+11
-38
No files matched your search
@@ -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