some optimizations. apply current transform to native window instead of defaulting to Identity

This commit is contained in:
Emmanuel Hansen 2023-08-08 16:06:35 +00:00
parent 8d2c355ced
commit 613759199b
12 changed files with 473 additions and 35 deletions

View file

@ -30,6 +30,7 @@ namespace LibRyujinx
{
private static ManualResetEvent _surfaceEvent;
private static long _surfacePtr;
private static long _window = 0;
public static VulkanLoader? VulkanLoader { get; private set; }
@ -48,6 +49,9 @@ namespace LibRyujinx
[DllImport("libryujinxjni")]
internal extern static void onFrameEnd(double time);
[DllImport("libryujinxjni")]
internal extern static void setCurrentTransform(long native_window, int transform);
public delegate IntPtr JniCreateSurface(IntPtr native_surface, IntPtr instance);
[UnmanagedCallersOnly(EntryPoint = "JNI_OnLoad")]
@ -236,9 +240,10 @@ namespace LibRyujinx
}
[UnmanagedCallersOnly(EntryPoint = "Java_org_ryujinx_android_RyujinxNative_graphicsSetSurface")]
public static void JniSetSurface(JEnvRef jEnv, JObjectLocalRef jObj, JLong surfacePtr)
public static void JniSetSurface(JEnvRef jEnv, JObjectLocalRef jObj, JLong surfacePtr, JLong window)
{
_surfacePtr = surfacePtr;
_window = window;
_surfaceEvent.Set();
}